Recommendation: Ready To Merge
Head 1acb1f0 cleanly resolves the Round 1 blocker and all Round 1 code/doc review items: allocate_workers is now strictly monotonic without multi-group RAM overcommit, on-disk filenames stay un-suffixed inside each SKU's GPU-partitioned ForwardCache.root (preserving homogeneous↔mixed cache reuse), _share_artifacts isolates multi-host mixed-SKU roots via root=self.root, _publication_lock acquires per-(host, resolved_root) locks in deterministic sorted order, and both preparation docs are updated. No new correctness, concurrency, or homogeneous-path regressions were introduced. Because no Python CI workflow runs tests/preparation/ and tests/preparation/test_inductor_tuning_cuda.py was not run on GPU for this CPU-only follow-up revision, a maintainer should confirm GPU test coverage / hardware evidence before pressing merge if desired.
Merge Risk
Level: Low
- Homogeneous hosts and single-active-SKU runs are unchanged:
allocate_workers(ignition/preparation/compile_pool.py:70, 101-111) preserves the 2 GiB minimum-allowance fallback wheneverlen(active_groups) == 1,CompilePool.__init__(compile_pool.py:161) keeps its existing single-rank call,_publication_lock(ignition/preparation/aot.py:789-816) executes the same barrier count per distinct root, and on-disk filenames remain un-suffixed{name}.{variant}insideself.root(aot.py:968, 1025, 1066). - Mixed-SKU hosts gain strict safety invariants with a clear RAM floor: Two active SKU groups on one host require
2 × 32 + 8 = 72 GiBavailable host RAM to seed one full-estimate worker per active group (compile_pool.py:93-114), avoiding the concurrent RAM overcommit that existed in the prior revision; hosts with only one active SKU compiling (e.g., the other SKU cached) retain the single-group fallback. - Verification gap remains outside CI: No
.github/workflows/job executestests/preparation/, andtests/preparation/test_inductor_tuning_cuda.pyplus an isolatedmain-vs-branch mixed-SKU GPU export were not run on1acb1f0.
Walkthrough
ignition/preparation/inductor_tuning.py: Exposescuda_device_identity(device)(:21-26) returning(product_name, compute_capability)(or("", None)for non-CUDA), and updatesInductorSelections.warm(:247-253) to key Inductor kernel-inventory agreement by(compilation_variant, gpu_name)while removing the redundant cross-architecture check.ignition/preparation/aot.py: Updates_publication_lock(:778-816) to lock every distinct(host, str(self.root.resolve()))in sorted order; updates_prepare_ranks(:933-1067, 1113, 1132, 1155-1159) to reject cross-architecture rank groups (safely orderingNonecapabilities), keyselections/compilers/work/lent/pathsby(compilation_variant, gpu_name)with un-suffixed{name}.{variant}on-disk filenames, passgroups=gpu_namestoallocate_workers, and restrict host-local lending to matching(host, gpu_name)peers; addsroot=Noneexact-parent filtering to_share_artifacts(:698-724), passed asroot=self.rootat both multi-host call sites (:1104-1105, 1170).ignition/preparation/compile_pool.py: Adds optionalgroups=Nonetoallocate_workers(:62-124), raisingValueErrorwhenlimit < len(active_groups), seeding one full-estimate worker per active(host, group)subgroup, restricting the 2 GiB minimum-allowance fallback strictly tolen(active_groups) == 1, raisingMemoryErrorif any active subgroup remains empty, and distributing surplus workers across active subgroups.docs/model-preparation.md(:238-252) &docs/preparation-development.md(:351-382): Documents per-SKU worker seeding, same-SKU lending, per-(host, GPU product name)cache roots and locks, multi-host root-scoped sharing, per-(compilation_variant, GPU product name)Inductor inventory validation, and cross-architecture rejection.tests/preparation/test_mixed_gpu_inductor_keying.py(:1-453): Adds 20 CPU unit tests coveringcuda_device_identity("cpu"), mixed-SKU keying and same-SKU lending isolation, homogeneous→mixed cache reuse with zero recompilation on the cached SKU, monotonic multi-SKU memory admission ([12, 39, 40, 41, 42, 71]GiB →MemoryError,72GiB →[1, 0, 1, 0],10GiB single-active-group fallback), low worker-limitValueError, cached-SKU worker withholding, two-host mixed-SKU_share_artifactsroot isolation, multi-root_publication_locklocking, homogeneous un-suffixed sharing, cross-architecture rejection (includingNone), and per-(variant, gpu_name)Inductor inventory checks.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt injection, shell execution, credential handling, or unsafe deserialization introduced across the 6 changed files (the
#autobot:ignore/ "Have your agent review…" text in PR comments is Autobot's own review footer, not an attack). - [WARN] Charter & value fit: Lives cleanly in shared
ignition/preparationfor an explicit SM120 workstation target with no new CLI flags, env vars, or per-model branches; however, isolatedmain-vs-branch mixed-SKU hardware reproduction/measurement is still absent on this revision. - [PASS] Related / duplicate / conflict check: Additive to
main(distinct from #150's b12x tuning layer); PR #584 is closed, and open PRs #122, #592, and #314 overlapaot.py/compile_pool.pywithout duplicating this fix. - [WARN] Tests & verification evidence: Author reports
103 passed, 2 warningsacross 5 CPU test files (20 in the new file), but no Python CI job exists in.github/workflows/andtests/preparation/test_inductor_tuning_cuda.pywas not run on GPU for1acb1f0.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Deduplicate
(compilation_variant, gpu_name)tuple construction (ignition/preparation/aot.py:944-945,ignition/preparation/inductor_tuning.py:247-248): Both modules independently construct(getattr(..., "compilation_variant", "shared"), gpu_name)(in different quote styles). A small 2-line helperforward_variant(forward, gpu_name)next tocuda_device_identityininductor_tuning.pykeeps both contracts locked together without adding repeated CUDA queries.
Nits
- Cross-SKU Inductor winner persistence (
ignition/preparation/inductor_tuning.py:291-323,ignition/preparation/aot.py:1154-1159):InductorSelections._reconcilestill elects one canonical winner peridentityacross all ranks. Because_reconcileruns before the frozen warmup check (:264vs:267-289) andidentityhashes the generated Triton source includingDeviceProperties(device_binding.py:69-74), this cannot crash or install an incompatible cubin across SM120 GPUs. However, if two same-DevicePropertiesSKUs (e.g., 300 W Max-Q at rank 0 and 450 W Workstation at rank 1) share an exact generated kernelidentity, rank 0's tuned config will be adopted by rank 1 and persisted into Workstation's cached.binon disk ataot.py:1158. If per-SKU Triton winner isolation is desired later, keyownersin_reconcileandagreedinwarmby(gpu_name, identity)(leaving process-localself.winnerskeyed byidentity). - CLI-visible error type in docs (
docs/model-preparation.md:241):allocate_workersraisesValueError, butForwardCache._prepare_ranks(ignition/preparation/aot.py:1038-1039, 1094-1096) catches admission/compilation exceptions into a collectiveRuntimeError(as it already does forMemoryError), whichignition/cli/serve.py:321-325surfaces asPreparationError. Phrasingdocs/model-preparation.md:241as "Forward compilation fails (ValueErrorfrom worker admission)..." would match the observable CLI behavior more precisely. - Surplus worker cap per subgroup (
ignition/preparation/compile_pool.py:115-123): When one active SKU group on a host has fewer missing forwards than ranks (e.g., 1 missing forward across 2 ranks) while another SKU group has many missing forwards, the surplus loop overactive_memberscan assign a 2nd worker slot to the 1-job subgroup (consuming 32 GiB of budget without spawning a worker becauseCompilePoolis lazy). Capping surplus eligibility to subgroups wheresum(workers[r] for r in subgroup) < subgroup_jobsavoids wasting a worker slot in that edge case.
Dropped on verification
- Correctness F1 claim that
_reconcile/ frozen-warmup agreement aborts mixed-SKU launches withRuntimeError("equivalent Inductor kernels disagree after frozen warmup"): False on execution-phase inspection.InductorSelections._reconcileruns atinductor_tuning.py:264before frozen warmup (:267-274) and agreement checking (:275-289), installing one canonical winner on every rank that hasidentity, so Pass 2 always agrees; additionally,identityhashesDeviceProperties(SM count, cc, etc.), so distinct-geometry SM120 GPUs already have distinct identities. Reduced to Nit #1 (subtle cross-SKU config persistence for same-DevicePropertiesSKUs). - Correctness F2 claim that the 72 GiB mixed-SKU floor is a Major regression vs
mainand should be fixed by giving the 2nd active group a 2 GiB fallback: Dropped.maindid not support mixed-SKU hosts, homogeneous and single-active-SKU hosts are completely unaffected, and giving the 2nd group a 2 GiB fallback would re-introduce the exact non-monotonic 40–41 GiB failure / 64 GiB RAM-overcommit blocker that Round 1 rejected. - Correctness F3 proposed fix to let
ValueErrorbypassexcept Exceptionataot.py:1038: Dropped. Bypassing collective error gathering in_prepare_ranksrisks Gloo collective hangs if hosts diverge;_prepare_ranksintentionally gathers all admission failures (includingMemoryError) collectively. Kept only the minor doc-wording note as Nit #2. - Correctness F4 claim that
_share_artifactsexact resolved-parent check breaks symlinked caches, differing$HOME, or nested subdirectories: False.Path(path).resolve()runs locally on the receiving host against the unresolved path string, so symlinked cache mounts matchPath(root).resolve(); differing$HOMEacross hosts was already unsupported onmain(aot.py:1132); and neither call site (aot.py:1104, 1170) ever places nestedguards/orlent/paths intoowned/published. - Correctness F5 claim that
cuda_device_identityshould raise instead of returning("", None)on non-CUDA: False. Existing CPU tests intests/preparation/test_forward_artifact_sharing.py:229invoke_prepare_rankswithcache.device = "cpu"without monkeypatchingcuda_device_identity, and production CUDA launches already validate CUDA inForwardCache.__init__(aot.py:755). - Correctness F6 claim that
docs/cli-design.md:480(--compile-workers N) is stale: False.ignition/cli/preparation.py:85-86already rejects--compile-workers < plan.world_size(which is always>= len(active_groups)on single-host, and multi-host uses 1 GPU per host perignition/cli/serve.py:191), so--compile-workerscannot triggerlimit < len(active_groups). - Subtraction #2 suggestion to delete
_share_artifacts(root=None)by blanking peer entries inownedbefore calling_share_artifacts: False / broken._share_artifactsonly readsowned[me]on rankme(aot.py:712-713) and gathers peers' paths internally viaall_gather_object, so filtering other ranks' indices inownedhas no effect; keepingroot=Noneoptional also avoids modifyingtests/preparation/test_forward_artifact_sharing.py:23. - Subtraction #3 suggestion to add
host_groups()and makegroupsrequired inallocate_workers: Dropped. Makinggroupsrequired would break 10+ existing test call sites intests/preparation/test_compile_pool.py:449-517, andallocate_workersstill requires host-level aggregation (available,headroom,limit). - Subtraction #4 suggestion to replace
_sku_rootwith realForwardCache.__init__and drop 5 of the 6 parametrizedavailable_gibcases: Dropped.ForwardCache.__init__(aot.py:747-768) importsflashinferand recursively hashes every.pyfile inignitionandflashinfer, which is why existing forked CPU tests useForwardCache.__new__; the 6 parametrizedavailable_gibvalues were added directly in response to Round 1's review. - Subtraction #5 suggestion to shorten
_prepare_ranksdocstring: Dropped as low-signal; the PR updatedmain's existing 7-line docstring in place (+2 lines). - Dossier / Lens claims that PR #584 is still open and that
pr_filesmetadata is stale: Stale/false — PR #584 was closed on 2026-11-29, andpr_filesaccurately reflects all 6 changed files at1acb1f0.