Repository navigation
Key compiled forward sharing and Inductor validation by GPU name - #597
brandonmmusic-max wants to merge 1 commit into
Conversation
|
A case file has been opened for 597. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedFixes a real mixed-SKU SM120 gap (cross-SKU
Walkthrough
Merge Risk: Medium · up to
|
…y GPU name
Multi-GPU SM120 hosts pairing RTX PRO 6000 Blackwell Max-Q Workstation Edition
and RTX PRO 6000 Blackwell Workstation Edition GPUs share compute capability
(12, 0) but report distinct CUDA device names and can compile different
Inductor kernel inventories for the same logical compilation_variant. Although
ForwardCache.__init__ already partitions self.root by properties.name,
ForwardCache._prepare_ranks previously keyed _variant_compilers and
paths[name, variant] by compilation_variant alone and lent missing compilations
across all ranks on a host regardless of GPU name, ForwardCache._publication_lock
locked only one cache root per host, _share_artifacts fetched peer artifacts
without scoping to self.root, allocate_workers could starve a secondary active
SKU group on a host, and InductorSelections.warm required identical Inductor
kernel inventories across all ranks sharing one compilation_variant string.
Add cuda_device_identity(device) in ignition/preparation/inductor_tuning.py,
lock every distinct (host, resolved_root) in deterministic sorted order in
ForwardCache._publication_lock, and extend allocate_workers in
ignition/preparation/compile_pool.py with an optional groups parameter that
rejects host worker limits smaller than the active group count with ValueError,
restricts the 2 GiB minimum-allowance fallback strictly to single-active-group
hosts, and enforces monotonic full per-worker memory admission across multiple
active SKU groups before distributing surplus workers. In
ForwardCache._prepare_ranks, gather (gpu_name, capability) across ranks, reject
cross-architecture rank groups, key selections, compilers, work, lent, and paths
by (compilation_variant, gpu_name) while keeping un-suffixed
{name}.{compilation_variant} on-disk filenames inside each SKU's self.root,
restrict host-local lending to matching (host, gpu_name) peers, and pass
root=self.root to _share_artifacts so multi-host transfers fetch only artifacts
under the rank's own cache root. Key InductorSelections.warm kernel-inventory
agreement by (compilation_variant, gpu_name). Update docs/model-preparation.md
and docs/preparation-development.md, and add 20 CPU unit tests in
tests/preparation/test_mixed_gpu_inductor_keying.py.
This enables tensor-parallel preparation on mixed-SKU same-architecture SM120
hosts while preserving homogeneous-to-mixed cache reuse inside per-SKU roots,
monotonic host RAM admission, multi-host cache-root isolation, and
cross-architecture rejection.
Validated with standalone CPU pytest (CUDA_VISIBLE_DEVICES="" pytest
tests/preparation/test_mixed_gpu_inductor_keying.py
tests/preparation/test_forward_artifact_sharing.py
tests/preparation/test_inductor_prepared_winners.py
tests/preparation/test_compile_pool.py tests/preparation/test_core_boundary.py:
103 passed, 2 warnings in 33.58s, including 20 tests in
test_mixed_gpu_inductor_keying.py) and prior combined-stack mixed-SKU TP4 and
homogeneous TP2 export and flare run serving checks on DeepSeek-V4.1-Flash and
the gb202 / gb202-tp2 Hugging Face package revisions of
brandonmusic/glm-5.3-flash-exl3-tr3-2.375bpw-flare.
tests/preparation/test_inductor_tuning_cuda.py and live GPU re-exports were not
run during this CPU-only update pass, cross-architecture rejection and two-host
root isolation are verified on CPU only, and Rust crate tests were not run
because only Python, test, and documentation files changed.
Design-Signed-Off-By: Brandon M. Music; design-review=c3a9
Signed-off-by: Brandon M. Music <266531604+brandonmmusic-max@users.noreply.github.com>
f8a033a to
1acb1f0
Compare
|
Updated branch (
Verification (CPU-only update pass; CUDA_VISIBLE_DEVICES="" pytest \
tests/preparation/test_mixed_gpu_inductor_keying.py \
tests/preparation/test_forward_artifact_sharing.py \
tests/preparation/test_inductor_prepared_winners.py \
tests/preparation/test_compile_pool.py \
tests/preparation/test_core_boundary.pyResult: |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeHead
Walkthrough
Merge Risk: Low · up to
|
Why this change is proposed
Multi-GPU SM120 workstations commonly pair RTX PRO 6000 Blackwell Max-Q Workstation Edition GPUs with RTX PRO 6000 Blackwell Workstation Edition GPUs. Both cards share compute capability
(12, 0)and memory capacity, but report distinct CUDA device names and can compile different Inductor Triton kernel inventories for the same logicalcompilation_variant.Although
ForwardCache.__init__(ignition/preparation/aot.py) already hashesproperties.nameinto each rank'sself.root, four coordination paths onmainbypassed that per-SKU separation:ForwardCache._prepare_rankskeyed_variant_compilersandpaths[name, variant]bycompilation_variantalone and lent missing compilations across all ranks on a host regardless of GPU product name, causing different-SKU ranks to compile into or load from another SKU'sself.rootand fail Inductor kernel-inventory agreement.ForwardCache._publication_locklocked only onepublication.lockper host, leaving secondary SKU cache roots on the same host unlocked during compilation and binding._share_artifactsfetched every compiled path reported by any peer host, which on multi-host mixed-SKU runs would write foreign-SKU artifacts into unlocked cache roots.allocate_workers(ignition/preparation/compile_pool.py) allocated per host without GPU SKU grouping, allowing one SKU to consume all host workers and starve a secondary active SKU group, whileInductorSelections.warm(ignition/preparation/inductor_tuning.py) checked Inductor kernel-inventory equality across all ranks sharing onecompilation_variantstring regardless of GPU product name.What exactly changed
cuda_device_identity(device)inignition/preparation/inductor_tuning.pyto return(product_name, compute_capability)for CUDA devices and("", None)for non-CUDA devices.ForwardCache._publication_lock(ignition/preparation/aot.py) to gather(host, str(self.root.resolve()))across ranks and acquirepublication.lockonce per distinct(host, resolved_root)in deterministic sorted order.ForwardCache._prepare_ranks(ignition/preparation/aot.py) to gather(gpu_name, capability)across ranks, reject cross-architecture rank groups (ordering capabilities safely whenNoneis present), keyselections,compilers,work,lent, andpathsby(compilation_variant, gpu_name)while keeping un-suffixed{name}.{compilation_variant}filenames inside each SKU's GPU-partitionedself.root, passgroups=gpu_namestoallocate_workers, and restrict host-local compilation lending to matching(host, gpu_name)peers._share_artifacts(ignition/preparation/aot.py) with an optionalroot=Noneparameter (passed asroot=self.rootat both multi-host call sites in_prepare_ranks) so each rank fetches only peer artifacts located directly insidePath(root).resolve(), preventing foreign-SKU writes into unlocked roots on multi-host mixed-SKU runs while preserving same-SKU cross-host sharing.allocate_workers(ignition/preparation/compile_pool.py) with an optionalgroups=Noneparameter (normalized viagroups = hosts if groups is None else groups) so active(host, group)subgroups are each seeded with one worker before surplus allocation, idle/cached subgroups receive zero workers, host effective worker limits smaller than the active subgroup count raiseValueError, the 2 GiB minimum-allowance fallback applies strictly whenlen(active_groups) == 1, and multi-group hosts enforce the full per-worker memory estimate monotonically for every seeded worker (raisingMemoryErrorwhen insufficient).InductorSelections.warm(ignition/preparation/inductor_tuning.py) to gather((compilation_variant, gpu_name), inventory)and require identical Inductor kernel inventories within each(compilation_variant, gpu_name)group (relying onForwardCache._prepare_ranksfor the upstream cross-architecture gate).docs/model-preparation.mdanddocs/preparation-development.mdto document per-(host, GPU product name)cache roots and locks, per-(compilation_variant, GPU product name)forward sharing and Inductor inventory agreement, same-SKU host-local lending, per-active-SKU worker admission (ValueErroron low worker limits and single-active-group 2 GiB fallback), and cross-architecture rejection.tests/preparation/test_mixed_gpu_inductor_keying.pycoveringcuda_device_identity("cpu"), mixed-SKU keying and same-SKU lending isolation, homogeneous-to-mixed cache reuse with zero recompilation on the shared SKU, monotonic multi-SKU memory admission (12, 39, 40, 41, 42, 71 GiBraisingMemoryError,72 GiBadmitting[1, 0, 1, 0], and single-active-group10 GiBfallback), explicitValueErrorwhen the host worker limit is below the active group count, idle-SKU worker withholding, two-host mixed-SKU_share_artifactsroot isolation, multi-root_publication_lockacquisition on one host, un-suffixed homogeneous sharing, cross-architecture rejection (includingNonecapabilities), and per-(variant, gpu_name)Inductor inventory validation.Before this change, mixed-SKU SM120 ranks shared one
paths[name, variant]entry across different-SKUself.rootdirectories, lent compilations across SKUs, locked only one cache root per host, could starve secondary active SKU groups or fail Inductor inventory agreement, and could transfer foreign-SKU artifacts across hosts into unlocked roots. After this change, each GPU product name locks its own cache root, receives compiler workers monotonically when active, compiles and reuses un-suffixed artifacts inside its ownself.rootacross homogeneous and mixed launches, restricts multi-host transfers to its ownself.root, and validates Inductor inventories per(compilation_variant, gpu_name), while cross-architecture groups fail explicitly before compilation.Claimed benefit or result
Enables tensor-parallel preparation (
ignition export --gpus ...) on mixed-SKU same-architecture SM120 hosts while preserving homogeneous-to-mixed on-disk cache reuse, monotonic host RAM admission, multi-host cache-root isolation, and strict compute-capability invariants.Supporting evidence and limitations
CUDA_VISIBLE_DEVICES="" pytest \ tests/preparation/test_mixed_gpu_inductor_keying.py \ tests/preparation/test_forward_artifact_sharing.py \ tests/preparation/test_inductor_prepared_winners.py \ tests/preparation/test_compile_pool.py \ tests/preparation/test_core_boundary.py103 passed, 2 warnings in 33.58s(20 tests intest_mixed_gpu_inductor_keying.py, 12 intest_forward_artifact_sharing.py, 18 intest_inductor_prepared_winners.py, 49 intest_compile_pool.py, 4 intest_core_boundary.py; the 2 warnings are unrelatedcutlass.utils.LayoutEnumdeprecation notices intest_compile_pool.py). These tests verify mixed-SKU keying and same-SKU lending isolation, homogeneous-to-mixed un-suffixed cache reuse with zero recompilation, monotonicallocate_workersadmission (MemoryErrorat 12/39/40/41/42/71 GiB,[1, 0, 1, 0]at 72 GiB, single-active-group 2 GiB fallback at 10 GiB),ValueErrorwhen the host worker limit is below the active SKU group count, cached-SKU worker withholding, two-host mixed-SKU_share_artifactsisolation, multi-root_publication_locklocking, cross-architecture rejection, and per-(variant, gpu_name)Inductor inventory agreement.flare runserving of DeepSeek-V4.1-Flash on a 4-GPU SM120 host pairing two RTX PRO 6000 Blackwell Max-Q Workstation Edition GPUs (300 W) with two RTX PRO 6000 Blackwell Workstation Edition GPUs (450 W), prepared with--mla-compute-mode bf16,--expert-scale-compression native, and--embedding-table-storage ram: 135 CUDA graphs per rank, 38,944 kernels across 4 ranks, 72.8 GiB / 21,058,816 KV tokens (62 s startup), cold prefill 37,671 to 43,134 tok/s from 8K to 128K tokens, sustained decode 377.4 tok/s at concurrency 1 (1,185.8 tok/s at concurrency 8), 6/6 long-context needle-retrieval exact first-token matches, 21/21 multi-turn chat and tool-calling trials passed, 5/5 chat/responses edge cases passed, 1/1 image OCR check passed, and 0 CUDA or runtime errors.flare runserving of thegb202Hugging Face package revision ofbrandonmusic/glm-5.3-flash-exl3-tr3-2.375bpw-flareon the same 4-GPU mixed-SKU SM120 host: 49,868 kernels across 4 ranks, 121 CUDA graphs per rank, 24/24 multi-turn chat and tool-calling trials passed, 0 CUDA or runtime errors.flare runserving of thegb202-tp2Hugging Face package revision ofbrandonmusic/glm-5.3-flash-exl3-tr3-2.375bpw-flareon two RTX PRO 6000 Blackwell Workstation Edition GPUs at 600 W: 256.9 tok/s at concurrency 1, 1,428.9 tok/s at concurrency 32, 10.38M KV token capacity, 24/24 multi-turn chat and tool-calling trials passed, 2/2 vision trials passed, 0 CUDA or runtime errors.tests/preparation/test_inductor_tuning_cuda.pyand live GPU preparation/re-export checks were not run during this CPU-only update pass because GPUs were held offline for this revision; an isolatedmain-vs-branch GPU preparation benchmark has not been collected on this revision. Mixed-SKU hardware execution was previously observed on SM120 (RTX PRO 6000 Blackwell Max-Q Workstation Edition+RTX PRO 6000 Blackwell Workstation Edition) only; cross-architecture rejection and two-host mixed-SKU_share_artifactsisolation are verified by CPU unit tests rather than a multi-host or mixed-architecture GPU cluster. Rust crate tests were not run because this PR modifies Python preparation, test, and documentation files only.Discord: Brandonmusic