Recommendation: Ready To Merge
Head f69e407 (clean rebase of the Round 2-approved 1acb1f0 onto main, now including #592, #608, and #618) preserves all Round 1 fixes with zero new correctness, concurrency, or homogeneous-path regressions: allocate_workers is strictly monotonic without multi-group RAM overcommit, on-disk artifacts remain un-suffixed inside each SKU's GPU-partitioned ForwardCache.root, multi-host _share_artifacts is root-scoped, _publication_lock acquires per-(host, resolved_root) locks in a deadlock-free global order, and the Python CPU workflow (.github/workflows/python-cpu.yml (not opened)) now covers the 20 new tests in CI. Only optional cleanup suggestions and an unrun GPU/isolated-repro verification caveat remain.
Merge Risk
Level: Low
- Homogeneous and single-active-SKU paths 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__(:161) keeps its single-rank behavior,_publication_lock(ignition/preparation/aot.py:873-896) performs the same barrier count per distinct root, and on-disk filenames remain un-suffixed{name}.{variant}insideself.root(aot.py:1080, 1142, 1187). - Mixed-SKU hosts gain strict isolation invariants with explicit admission floors: Two active SKU groups on one host require
2 × 32 + 8 = 72 GiBavailable host RAM (compile_pool.py:91-114,host_memory.py:15-16) and a host worker limit>= len(active_groups)(compile_pool.py:86-90), avoiding cross-SKU lending, unlocked foreign-root writes, and multi-group RAM overcommit; cached SKUs withhold workers so a single compiling SKU still retains the 2 GiB fallback. - GPU verification gap remains outside CPU CI:
.github/workflows/python-cpu.yml:30-33(not opened) now runs all CPU preparation tests (including the 20 new tests), buttests/preparation/test_inductor_tuning_cuda.py(not opened) and an isolatedmain-vs-branch mixed-SKU GPU export were not run onf69e407.
Walkthrough
ignition/preparation/inductor_tuning.py: Adds publiccuda_device_identity(device)(:21-26) returning(product_name, compute_capability)(or("", None)for non-CUDA) and keysInductorSelections.warmkernel-inventory agreement by(compilation_variant, gpu_name)(:247-253).ignition/preparation/aot.py: UpdatesForwardCache._publication_lock(:862-899) to gather(host, str(self.root.resolve()))across ranks and acquirepublication.lockonce per distinct pair in sorted order; updatesForwardCache._prepare_ranks(:1045-1065, 1113-1128, 1141-1189, 1222-1283) to reject cross-architecture rank groups (safely sortingNonecapabilities), keyselections/compilers/work/lent/pathsby(compilation_variant, gpu_name)while preserving un-suffixed{name}.{variant}filenames inside each SKU'sself.root, passgroups=gpu_namestoallocate_workers, and restrict host-local lending to matching(host, gpu_name)peers; addsroot=Noneexact-parent filtering to_share_artifacts(:772-812), passed asroot=self.rootat both multi-host call sites (:1224-1226, 1312-1313).ignition/preparation/compile_pool.py: Adds optionalgroups=Nonetoallocate_workers(:62-124), raisingValueErroriflimit < len(active_groups), seeding one full-estimate worker per active(host, group)subgroup, limiting the 2 GiB minimum-allowance fallback strictly tolen(active_groups) == 1, raisingMemoryErrorif any active subgroup remains unseeded, and distributing surplus workers across active subgroups.docs/model-preparation.md(:238-252) &docs/preparation-development.md(:351-382): Documents per-SKU worker seeding,ValueErroron low host worker limits, multi-group full-estimate admission, same-SKU host-local lending, per-(host, GPU product name)cache roots and lock ordering, root-scoped multi-host sharing, per-(compilation_variant, GPU product name)Inductor inventory checks, and cross-architecture rejection.tests/preparation/test_mixed_gpu_inductor_keying.py(:1-452): Adds 20 CPU unit tests (isolated via forked Gloo child processes andmonkeypatch) coveringcuda_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]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_lockacquisition, un-suffixed homogeneous sharing, cross-architecture rejection (includingNone), and per-(variant, gpu_name)Inductor inventory validation.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt injection, shell execution, credential exposure, or unsafe deserialization across the 6 changed files (the
#autobot:ignore/ "Have your agent review…" footer in PR comments is Autobot's own review boilerplate, not an attack). - [WARN] Charter & value fit: Cleanly scoped to
ignition/preparationfor SM120 workstation TP preparation with no new CLI flags, env vars, or per-model branches, and preserves homogeneous paths; however, an isolatedmain-vs-branch mixed-SKU hardware reproduction/benchmark is still absent (only combined-stack serving runs and CPU unit tests are provided). - [PASS] Related / duplicate / conflict check: Additive to
main(#592and#618are already rebased intof69e407;#122and#584are closed unmerged;#622does not duplicate this; open PRs#314and#639touchaot.py/compile_pool.pyfor distinct features). - [WARN] Tests & verification evidence:
.github/workflows/python-cpu.yml:30-33(not opened) now runspytest tests/ -qwithCUDA_VISIBLE_DEVICES=""(executing all 20 new tests in CI), and the author reports103 passed, 2 warnings; however,tests/preparation/test_inductor_tuning_cuda.py(not opened) and a live mixed-SKU GPU export were not run on this revision (Rust/TLA+ gates are N/A for Python-only preparation changes).
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Make
rootrequired on_share_artifacts(ignition/preparation/aot.py:772, 784, 797): Both production call sites (aot.py:1224-1226,:1312-1313) already passroot=self.root; only a single unit test (tests/preparation/test_forward_artifact_sharing.py:23) omits it. Removing theroot=Nonedefault (and passingroot="forwards"in that test) deletes a branch that would silently disable root-boundary isolation if a future caller forgot the argument. - Deduplicate the worker-selection loop in
allocate_workers(ignition/preparation/compile_pool.py:93-100vs:116-123): The seed loop and surplus loop repeat the exact same 5-lineable/min(..., key=...)/workers[rank] += 1/remaining -= worker_bytesblock. Extracting a small local helper (e.g.,admit(candidates)) removes ~8 duplicated lines and prevents the two admission paths from drifting apart.
Nits
docs/cli-design.md:480: The--compile-workers Nflag-table row mentions per-host division across local ranks; appending a brief clause noting per-GPU-SKU active-group seeding and that a limit below the active SKU group count raisesValueErrorwould keep the CLI reference aligned withdocs/model-preparation.md:238-243.ignition/preparation/compile_pool.py:113-114: Includinglen(active_groups)(or the per-worker memory estimate) in theMemoryErrormessage would make the 72 GiB two-SKU floor immediately diagnosable for operators on 64 GiB mixed-SKU hosts.
Dropped on verification
- Correctness lens Blocker ("post-freeze
warmand_reconcileare still SKU-blind and will abort withequivalent Inductor kernels disagree after frozen warmup"): Dropped._reconcile(ignition/preparation/inductor_tuning.py:291-323) runs at:264before the frozen warmup (:267-271) and installs one canonical winner per shared kernel identity across ranks via_install(:59-70, 320), so shared-identity kernels execute identically during frozen warmup and do not spuriously abort at:288. Adopting one canonical SM120 winner for identical normalized Triton source across same-architecture ranks (gated by_prepare_ranks:1049-1054) is pre-existing, explicitly documented (docs/preparation-development.md:371-376), and consistent withcollectives.py:397(reconcile_selections); distinct per-SKU kernels naturally have distinct identities and separate owners. - Correctness lens Major ("
MemoryErroracross 12–71 GiB andValueErrorwhenlimit < len(active_groups)regress previously working configurations"): Dropped. Homogeneous hosts and single-active-SKU runs (len(active_groups) == 1) preserve the exact 2 GiB fallback and never hit theValueError; mixed-SKU hosts did not cleanly work onmain(they cross-lent and cross-shared across distinct SKU roots). Restricting the 2 GiB fallback tolen(active_groups) == 1was the explicit fix for Round 1's RAM-overcommit blocker, was already approved in Round 2 (1acb1f0), and aligns withhost_memory.cpu_workers's fail-fastValueError(host_memory.py:33-34). - Correctness lens Major ("
_share_artifacts(root=...)silently skips foreign paths and breaks Windows case folding"): Dropped. Multi-host_share_artifactsalready required identical artifact paths onmain(aot.py:773,test_forward_artifact_sharing.py:19); skipping foreign-root paths is the intended fix so mixed-SKU hosts do not write into unlocked foreign roots, andself._load(aot.py:1261) already surfaces the missing path inFileNotFoundError. Python'sWindowsPath.__eq__is case-insensitive (normcase), soPath(...).resolve().parent == target_rootdoes not have a Windows case-folding bug. - Correctness lens Major ("new test suite bypasses
ForwardCache.__init__and stubs_reconcile"): Dropped. ConstructingForwardCachevia__new__on CPU tests is the established repo pattern (tests/preparation/test_forward_artifact_sharing.py:228-231, 407-410) because__init__callstorch.cuda.get_device_properties, and stubbing_reconcileisolates the unit test for the changed(variant, gpu_name)inventory gather. - Correctness lens Minor ("extra barrier per distinct
(host, resolved_root)in_publication_lock"): Dropped as low-signal; homogeneous hosts execute the exact same barrier count asmain, and on a 2-SKU host one extra Gloo/NCCL barrier during lock acquisition is negligible. - Subtraction lens F1 ("
allocate_workers(..., groups=None)violatesAGENTS.md"): Dropped. A 1-linegroups = hosts if groups is None else groupsdefault (compile_pool.py:70) is a clean, safe default for single-rankCompilePool.__init__and 10 existing homogeneous tests intest_compile_pool.py, not a speculative framework or fallback layer. - Subtraction lens F4 ("add
minimum_bytesfield toCompilerResources"): Dropped. Theworker_bytes - FORWARD_WORKER_BYTES + _WORKER_BYTESexpression was pre-existing onmain, and adding a 6th dataclass field would unnecessarily churn ~15 positional test constructors. - Subtraction lens F5 ("drop
(variant, gpu_name)frompaths/lent/workbecause they are rank-local"): Dropped as factually incorrect.pathsis merged across all ranks ataot.py:1222({key: value for compiled, _ in outcomes for key, value in compiled.items()}); keyingpathsbynamealone would cause different SKUs to overwrite each other's artifact paths. - Subtraction lens F6 ("merge
_prepare_rankintotest_forward_artifact_sharing._lending_rankand delete homogeneous test"): Dropped._prepare_rankalready reuses_Artifact,_Forward,_Pool, and_replace_gpu_preparation; folding 6 additional mixed-SKU axes into_lending_rankwould worsen readability, and keeping a 12-line homogeneous un-suffixed regression test is low-cost and clear. - Subtraction lens F7 (partial —
docs/model-preparation.md:271anddocs/cli-design.md:588): Dropped those two lines; both specifically contrast per-host vs cluster-wide budgeting on multi-host runs, which remains accurate (kept onlydocs/cli-design.md:480as a Nit). - Discovery Dossier note ("no Python CI" in Round 2 bot comment): Verified fixed on
f69e407via.github/workflows/python-cpu.yml:30-33(not opened) (merged in#608), and reflected in Pre-merge Checks above.