#1 [high] Change: what #639 does, verified in the diff (4 files, +58/−18)
PR #639 (open, draft), head 3400e3a, base main (branched at 0a8c20f), author original-el8, 4 files +58/−18.
- ignition/preparation/compile_pool.py:24-25 —
_DISCRETE_WORKER_DEVICE_BYTES1 GiB (1<<30) → 704 MiB (704<<20); comment now says "~672 MiB measured for CUDA context and Inductor constant folding". Integrated constant_WORKER_DEVICE_BYTES = 2 << 30unchanged (compile_pool.py:23). - compile_pool.py:49-51 — new
compile_reserve = headroom_bytes if shared else min(headroom_bytes, 1024 << 20); used for thefree - compile_reserve < device_bytesprobe, forcapacity = max(0, (free - compile_reserve) // device_bytes), but NOT for the returnedCompilerResources.headroom(line 62 stillmax(host_memory._HEADROOM_BYTES, headroom_bytes if shared else 0)). So the host-RAM side of admission inallocate_workers(compile_pool.py:73-84, remaining = available - headroom) is unchanged. - compile_pool.py:137-144 — replaces the unconditional
compile_threads=1withinner_threads = max(1, min(8, (os.cpu_count() or 1) // max(1, self.workers))), plusworker_options["worker_start_method"] = "subprocess"whenos.name != "nt".os.cpu_count()read viahasattrguard. This is applied toself.options, which is passed asoptionsinto every_compile_forward(payload, device, self.options, ...)call (compile_pool.py:161-162) i.e. it becomes the per-worker Inductor option dict insideCompilePoolsubprocesses. - ignition/preparation/aot.py:901-903 —
ForwardCache.prepare_many'storch._inductor.config.patch(compile_threads=1)→compile_threads=min(24, os.cpu_count() or 1); comment changed from "Compiler workers own parallel compilation; artifact binding needs no second worker pool." - Tests only otherwise: tests/preparation/test_compile_pool.py (+~30/−10) and tests/preparation/test_forward_compile_options.py, incl. new
test_prepare_many_scales_inductor_compile_threads_with_cpu_count(monkeypatches aot.os.cpu_count→64, asserts observed 24).
Description matches the diff; nothing in the diff is undeclared at the file level. Undeclared side effects (see separate notes): interaction with _OPTIONS['compile_threads'] (= min(16, cpu_count), compilation.py:30) and with the unchanged CompilerResources.headroom.
#2 [high] Change: thread policy is inconsistent across the three Inductor compile_threads sites
compile_threads appears in four places at PR head:
- ignition/preparation/compilation.py:26-30 — module default
_OPTIONS = {... 'compile_threads': min(16, os.cpu_count() or 1)}(pre-existing; #639 does not touch it). This is the valuecompiler_resourcescaps worker-limit by (compile_pool.py:42-44) and thatForwardCache.__init__strips from the cache key (aot.py:825). - ignition/preparation/compile_pool.py:141 — NEW
max(1, min(8, cpu_count // workers))(changed by #639; was forced to 1). - ignition/preparation/aot.py:903 — NEW
min(24, os.cpu_count() or 1)(changed by #639; was 1). - ignition/preparation/aot.py:688 —
DeferredCompiledForward.materialize_for_capturestill patchestorch._inductor.config.patch(compile_threads=1)(NOT changed by #639). So the "materialize a deferred compiled forward for capture" path keeps serial compilation whileprepare_manyno longer does.
Notable: the compile_pool per-worker value is now derived from the pool worker count rather than from the configured _OPTIONS['compile_threads'] (16-cap) — the config value survives only as the worker-count cap (compile_pool.py:44). The aot.py value ignores the same config entirely and uses a separate 24 cap. Neither cap is documented or configurable in BasePreparationConfig; grep of headroom_bytes/compile_threads in ignition/ shows no parameter plumbing for them (only bootstrap.py:35 headroom_bytes: int = 4 << 30). This is the same class of concern #509's Autobot review raised about unrecorded switches ("compile_options is still an unrecorded switch … Not in BasePreparationConfig, not in the plan/reproduction_arguments", #509 review) — #639 introduces two new hardcoded tuning constants (8, 24) and a new 1 GiB cap.
#3 [high] Related work: #122 (closed 2026-11-29) is the headroom-as-setting PR, and it withdrew the multi-thread-per-compiler mechanism #639 revives
#122 "Make the compiler memory headroom a preparation setting" by javieratomic, opened 2026-10-28, CLOSED (not merged) 2026-11-29 21:44, +392/−65 across 50 files. Related to issues #73, #242, #270 (GB10/DGX Spark unified-memory doors, kernel-tuning MemoryError / no compiler capacity).
Directly relevant to #639:
- It all but existed to make
CompilePool/compiler_resources'sheadroom_bytesa user setting ([preparation] compile_headroom,--compile-headroom SIZE, default 8G) because "the right floor depends on the host and the model, so it should be a setting rather than a constant" (#122 description, "Why"). #639 instead keepsheadroom_bytesa parameter and silently caps its effect at 1 GiB on discrete GPUs (compile_pool.py:51) with no setting, no flag, no documentation. - #122 comment 2026-11-10: "Since c8d4c324 admits forward compiler workers per host with a 16 GiB estimate and one Inductor thread each, the setting now applies to that admission… The earlier measurements in this PR (about 510 s against 905.7 s for 'Compile model forwards', and the serving checks of that export) came from extra Inductor threads per compiler, a mechanism main no longer has, so they are withdrawn". => Main deliberately removed per-compiler multi-threading in c8d4c324 (Luke Alonso, 2026-11-09 "Budget forward compiler workers across each host"); #639 re-introduces multi-threaded compiler workers in a different form (threads per worker = cpu_count/workers, cap 8) without citing that withdrawal.
- #122's Autobot review noted the headroom asymmetry #639 is now touching: "
compile_pool.py:63usesheadroom_bytes if shared else 0" and asked that--compile-headroomhelp say "on unified-memory GPUs". - #122's Autobot review: recipe half belongs in hyperflare-recipes; the impact of headroom changes is on unified memory (integrated) hosts, matching #639's premise that discrete GPUs shouldn't subtract full headroom.
#4 [high] Change: hasattr(os, "cpu_count") guard exists to keep an unmodified Windows mock test passing; Windows partitioning untested
tests/preparation/test_compile_pool.py:467-476 test_windows_compiler_workers_fit_host_ram_with_larger_device_budget was not updated by #639 and still asserts (pool.workers, pool.options["compile_threads"]) == (1, 1). It monkeypatches compile_pool.os = SimpleNamespace(name="nt"), which removes cpu_count from the module's os. That is the only reason CompilePool.__init__ at compile_pool.py:139 reads os.cpu_count() if hasattr(os, "cpu_count") else None instead of plain os.cpu_count(): the hasattr guard makes the mocked os fall back to None → inner_threads = max(1, min(8, 1 // 1)) = 1, keeping the stale assertion green.
Consequence: (a) the hasattr guard is a test-shape artifact, not a portability need — os.cpu_count exists on every CPython 3.x platform including Windows and is always truthy-or-None, never absent; (b) that test no longer exercises the new partitioning path at all (it silently takes the cpu_count is None branch), so Windows thread partitioning is untested even though the PR description says "spawn" is "preserved on Windows".
Likewise tests still pinning compile_threads=1 semantics where the new path is bypassed: test_compile_pool.py:397-431 (test_compiler_reuses_its_budgeted_worker_pool) sets cpu_count → 8, so with workers=2 → 4 and workers=1 → 8, asserting the cap at 8; test_compile_pool.py:376-388 parametrizes cpu_count → 64.
#5 [high] Change: admission math before/after — only the device side relaxes; host-RAM headroom floor is untouched
Device sizing (discrete). #639 lowers the per-worker device estimate 1 GiB → 704 MiB with the justification "~672 MiB measured" (compile_pool.py:24-25). Evidence base in the repo for the old value: #242 (open) says "2 GiB for the worker's CUDA context (_WORKER_DEVICE_BYTES, compile_pool.py)" at d2b5c5f3, and the pre-#639 comment read "about 0.7 GiB for Kimi K3's 93-layer forwards". docs/model-preparation.md:238-245 documents only the 32 GiB host estimate and the 2 GiB minimum allowance, and docs/cli-design.md:1463 says "Compiler workers | Automatic memory-bounded sizing" — no documented per-worker device figure. So the number is a shared-code policy constant with no user-facing doc and no config: #122 (closed) is the PR that wanted exactly this class of value to be a setting.
Headroom cap (discrete). compile_pool.py:51 caps the device-side reserve at 1 GiB on discrete GPUs. Two things it does not cap:
CompilerResources.headroom(compile_pool.py:62) still returnsmax(host_memory._HEADROOM_BYTES, headroom_bytes if shared else 0)— i.e. 8 GiB floor on discrete — andallocate_workerssubtracts that from host RAM (compile_pool.py:73-84). So the change does nothing for the host-RAM admission failure mode reported in #242 (11575 MiB available, 8192 MiB headroom) and #122, which are both about host memory on one-rank-per-host exports.- The
headroom_bytespassed by callers isplan.headroom_bytes + plan.reserve_byteson integrated/preparation paths (ignition/preparation/bootstrap.py:134) andsession.headroom_byteselsewhere, so a large runtime reserve no longer constrains device compile capacity on discrete GPUs — the PR's stated goal — but the value is also no longer a safety bound there.
Net effect on worker count: on a discrete GPU, capacity = (free − min(headroom,1 GiB)) // 704 MiB instead of (free − headroom) // 1 GiB. On main the equivalent test asserted 10 workers for 12 GiB free with 2 GiB headroom (tests/preparation/test_compile_pool.py:40-41 on main); #639 asserts 16 (line 43-45 at head). So the same hardware admits 60% more concurrent compiler processes, each with 8× more Inductor threads at low worker counts (see threads entry).
#6 [high] Why: no linked issue; the closest existing reports are #242, #122 and #584 and none is claimed as fixed
No linked issue or prior report is cited in #639. Closest in-repo reports, none of which #639 links or claims to fix:
- #242 (open, P2, triage:partial, javieratomic) — "Multi-host export compiles for 22 minutes, then fails, when one rank has no memory for a forward compiler." Host-RAM side of forward-compiler admission; #639 does not change the host-RAM formula (see entry on admission math).
- #122 (closed 2026-11-29) — wanted
headroom_bytesto be a preparation setting; #639 instead caps its device-side effect. - #584 (closed draft, FujitsuPolycom) — a +4.3k LOC rewrite of
CompilePoolsizing whose reviewer (voipmonitor) blocker #2 was precisely that a proposed adaptive pool "drop[s] explicitcompile_threadsand the default 8-per-GPU cap"; #639 moves in the same direction (more threads per worker, more workers) at 58 lines. - The daemonic-multiprocessing failure the PR mentions is not filed as an issue;
search_itemsfor "daemonic processes are not allowed to have children" returns nothing. Its only in-repo trace is the code comment at compile_pool.py:137-138. - The "high-core-count CPU hosts leave cores idle" motivation also has no issue;
search_itemsfor it returns nothing relevant. So the "why" rests on the author's own GB300 measurements rather than on tracked bug reports.
#7 [high] Recent activity: #639 reverses a boot of the thread policy c8d4c324 deliberately set, on files #509 just rewrote
- c8d4c324 (Luke Alonso, 2026-11-09, "Budget forward compiler workers across each host") is the commit that introduced
compiler_resources/allocate_workersand theFORWARD_WORKER_BYTES = 32 GiBper-worker host estimate (host_memory.py:14-15). #122's author records that after c8d4c324 main admits forward compiler workers with "one Inductor thread each", and that #122's earlier ~510 s vs 905.7 s per-compiler-thread measurement "came from extra Inductor threads per compiler, a mechanism main no longer has, so they are withdrawn" (#122 comment 2026-11-10). #639 reinstates multi-threaded compiler workers without citing that history. - b0d35934 / #509 (Luke Alonso, merged 2026-11-24) last rewrote this exact area (4 of the same files) and #509's own Autobot review objected to its breadth and to unrecorded compile-option switches. #639 touches the same four files again.
- ea756eef / #425 (Jason Cook, merged 2026-11-25, "Order compiled forward warmup by largest allocation request") and 3e2fcd27 / #559 (Martin Vit, 2026-11-28) changed
aot.py_prepare_many's memory behaviour (warmup ordering, deferred GC) around the same functionprepare_manywraps — #639 changes the thread budget of that same wrapper. - c8d4c324 lineage in
host_memory.py: f9aec99c (Luke Alonso 2026-11-17) "Keep one tuning compiler worker below estimated RAM allowance"; 468415d1 (Jason Cook 2026-10-13) "Bound integrated forward compilers' Inductor threads by the RAM their workers leave" — i.e. an earlier contributor already made integrated-GPU Inductor thread count memory-dependent; #639 replaces the discrete side with a CPU-count-only formula that ignores RAM entirely. - Default branch has had no commits to the touched files since #639 branched (orientation packet: 0 commits since 0a8c20f), so #639 does not conflict with anything merged since; the open conflict is with #597 (above).
#8 [high] Related work: #597 (open, "Ready To Merge") edits the same compile_pool.py; #639 would land on top of or race it
- #597 (open, brandonmmusic-max, head f69e407, reviewed "Ready To Merge" by flare-autobot 2026-11-30 12:22) modifies
ignition/preparation/compile_pool.pyallocate_workers(addsgroups=) andaot.py. #639 also modifiesCompilePool.__init__andcompiler_resourcesin the same module. #597's review explicitly checked "CompilePool.__init__(compile_pool.py:161) keeps its existing single-rank call" — i.e. #597's reviewer reasoned about the pre-#639CompilePool.__init__. The two are textually non-overlapping but semantically adjacent (both change how many compiler workers a host gets), and #597 was at the head of the merge queue when #639 opened (597 last updated 12:22, 639 opened 11:55 / updated 12:15). Whichever lands second needs a rebase; #597 is much further along. - #584 (closed draft) proposed adaptive
CompilePoolsizing with a review blocker about bypassingcompile_threadsand the 8-per-GPU cap; #639'sinner_threadscap of 8 per worker partially echoes that reviewer's concern in the opposite direction (8 threads per worker, not 8 workers per GPU). - #512 (closed) and #474 (closed, by the same author original-el8, replaced by #509) touched the same files; #474 is this author's previous attempt at the same area, so #639 is their fifth+ change to
compile_pool.pyafter the merged #509 lineage. - #543 (merged, Luke Alonso 2026-11-26) removed grouped AOT forward compilation (-870 lines) including
ForwardCache.bind_group— reduces the surfaceprepare_manycovers but does not touchcompile_threads.
#10 [high] Claims and evidence: CI is failing on the head commit but the description reports only green runs; the export timing has no baseline
Claims in #639's "Verification" section and what backs each:
- "146 passed, 0 failed" for test_forward_compile_options / test_compile_pool / test_forward_artifact_sharing / test_host_memory, CPU-only. Plausible and consistent with CI scope:
.github/workflows/python-cpu.yml:30-33runs.venv/bin/python -m pytest tests/ -qwithCUDA_VISIBLE_DEVICES: ""on every pull_request, so the CPU suite does run in CI. No test file, log or CI run URL is cited in the description; no per-file counts are given. - "56 passed, 14 skipped, 0 failed" for the five other preparation files — uncited, plausible.
- CI on the head commit is failing (orientation packet: "CI on the head commit: failed"). The description reports all-green unit runs; nothing in the description explains the failing CI job. This is the single largest gap between claim and evidence.
- "DeepSeek-V4.1 preparation compiled 101/101 model forwards in 359.8 s, and Inkling-2-Small preparation compiled 148-graph forwards" on "combined-stack GB300 (SM103)". No baseline: no
main-vs-branch comparison, no per-configuration worker/thread counts, no memory samples, no mention of whichcompile_workers/headroom_bytesthe exports used, and the phrase "combined-stack export validation alongside the isolated CPU unit suite" implies the exports also carried other unmerged changes. Charter: "Performance PRs need benchmarks showing an actual speedup overmainon a served workload (#210)" — 359.8 s for 101 forwards is a wall-clock number with no comparison point, and the change's stated benefit is precisely speed (idle cores) and worker count. - The "~672 MiB measured" figure behind 704 MiB is not traced to any measurement artifact, recipe or log; the PR's own hardware runs are on GB300/SM103 (a 288 GB HBM part), the hardware where freeing device memory matters least.
- The daemonic-multiprocessing claim ("TorchInductor requires
worker_start_method="subprocess"on POSIX to spawn nested compile workers") is consistent with compile_pool.py:153-160, where POSIX usesSubprocPool(..., kind=SPAWN)— a non-daemonicspawn-kind pool — and with compilation.py:31-32 which only setsworker_start_method='spawn'on Windows. Not independently verified here:torch._inductor.config.compile_threads = 1(the old value) is also the default that disables the nested pool entirely in Inductor, so theworker_start_methodrequirement only becomes live once threads > 1 — the two halves of the change are coupled, which the description does state. - "Limitations: GPU-gated preparation unit tests (
FLARE_RUN_CUDA_TESTS=1) were skipped" — accurate and consistent with the CPU-only claim.
#11 [high] Reach: default thread and worker counts rise for every export, and the thread count ignores CPU affinity, unlike the worker count
Who/what it affects.
- Every
ignition export/debug-serve/benchrun that compiles forwards: discrete GPUs are the default case on SM120/SM121 workstations and GB300 (charter Vision: "SM120/SM121 workstations and DGX Spark"; Goals: "SM103, SM120, and SM121"). Integrated GPUs (DGX Spark GB10) take thesharedbranch and are unchanged by the reserve cap, but they do get the newcompile_threads= cpu_count//workers andworker_start_method="subprocess"fromCompilePool.__init__, which is device-agnostic. - Defaults change silently.
compile_threadsper worker goes 1 → up to 8, and the number of concurrent compiler processes on discrete GPUs goes up ~1.6× (see admission-math entry). Combined worst case on a 128-core host with 32 admitted workers = 32 processes × 4 threads = 128 Inductor subprocesses.allocate_workerscaps workers byhost_memory(32 GiB per worker) andcompile_workers, butinner_threadsis derived fromos.cpu_count()— not fromos.sched_getaffinity, which is whathost_memory.cpu_workers(host_memory.py:31) and therefore the worker count uses. On a cgroup- or taskset-limited rank (the exact casecpu_workersexists to handle, and the casetests/preparation/test_explicit_forward_workers_are_bounded_by_cpu_affinitycovers) the thread count is computed from the whole machine while the worker count is computed from the affinity mask, so total threads can exceed the allowed CPU budget. prepare_manythread patch is process-global and unbounded by RAM:torch._inductor.config.patch(compile_threads=min(24, os.cpu_count() or 1))covers the whole_prepare_manybody in the parent rank process (aot.py:901-906), which also runs warmup (_warm, aot.py:1359-1382) and the fallbackaot_forward(...)recompile onBindingMismatch(aot.py:977-980). On an integrated GPU, parent-process Inductor compilation now gets up to 24 threads where it had 1 — the RAM-bounding rationale of 468415d1 ("Bound integrated forward compilers' Inductor threads by the RAM their workers leave") is not applied here.- Configuration/compat: no CLI flag, config key, plan field or
reproduction_argumentsentry changes; the values are module constants. Forward cache identity:ForwardCache.__init__stripscompile_threadsfrom the hashed options (aot.py:825), so no existing on-disk compiled-forward cache is invalidated by this change — good for compat, but it also means the new thread count is not recorded in the core, inPlan.to_dict(), or in reproduction args, so an export's thread policy cannot be reproduced from its metadata. - Windows:
worker_start_methodis only overridden whenos.name != "nt"; on Windows_OPTIONS['worker_start_method'] = 'spawn'(compilation.py:31-32) applies, unchanged. No docs change accompanies this. - Dependencies: no version bumps; relies on torch 2.14.1+cu132 (pyproject.toml:22) private API
torch._inductor.compile_worker.subproc_poolalready used bysubmit_payload.
#13 [high] Process: draft, opened hours ago, CI failing on head, zero reviews/comments/labels; plus the exact file:line map
- #639 is a draft (opened and updated the same day, 2026-11-30 11:55 → 12:15), base
mainbranched at0a8c20f, head3400e3a(40-digit3400e3a14ec49d066d223820e054f004c8e2b2d1), +58/−18 across 4 files. Labels: none. Reviews: none. Comments: none.related_items(639): "Referred to by: #597 (mentions)" — #597's discussion names #639, but #639 names nothing. - CI on the head commit: failed (orientation packet). No Autobot review has run yet (no
flare-autobotcomment). By repo convention (e.g. #597, #509, #122), Autobot posts a case file and review within minutes of opening or pushing; the absence here may mean the draft is not yet queued for review. - Age: hours old at orientation-packet time; no stale/abandonment signal.
- The description is unusually complete for a draft: Why / What changed with explicit Before-After per file / Result / Verification / Limitations, matching the charter's required four parts ("PR descriptions: Expect four parts: why the change is needed, what changed, the claimed result, and the evidence backing it").
- File map (all at head 3400e3a):
ignition/preparation/compile_pool.py+15/−6 — lines 22-25 (constants), 49-55 (reserve cap), 137-144 (__init__thread/start-method policy).ignition/preparation/aot.py+2/−2 — line 901-903 only (prepare_manypatch value + comment). NoteDeferredCompiledForward.materialize_for_captureat aot.py:688 keepscompile_threads=1.tests/preparation/test_compile_pool.py+25/−9 — lines 25-30, 43-45, 374-388, 391-398, 434-452, 545-551.tests/preparation/test_forward_compile_options.py+16/−1 — line 9 (import os), 282-284, and new test at 333-341.- Untouched but load-bearing for this change:
ignition/preparation/compilation.py:26-32(_OPTIONS,compile_threads=min(16, cpu_count), Windowsworker_start_method='spawn'),ignition/preparation/host_memory.py:13-16,25-35(32 GiB worker estimate, 8 GiB headroom, affinity-basedcpu_workers),ignition/preparation/bootstrap.py:35,134(defaultheadroom_bytes = 4 GiB;plan.headroom_bytes + plan.reserve_bytespassed down),ignition/preparation/compile_pool.py:65-96(allocate_workers, host-RAM side, unchanged).
#16 [high] Change vs description: the default 4 GiB→1 GiB reserve relaxation is not declared, nor the untouched compile_threads=1 sibling
Verified against the diff — the description is accurate about every file it names, and nothing in the four changed files is undeclared at file level. What the description does not say:
- The default
headroom_bytespath changes too, not just "large runtime reserves".ignition/preparation/bootstrap.py:35defaultsheadroom_bytes: int = 4 << 30, and bootstrap.py:134 passesplan.headroom_bytes + plan.reserve_bytesdown. Under #639 a discrete GPU usesmin(4 GiB, 1 GiB) = 1 GiB. So every discrete export's compile-time device reserve drops 4 GiB → 1 GiB even with no operator-supplied reserve, which is a 3 GiB relaxation the "Why" frames as only affecting large reserves. CompilerResources.headroomis deliberately left un-capped (compile_pool.py:62), so host-RAM admission still subtracts the full headroom/floored 8 GiB. Not stated; it means #242-style host-RAM failures are untouched.DeferredCompiledForward.materialize_for_capturekeepscompile_threads=1(aot.py:688). The description says theprepare_manypatch changed but not that a sibling patch in the same file did not, leaving the file with two conflicting policies.- The exact worker-count change is never quantified. On main, 12 GiB free + 2 GiB headroom admitted 10 workers (tests/preparation/test_compile_pool.py:40-41 on
main); at head it admits 16 (lines 43-45). 3 GiB free goes 3 → 4 workers (line 377). The description says "under-allocates" and "admits against 704 MiB" but gives no before/after count. - The
hasattr(os, "cpu_count")guard (compile_pool.py:139) is unexplained; it exists so the unmodified Windows test (tests/preparation/test_compile_pool.py:467-476, which mocksoswithoutcpu_count) still passes — see the separate note. - No mention of the affinity/
cpu_countmismatch, no mention of the aot.py 24-thread cap's interaction with the 16-thread_OPTIONS['compile_threads'], no doc or TODO update, and no note that no on-disk cache key changes. - It also does not say the change is combining three unrelated concerns (device sizing, headroom capping, thread/start-method policy) — the shape #509 and #584 were both criticised for (Autobot: "Still one PR for five unrelated defects"; voipmonitor on #584: "bundling ~9 optimization tracks").
#17 [high] Research summary
Case file for #639 (open draft, head 3400e3a, +58/−18 in 4 files, author original-el8 == Jason Cook, a charter-named priority contributor). Sixteen scratchpad entries cover every angle; everything below is recorded there with citations.
What it does (verified against the diff): three coupled changes in shared preparation code — (1) _DISCRETE_WORKER_DEVICE_BYTES 1 GiB → 704 MiB (compile_pool.py:24-25); (2) a new discrete-only cap compile_reserve = min(headroom_bytes, 1024 << 20) in compiler_resources (compile_pool.py:49-55) that leaves CompilerResources.headroom — the host-RAM side of admission — un-capped (line 62); (3) CompilePool.__init__ replaces forced compile_threads=1 with max(1, min(8, cpu_count // workers)) and sets worker_start_method="subprocess" off Windows (compile_pool.py:137-144), plus ForwardCache.prepare_many's Inductor patch 1 → min(24, os.cpu_count()) (aot.py:901-903). Two test files updated, one new test.
What a reader cannot learn from the description: the default path also relaxes — bootstrap.py:35 (not opened) defaults headroom_bytes to 4 GiB, so every discrete export's compile reserve drops 4 GiB → 1 GiB, not just "large runtime reserves"; worker counts rise ~1.6× (the changed test goes 10 → 16 workers for 12 GiB free with 2 GiB headroom); DeferredCompiledForward.materialize_for_capture still pins compile_threads=1 (aot.py:688), so the same file now carries two conflicting thread policies; the hasattr(os, "cpu_count") guard exists only to keep an unmodified Windows mock test green (test_compile_pool.py:467-476), meaning Windows partitioning is untested; and the new thread count uses os.cpu_count() while the worker count uses sched_getaffinity via cpu_workers (host_memory.py:31), so a cgroup-limited rank can overshoot its CPU budget.
History and overlap: #639 reverses the thread policy main deliberately set in c8d4c324 (Luke Alonso, 2026-11-09), whose "one Inductor thread each" design #122's author records as having withdrawn per-compiler threading measurements on purpose. #122 (closed 2026-11-29) is the PR that wanted exactly this headroom constant to be a setting rather than a constant; #639 hardcodes a new cap instead. #597 (open, reviewed "Ready To Merge" 2026-11-30 12:22) edits the same compile_pool.py/aot.py and its review reasoned about the pre-#639 CompilePool.__init__; #584 (closed draft) was rejected partly for bypassing compile_threads and the worker cap. #509 rewrote these same four files seven days earlier. No issue is cited or fixed; #242 (open, P2) is about host RAM admission, which this change does not touch.
Evidence vs claims: CI is failing on the head commit while the description reports only green CPU runs; the headline hardware result (101/101 forwards in 359.8 s on GB300) has no main baseline and ran on a "combined stack", which the charter's #210 benchmark rule requires for a performance PR; the 672 MiB figure behind 704 MiB has no artifact; CI can only exercise the CPU path (python-cpu.yml runs everything with CUDA_VISIBLE_DEVICES=""), so every GPU-side number is either mocked or author-run. Engagement is zero: no comments, reviews, labels or Autobot review, and no prompt-injection attempts in any thread read.
#18 [high] Leads: what was followed, what was judged not relevant, and which searches found nothing
Triage of every lead in the orientation packet, so the report can say honestly what was followed:
In the changed files (all four): #509 (merged) — read, entry 7/8; #474 (closed, same author, replaced by #509) — same four files, the author's earlier attempt at this area (entry 8); #618, #592, #559, #425, #367, #543, #605 (merged/closed, aot.py only) — read via related_items metadata only; none of them changes compile_threads, _DISCRETE_WORKER_DEVICE_BYTES or prepare_many's patch, and none is undone by #639. items_touching(ignition/preparation/compile_pool.py) returns only four items in the last 180 days: #597 (open), #639, #509, #462.
Close topic matches: #122 — read in full, entry 3 (the headroom-as-setting PR; also records main's deliberate removal of per-compiler Inductor threads). #584 — read in full, entries 3 and 8 (closed draft whose review blocker #2 was compiling under the worker cap; the "bundled tracks" criticism). #597 — read in full, entry 8 (open, "Ready To Merge", same files). #242 — read in full, entry 6 (host-RAM admission failure; not addressed by #639). #425 (merged, same author, warmup ordering in the same _prepare_many region) — entry 7.
Named in the packet but judged not relevant, with reason:
- #112 (open issue, "b12x CompilePool: compiling in a worker that already described the job publishes nothing (lru_cache…)") — about a publication/lru_cache defect in b12x compilation, not admission sizing or thread counts; not opened in full.
- #310 (open issue, "Two-node DeepSeek V4 Flash export fails in Inductor warmup: dynamic_func() missing HADAMARD and POWE…") — an Inductor lowering defect reached through
prepare_many; adjacent only in that it happens during warmup, which #639 re-threads. Not opened in full. - #268 (closed issue, qwen3.8-27b export failing to warm compiled forwards on SM120) — a per-model failure, not a sizing/threads report; not opened.
- #482 (merged,
device_bytesin the title) and #462 (merged, tight-VRAM composition cleanup) — matched on thedevice_bytesidentifier/compile_pool.pyonly; neither changes the compiler-worker device estimate; confirmed by_DISCRETE_WORKER_DEVICE_BYTES/_WORKER_DEVICE_BYTESgrepping tocompile_pool.py:23,25,48only. - #512 (closed), #314 (open, diffusion/tensor execution) — file overlap only.
- Author's own #640, #632, #633, #604, #532 etc. — different subsystems (helios scheduler/roce); relevant only to show what else they are working on (entry 9).
Searches that found nothing (recorded so the absence is a finding, not an omission): "daemonic processes are not allowed to have children" → no items; "Inductor compile threads wrong nested daemonic SubprocPool" → none; "compile workers slow host CPU cores idle preparation" → none; "compile threads per worker host CPU affinity worker pool budget" (pr) → none. So no filed bug or request asks for extra Inductor threads per compiler worker, and the daemonic-multiprocessing failure #639 cites has no issue behind it.
#9 [medium] People: original-el8 is a charter priority contributor and prior owner-adjacent; no reviews or comments on #639 at all
- original-el8 (GitHub association COLLABORATOR; charter lists them as a priority contributor alongside @voipmonitor and @lukealonso: "Priority contributors (
@voipmonitor,@original-el8,@lukealonso) carry extra weight—we never close their PRs out of hand as 'low value'" — charter "Respect contributors"). Last 180 days: 24 merged, 28 closed, 8 open. Merged areas: docs (14), helios/src (13), helios (5), ignition/preparation (5), ignition/recipes (4). Discord handle on this PR:el8. Commit author name on head 3400e3a is "Jason Cook" (search_history), so original-el8 == Jason Cook. - Their open PRs opened the same day: #640 (helios persistent workers on rank 0), #632 (helios scheduler GPU prefix calibration) — #639 is one of three they opened 2026-11-30, all tuning/scale knobs in different subsystems.
- Their earlier PRs in this exact area: #474 (closed, replaced by #509), #425 (merged "Order Compiled Forward Warmup by Largest CUDA Allocation Request"; they also wrote the review-style ops PRs #408/#410/#427/#432/#465 which all touch these four files). They have also reviewed/curated colleagues' compiler-admission work: their comment on #242 (2026-11-13) triaged it as
triage:partialand stated "#122 changes the headroom input; it does not by itself implement lending or guarantee sufficient memory." - Usual owners of these files (180-day commit counts): ignition/preparation — Luke Alonso (158), Martin Vit (52), Eugene Rakhmatulin (36); tests/preparation — Luke Alonso (206), Martin Vit (34), jasonc (23). The passed-
headroom_bytesplumbing,allocate_workers,host_memoryconstants andprepare_many's structure are predominantly Luke Alonso's (b6d57dad, c8d4c324, f9aec99c, b0d35934). - Engagement so far: none.
pr_commentsreturns "No comments"; no reviews; no labels; no Autobot review yet on #639 (unlike #597 and #509, which each have Autobot reviews). Author has not responded to anything because nothing has been raised.
#12 [medium] Project fit: matches the hardware target and shared-code placement, but conflicts with "no magic defaults" and the #210 benchmark bar
Where the charter lines up
- Lives in shared preparation code (
ignition/preparation/), no per-model branches, no new model alias: matches "Keep the runtime small and model-agnostic" and "Derive preparation memory policy from hardware" (docs/preparation-development.md:314-322: "Shared preparation code detects integrated GPUs and budgets compiler workers and tuning races against available system RAM. Recipes pass byte headroom, not hardware flags."). - Targets exactly the charter's hardware (SM103/SM120/SM121). The verification runs are on GB300/SM103.
Where it does not
- "Be explicit and pin everything. No magic defaults" (charter). #639 introduces three unnamed magic constants (704 MiB, 1 GiB cap, 8-thread cap, plus a separate 24-thread cap in aot.py) and, for the first time, makes discrete-GPU admission ignore the configured
headroom_bytesabove 1 GiB — a configured value that is silently overridden. No doc or config surface mentions any of them. - "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)". The PR is a performance change with one wall-clock number (359.8 s) and nomaincomparison, on a combined stack. - docs/preparation-development.md:318 — "artifact binding starts no additional compiler pool."
prepare_many's newmin(24, os.cpu_count())gives the parent process 24 Inductor threads while the pool is being drained and while binding/warmup runs; this does not start a pool but does start an in-process one. Worth noting as a doc-vs-code tension rather than a violation. - docs/model-preparation.md:238-245 documents forward-compiler admission in terms of the 32 GiB host estimate and the 2 GiB minimum allowance only; the discrete device formula (
free − min(headroom,1 GiB)) // 704 MiB) is undocumented in both before and after states, so documentation drift is pre-existing and unchanged — but #639 changes the numbers without changing the docs. - The charter's non-goal about "broad hardware support" is not implicated: no new GPU targets.
#14 [medium] Claims and evidence: the repo's CI can only run the CPU path, so 704 MiB and the thread gains rest entirely on author-run GB300 exports
- No CI job exercises GPU preparation:
.github/workflows/has onlyhelios-lifecycle.yml,native-serving.yml,python-cpu.yml,release.yml; onlypython-cpu.ymltouches preparation, running the wholetests/tree withCUDA_VISIBLE_DEVICES=""(lines 30-33). Both #597's and #509's Autobot reviews independently note "No Python CI workflow runstests/preparation" / GPU-gated tests unrun — so the "GPU-gated tests skipped" limitation in #639 is a repo-wide condition, not specific to this PR. - #639's own change therefore relies on CPU-mocked tests for the GPU-side numbers (
torch.cuda.mem_get_infoandget_device_propertiesare monkeypatched in every relevant test: tests/preparation/test_compile_pool.py:383-384, 399-400, 439-441, 460-461). No test in the repo validates that 704 MiB is right for a discrete worker; the only hardware evidence is the author's GB300 export runs, with nomaincomparison. - New test
test_prepare_many_scales_inductor_compile_threads_with_cpu_count(tests/preparation/test_forward_compile_options.py:333-341) only asserts that_prepare_manyis called withtorch._inductor.config.compile_threads == 24whenaot.os.cpu_count → 64; it does not exercise the patched scope's effect, themin(24, ·)floor for small hosts, or the interaction with the worker pool. - The other new assertions are
min(8, cpu_count // workers)computed inline from the realos.cpu_count()in tests/preparation/test_forward_compile_options.py:282 and tests/preparation/test_compile_pool.py:28 — they mirror the implementation formula rather than pinning an expected value, so they would pass for any formula that is written the same way in both places. DeferredCompiledForward.materialize_for_capture(aot.py:688) still usescompile_threads=1whileprepare_manynow uses up to 24; no test covers the inconsistency, and the description does not mention the remaining 1.
#15 [medium] Community: no comments, reviews, labels or Autobot review; the only reference is #597's overlap list
- No comments, no reviews, no reactions on #639 (
pr_comments→ "No comments"). No labels. No Autobot case file or review (contrast: #597 got its first Autobot review 4 minutes after opening; #509 got one 75 minutes after). No human has engaged: not Luke Alonso (the module's principal author), not Martin Vit, not voipmonitor, not FujitsuPolycom (whose #584 covered the same ground and was closed for being unmeasured). - The only cross-reference is #597's discussion, which lists #639 among overlapping PRs; #597's reviewer treated #639 as an open overlap for
aot.py/compile_pool.py. So interest so far is one adjacency mention, not engagement. - Discord handle
el8is given, consistent with the repo's practice of routing discussion to Discord. - No prompt-injection attempts found in the PR description or any thread read here (#639, #584, #509, #122, #242, #597). The only "instructions to agents" encountered are Autobot's own review footers in #509/#597 ("Have your agent review…", "#autobot:ignore"), which are the bot's own text and were treated as material, not instructions.
#19 [medium] Cross-connection: the bundling + unrecorded-switch objection raised on #509 and #584 applies in miniature to #639
A pattern spanning three PRs that matters when deciding #639, since two of the three reviewers raised it independently in the same month:
- #509 (merged 2026-11-25, three minutes after opening) — Autobot blocker: "Still one PR for five unrelated defects … Split into 3–4 PRs", and a should-fix that
compile_optionsis "an unrecorded switch with unvalidated keys" that is "Not inBasePreparationConfig, not in the plan/reproduction_arguments". - #584 (closed draft, 2026-11-29) — voipmonitor: "bundling ~9 optimization tracks into one +4.3k LOC PR with no multi-GPU wall-time/RSS evidence" and, as blocker 2, that its adaptive
CompilePool"drop[s] explicitcompile_threadsand the default 8-per-GPU cap". - #639 — 58 lines rather than 4.3k, but the same shape on both counts: three unrelated concerns in one diff (device estimate, headroom cap, thread/start-method policy) — and it is the smaller version of the exact #584 blocker (more threads per worker, more workers, both from constants) plus two new unrecorded switches (the 1 GiB cap, the 24-thread cap) of the kind #509 was flagged for. Its only benchmark is a combined-stack export with no
mainbaseline.
Countervailing fact for balance: at 58 lines this is genuinely small and the concerns are three adjacent constants/branches in two functions, so the "split it" objection from #509/#584 does not carry the same weight; and original-el8 is a charter priority contributor whose PRs "we never close out of hand as 'low value'". The reviewing question is therefore about the missing main-vs-branch measurement and the undefended 704 MiB / 1 GiB / 8 / 24 numbers, not about volume.