Opened by a workflow run, Nov 30, 2026 7:24 AM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: original-el8 (GitHub COLLABORATOR; charter-named priority contributor alongside @voipmonitor and @lukealonso; commits as "Jason Cook"), Discord el8
Motivation: Discrete-GPU compile workers only need ~672 MiB of device memory, but main reserves 1 GiB each and subtracts the full runtime headroom (4 GiB by default, or more) from device free memory, so far fewer compile workers are admitted than the GPU could hold. On high-core hosts each worker is also pinned to one Inductor thread, leaving cores idle during compilation and artifact binding; the PR gives workers more threads and caps the compile-time device reserve at 1 GiB.
Scale: +58 / −18 lines in 4 files
Proposal:
_DISCRETE_WORKER_DEVICE_BYTES1 GiB → 704 MiB (compile_pool.py:24-25).- New discrete-only
compile_reserve = min(headroom_bytes, 1024<<20)used for the device probe and capacity math, leavingCompilerResources.headroom(host-RAM side) un-capped (compile_pool.py:49-62). CompilePool.__init__: forcedcompile_threads=1→max(1, min(8, cpu_count // workers)), plusworker_start_method="subprocess"off Windows (compile_pool.py:137-144).ForwardCache.prepare_many: Inductor patchcompile_threads=1→min(24, os.cpu_count() or 1)(aot.py:901-903).- Two test files updated, one new test (
test_prepare_many_scales_inductor_compile_threads_with_cpu_count). Touches: ignition/preparation/compile_pool.py— admission sizing, headroom, pool thread policyignition/preparation/aot.py—prepare_manyInductor thread budgettests/preparation/{test_compile_pool,test_forward_compile_options}.pyRelated items:- #122 Make the compiler memory headroom a preparation setting (closed): wanted this constant to be a setting; records that main deliberately dropped per-compiler Inductor threading, whose measurements it withdrew
- #597 Key compiled forward sharing and Inductor validation by GPU name (open): reviewed "Ready To Merge", edits the same
compile_pool.py/aot.py; race/rebase - #584 Accelerate Ignition forward compilation… (closed): review blocker was bypassing
compile_threadsand the worker cap — the direction #639 takes - #509 Fix Ignition storage lowering, guard pickling, and compiler worker startup (merged): rewrote these same four files 7 days earlier
- #242 Multi-host export fails when one rank has no memory for a forward compiler (open): host-RAM side, untouched by this PR
Link: https://github.com/NVIDIA/hyperflare-inference/pull/639
Autobot comments: Seven things the description does not say: the default path relaxes too (
bootstrap.py:35,134→ 4 GiB becomes 1 GiB on every discrete export, not just large reserves); discrete worker counts rise ~1.6× (the changed test goes 10 → 16 workers);DeferredCompiledForward.materialize_for_capturestill pinscompile_threads=1(aot.py:688), so one file now carries two thread policies; thehasattr(os, "cpu_count")guard exists only so an unmodified Windows mock test stays green (test_compile_pool.py:467-476), leaving Windows partitioning untested; the thread count usesos.cpu_count()while the worker count usessched_getaffinity(host_memory.py:31), so cgroup-limited ranks can overshoot their CPU budget;CompilerResources.headroomis left un-capped, so #242's host-RAM failure mode persists; and it reverses the "one Inductor thread each" designc8d4c324introduced, without citing that history. CI on the head commit is failing while the description reports only green runs, the 359.8 s GB300 export has nomainbaseline (charter #210 wants one), the 672 MiB figure has no artifact, no issue is linked or fixed, and there are no comments, reviews or labels — the only cross-reference is #597, which is nearer to merge.
Value Proposition
Value Proposition — #639 "ignition: tune discrete CompilePool sizing and scale Inductor compile threads"
Charter alignment. The change lives in shared ignition/preparation/ code with no per-model branches and targets the charter's own hardware (SM103/SM120/SM121), consistent with "keep the runtime small and model-agnostic." But it breaks two explicit rules. "Be explicit and pin everything. No magic defaults": it adds four hardcoded, undocumented, non-configurable numbers (704 MiB, 1 GiB, 8, plus a separate 24 in aot.py), one of which silently overrides a configured headroom_bytes — since bootstrap.py:35 defaults headroom to 4 GiB, every discrete export's compile reserve drops 4 GiB → 1 GiB, not the exception the "Why" describes. "Bring real evidence… benchmarks showing an actual speedup over main (#210)": the lone wall-clock figure (101/101 forwards, 359.8 s) has no main baseline, no worker or thread counts, and was taken on a 288 GB part where device memory matters least.
Novelty & status. Not obsolete — no commits to these files since the branch point — and not textually superseded by #597. But #597 answers the same question ("how many compiler workers does a host get") and is already reviewed Ready To Merge, so #639 lands second and rebases. Its central move also reverses a deliberate policy (c8d4c324, one Inductor thread per compiler) without citing it, while #122's threading measurements were withdrawn precisely because main no longer has that mechanism. No issue is linked or fixed; the idle-core and daemonic-process motivations are unfiled, and #242 — the closest tracked bug — is the host-RAM side this PR deliberately leaves untouched.
Value vs maintenance cost. The gain is plausible (~1.6× more compiler processes, up to 8× more threads per worker on discrete GPUs), but the risk is concrete: worker count comes from sched_getaffinity while threads come from raw os.cpu_count(), so a cgroup- or taskset-limited rank could launch 128 Inductor subprocesses; Windows partitioning is untested (the hasattr(os, "cpu_count") guard exists only to satisfy a mock); materialize_for_capture still patches compile_threads=1, leaving two conflicting policies in one file; and none of the new policy is recorded in the plan or reproduction_arguments — the "unrecorded switch" objection raised on #509.
Verdict: Worth it with changes. Required before merge: split the three bundled concerns; supply a main baseline on a served discrete workload; justify reversing c8d4c324; derive threads from the same affinity source as workers; cover Windows; reconcile aot.py:688; make the constants configurable and documented; rebase behind #597. As submitted — draft, CI red on head, zero engagement — it is not mergeable, but the area is legitimate and the author is a priority contributor, so this should be redirected rather than closed.
Full report Decide Value: yes (98%): This change is worth reviewing: it provides value to the project in line with its charter.
Classify intake
Selected: triage:review, performance, area:memory, area:preparation
Threshold: 65%
Triage
- [✓]
triage:review: 91.3% -
triage:design-review: 6.6% -
triage:validation: 1.9% -
triage:investigate: 0.1% -
triage:integration: 0.0% -
none: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
performance: 94.0% -
enhancement: 40.7% -
community: 34.9% -
duplicate: 11.9% -
bug: 8.5% -
documentation: 0.2%
Area
- [✓]
area:preparation: 95.3% - [✓]
area:memory: 65.1% -
area:caching: 2.0% -
area:kernels: 2.0% -
area:scheduling: 1.4% -
area:orbit: 1.2% -
area:engram: 0.7% -
area:selene: 0.5% -
area:rocenante: 0.2% -
area:api: 0.1% -
area:packaging: 0.1%
Model
-
model:inkling-small: 14.8% -
model:deepseek-v4: 2.9% -
model:deepseek-v4.1: 1.4% -
model:glm-5.3: 1.4% -
model:kimi-k3.1: 0.4% -
model:qwen3.8-flash-next: 0.4% -
model:qwen3.8-27b: 0.1% -
model:gemma4: 0.1% -
model:mimo-v2.6: 0.1% -
model:muse-glimmer: 0.0% -
model:nemotron-3.5-bolt: 0.0%
Apply Labels (Intake)
Applied: +triage:review, +performance, +area:memory, +area:preparation
Subtraction and simplicity
The diff is lean in structure (+58/−18, 4 files, no new function, class, parameter, flag, or dead code) but not in knobs: each of the three code hunks adds a hardcoded number or a defensive branch. Four suggestions:
-
Delete the 1 GiB discrete cap (
compile_pool.py:48-55).compile_reserve = headroom_bytes if shared else min(headroom_bytes, 1024 << 20)is read in exactly the two places that wereheadroom_bytes, so deleting it restores main verbatim. It silently overrides the caller-configured headroom, whichAGENTS.md:456-460requires be described in the plan and:182-186forbids relaxing. The 704 MiB estimate alone already gives most of the win: 12 GiB free / 2 GiB headroom → 14 workers vs main's 10 (16 with the cap); at the 4 GiB default, 11 vs 8. It is also what forces the if/else rewrite oftest_compilation_preserves_configured_headroom(:440-452). -
Collapse
compile_pool.py:137-144to three lines usingcpu_workers() // self.workers.cpu_workersis already imported at:20and used at:42, andhost_memory.py:31,35already does the affinity mask,hasattrfallback,or 1andmax(1, …).hasattr(os, "cpu_count")exists only so theSimpleNamespace(name="nt")mock attest_compile_pool.py:470keeps passing (AGENTS.md:194-196);max(1, self.workers)is unreachable because:134-135already raised. -
One
compile_threadsauthority, not four (compilation.py:30min 16,compile_pool.py:140min 8,aot.py:903min 24,aot.py:688still 1).aot.py:903can useself.options['compile_threads'], always present viaaot.py:823.aot.pyshould not ship both 24 and 1 for the same binding path;docs/preparation-development.md:317-318still describes the=1policy. -
Two test assertions re-implement the formula (
test_compile_pool.py:28,test_forward_compile_options.py:282); both values are 8 — pin the literal, as:374-377already does. The new 9-line test attest_forward_compile_options.py:333-341folds into the existing assertion once #3 lands.
Already lean, not flagged: the 704 << 20 constant, the platform branch itself, no new API surface, the pinned-literal test changes.
Open: why materialize_for_capture stayed at 1; whether the 8 GiB host headroom floor at :62 is still intended (making the device cap an unexplained asymmetry); which of the four compile_threads authorities is meant to win; and whether #597 assumes one thread per worker.
Correctness and contracts
Verdict: request changes. The thread/start-method half of #639 is a real fix but is priced by nothing; the sizing half relaxes the discrete reserve on the default path and raises worker counts without a main baseline.
Top findings:
- Blocker — admission pricing unchanged for 1→8 Inductor threads/worker:
compile_pool.py:139-143setsinner_threads = max(1, min(8, (os.cpu_count() or 1) // max(1, self.workers)))plusworker_start_method="subprocess", yethost_memory.py:15(FORWARD_WORKER_BYTES = 32 GiB) andcompile_pool.py:55(704 MiB) still price one worker as one process. N admitted slots can run 8N compiler processes. - Blocker —
_DISCRETE_WORKER_DEVICE_BYTES = 704 << 20(compile_pool.py:24-25) is a single-process measurement divided into free device memory while each worker may spawn 8 CUDA-initializing subprocesses; untested (all device inputs monkeypatched). - Major —
aot.py:903torch._inductor.config.patch(compile_threads=min(24, os.cpu_count() or 1))spans all of_prepare_many: binding, warmup and theBindingMismatchfallback recompile. Contradictsdocs/preparation-development.md:318, ignores_OPTIONS['compile_threads'](compilation.py:30), recorded nowhere (stripped ataot.py:825). - Major — affinity mismatch: threads from
os.cpu_count()vs workers fromsched_getaffinity(host_memory.py:31); the 3-CPU case guarded bytest_compile_pool.py:535-542gets 8 threads/worker. - Major — one-sided clamp:
compile_pool.py:51caps the device reserve at 1 GiB on discrete while:62keeps the 8 GiB host floor, so the default 4 GiB plan headroom (bootstrap.py:35) drops to 1 GiB for every discrete export; #242's host side untouched. - Minor — Windows untested (
test_compile_pool.py:467-476usesSimpleNamespace(name="nt"), hitting thehasattrfallback),aot.py:688keepscompile_threads=1, tests mirror the formula (test_compile_pool.py:28,test_forward_compile_options.py:282).
Sound: no artifact/contract break (aot.py:823-827), patch identity preserved through nesting, correct layer, unchanged _prepare_many gate.
Open: CI red on head; no main baseline; safety of 704 MiB under fan-out; whether the 8 GiB host floor is deliberate; whether #597 lands first.
Final review
Recommendation: Changes Requested
This draft PR targets a legitimate compilation-throughput bottleneck in shared ignition/preparation/ code with a small footprint (+58/−18 across 4 files) and no per-model branches or artifact-format breaks. However, the current implementation introduces two verified system-level blockers: (1) per-worker nested Inductor subprocesses (compile_threads up to 8 with worker_start_method="subprocess") are unbudgeted against host/unified RAM, ignore CPU affinity, and multiply per local rank in multi-GPU _prepare_ranks (scaling up to 8 nested subprocesses per worker precisely when RAM is tightest); and (2) ForwardCache.prepare_many sets compile_threads=min(24, os.cpu_count() or 1) in the parent rank process, spawning persistent, unbudgeted Inductor worker pools during artifact binding/loading across every local rank without shutdown before materialization or capture. In addition, the hardcoded 1 GiB discrete compile_reserve cap silently overrides the default 4 GiB headroom on every discrete export, Windows thread partitioning is masked by a mock-only guard, and main-vs-PR baseline evidence and green CI are still needed.
Merge Risk
Level: High
- Every compiled-forward preparation path is affected across single-GPU, multi-GPU TP, integrated (GB10), and discrete (SM103/SM120/SM121) hosts: multi-rank hosts (
ForwardCache._prepare_ranks) and memory-constrained / integrated hosts can now severely oversubscribe CPU cores and host/unified RAM with unbudgeted nested Inductor subprocesses (N_local_ranks × workers × inner_threads) plus persistent parent-rankAsyncCompilepools (N_local_ranks × min(24, cpus)). - Default discrete compile-time device reserve drops silently from 4 GiB to 1 GiB (
ignition/preparation/bootstrap.py:35,compile_pool.py:51) alongside a ~1.6× worker-count increase (704 MiBper worker, only32 MiBabove the unverified672 MiBclaim), increasing OOM risk on tighter-VRAM SM120/SM121 workstations without an isolatedmain-vs-PR benchmark. - No GPU preparation tests run in CI, and CI on head
3400e3ais currently failing while open Ready-To-Merge PR #597 modifies the samecompile_pool.py/aot.pycoordination paths.
Walkthrough
ignition/preparation/compile_pool.py: Lowers_DISCRETE_WORKER_DEVICE_BYTESfrom1 GiBto704 MiB(:24-25); caps discrete device-sidecompile_reserveatmin(headroom_bytes, 1024 << 20)incompiler_resources(:49-55) while leaving integrated GPUs and host-RAMCompilerResources.headroom(:62) unchanged; replacescompile_threads=1inCompilePool.__init__withinner_threads = max(1, min(8, (cpu_count or 1) // max(1, self.workers)))and setsworker_options["worker_start_method"] = "subprocess"whenos.name != "nt"(:137-144).ignition/preparation/aot.py: ChangesForwardCache.prepare_many's outer Inductor patch fromcompile_threads=1tocompile_threads=min(24, os.cpu_count() or 1)(:901-903), leavingDeferredCompiledForward.materialize_for_captureatcompile_threads=1(:688).tests/preparation/test_compile_pool.py: Updates discrete worker capacity assertions (10 → 16at 12 GiB free / 2 GiB headroom,:43-45;3 → 4at 3 GiB free,:376-388), splitstest_compilation_preserves_configured_headroombyintegrated(:443-452), and updatescompile_threads/worker_start_methodexpectations (:25-30,:381-388,:391-398,:548-551).tests/preparation/test_forward_compile_options.py: UpdatesCompilePooloption assertions (:282-284) and addstest_prepare_many_scales_inductor_compile_threads_with_cpu_count(:333-342).
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt injection, shell execution, credential exposure, or unsafe deserialization introduced across the 4 changed files.
- [WARN] Charter & value fit: Lives in shared
ignition/preparation/with no per-model branches or artifact-format breaks and targets SM103/SM120/SM121, but lacks amain-vs-PR benchmark on a served/discrete workload, silently clamps explicitheadroom_byteson the default discrete path, and violatesdocs/preparation-development.md:317-318/docs/design-review.md:81-84resource-release invariants. - [WARN] Related / duplicate / conflict check: No commits to these files on
mainsince branch point, but open PR #597 (reviewedReady To Merge) modifiesallocate_workersincompile_pool.pyand_prepare_ranksinaot.py; this PR also partially reversesc8d4c324's single-thread-per-worker policy without citing or benchmarking against it. - [WARN] Tests & verification evidence: Description cites local CPU pytest subsets and a single combined-stack GB300 export (
359.8 s) with nomainbaseline, no peak RAM/VRAM telemetry, and no SM120/SM121 measurement; CI on head3400e3ais failing (.github/workflows/python-cpu.yml(not opened) runs the full CPU suite).
Blockers
-
Nested Inductor subprocess fan-out breaks host/unified RAM and CPU admission budgets — and multiplies across local ranks and low-RAM hosts (
ignition/preparation/compile_pool.py:137-144,ignition/preparation/aot.py:1086, 1097-1099,ignition/preparation/host_memory.py:13-16, 31).- Verified behavior & impact:
CompilePool.__init__computesinner_threads = max(1, min(8, (cpu_count or 1) // max(1, self.workers)))and enablesworker_start_method="subprocess"on POSIX, whilecompiler_resources(compile_pool.py:60-62) andallocate_workers(:76-92) still charge only one outer worker (FORWARD_WORKER_BYTES = 32 GiB, or_WORKER_BYTES = 2 GiBin the minimum-allowance fallback at:88-92). Each nested Inductor subprocess importstorch/triton, runsruntime_patches.apply()(ignition/runtime_patches/workers.py:21-23), and invokes Triton/ptxas compilation in its own process. This fails in three concrete ways:- Multi-rank host multiplication: In
ForwardCache._prepare_ranks(aot.py:1086, 1097-1099),allocate_workersbudgets workers across all ranks on a host, then each rank independently createsCompilePool(self.device, options=self.options, workers=workers[share]). BecauseCompilePool.__init__dividesos.cpu_count()by this rank'sself.workersrather than the host's total admitted workers, a 4-GPU 32-core SM120 workstation admitting[2, 2, 2, 2]spawns4 × 2 × min(8, 32 // 2) = 64nested Inductor subprocesses (plus 8 outer workers) on 32 cores; a 72 GiB host with[1, 1, 0, 0](test_compile_pool.py:455-464, 0 GiB spare above the 8 GiB headroom) spawns2 × 1 × 8 = 16unbudgeted nested subprocesses. - Inverse scaling on memory-constrained and integrated (GB10) hosts: The tighter RAM is (forcing
self.workers == 1, including the 10–12 GiB minimum-allowance fallback atcompile_pool.py:88-92and unified-memory GB10 runs as intest_compile_pool.py:391(True, 1, 8)), the largerinner_threadsbecomes — hitting the maximum8nested subprocesses right when the host has the least RAM available. - CPU affinity bypass: Outer worker counts respect
os.sched_getaffinity(0)viahost_memory.cpu_workers()(compile_pool.py:42,host_memory.py:31), whereascompile_pool.py:139-140reads rawos.cpu_count(). A 3-CPU cgroup/taskset rank (test_compile_pool.py:535-542) admits 3 workers and then assigns up to8threads each =24concurrent compile subprocesses on 3 CPUs.
- Multi-rank host multiplication: In
- Concrete fix: Pass total local-host admitted workers (and remaining host/unified RAM budget from
allocate_workers) intoCompilePool, derive CPU budget fromhost_memory.cpu_workers()(affinity-aware) divided by total local-host workers, and capinner_threadsagainst remaining host/unified RAM (e.g., pricing each additional nested worker at_WORKER_BYTESand forcinginner_threads = 1under the minimum-allowance fallback or when remaining RAM cannot cover nested workers).
- Verified behavior & impact:
-
ForwardCache.prepare_manyspawns persistent, unbudgeted parent-rank Inductor worker pools across binding/warmup without shutdown or rank/affinity bounds (ignition/preparation/aot.py:901-906, 1053, 1229,ignition/preparation/aot.py:423-425, 980).- Verified behavior & impact:
prepare_manywraps the entire_prepare_many/_prepare_rankslifecycle intorch._inductor.config.patch(compile_threads=min(24, os.cpu_count() or 1)).- Contrary to the comment (
"Allow fallback/binding compilation to parallelize"), theBindingMismatchfallback recompile ataot.py:980callsaot_forward(forward, options=self.options)→standalone_compile(..., options={'config_patches': _compile_options(options)})(aot.py:423-425), which always carries_OPTIONS['compile_threads'](min(16, cpu_count),compilation.py:30) and overrides the outer24patch. - Instead, the outer
24patch affectsself._load(...)(deserialize_bundled_cache_entryataot.py:66, called in_restoreat:1053and in"Load and warm compiled forwards"at:1229) and_warm(...)inside the parent rank process. Whenever binding/loading enters Inductor'sAsyncCompile, Inductor starts a process-global singletonSubprocPoolof up to24persistent worker processes per rank (up toN_local_ranks × 24on a multi-GPU host, ignoring affinity and host/unified RAM). - Unlike
CompilePool.__exit__(compile_pool.py:167-169), nothing inignition/shuts down Inductor's parent-processAsyncCompilepool beforematerialize(), warmup, or CUDA graph capture (capture.py:140-188), leaving those workers resident in host/unified RAM through capture. This directly violatesdocs/preparation-development.md:317-318("artifact binding starts no additional compiler pool") anddocs/design-review.md:81-84("Release compiler resources before materializing preparation caches"), and contradictsDeferredCompiledForward.materialize_for_capture(aot.py:688), which stays atcompile_threads=1.
- Contrary to the comment (
- Concrete fix: Restore
torch._inductor.config.patch(compile_threads=1)inForwardCache.prepare_many(aot.py:903). If parent-rank binding or fallback recompilation is measured to need parallelism, scope it strictly to the compiling operation, bound threads bycpu_workers() // local_ranksand available host/unified RAM (reusingself.options['compile_threads']rather than a hardcoded24), and explicitly shut down Inductor'sAsyncCompilepool beforematerialize()and graph capture.
- Verified behavior & impact:
Should Fix
-
Hardcoded
1 GiBdiscretecompile_reservecap silently overrides default and user-configured headroom (ignition/preparation/compile_pool.py:49-62,ignition/preparation/bootstrap.py:35, 134).- Because
BasePreparationConfig.headroom_bytesdefaults to4 GiB(bootstrap.py:35, plusplan.reserve_bytesat:134),min(headroom_bytes, 1024 << 20)silently reduces the compile-time device reserve from4 GiB(or larger explicit--reserve) to1 GiBon every discrete export — not only "when large runtime reserves are configured" as the PR description states. Meanwhile,CompilerResources.headroom(compile_pool.py:62) keeps the8 GiBhost floor andhost_memory.candidate_scratch_limit/tuning_limits(host_memory.py:160, 172) still honour fullheadroom_byteson discrete GPUs. - Fix: Drop the hardcoded
1024 << 20override (see Subtract / Simplify #1), or if a separate compile-time device reserve is needed, split it into its own PR with explicit plan/config visibility (docs/design-review.md:89-90,AGENTS.md:456-460) and tight-VRAM SM120/SM121 validation.
- Because
-
Missing
main-vs-PR benchmark, worst-case 704 MiB VRAM proof, and green CI (.github/workflows/python-cpu.yml:30-33(not opened),ignition/preparation/compile_pool.py:24-25).- The PR provides only one combined-stack GB300 (
SM103, 288 GB HBM) wall-clock number (359.8 s) with nomainbaseline, no worker/thread counts, no peak host-RSS or device-VRAM measurements, and no measurement on SM120/SM121 workstations. Lowering_DISCRETE_WORKER_DEVICE_BYTESfrom1 GiBto704 MiBleaves only32 MiB(~4.8%) slack above the unverified672 MiBfigure (replacing the previous comment noting "about 0.7 GiB for Kimi K3's 93-layer forwards"). Additionally, CI on head3400e3ais failing while the PR description lists only local green subsets. - Fix: Resolve the failing CI check on head, provide an isolated
main-vs-branch A/B benchmark (wall-clock compile time, worker/thread counts, peak host RSS, and peak device VRAM) on SM120/SM121 (and optionally GB300), and document the worst-case single-worker VRAM measurement justifying704 MiB.
- The PR provides only one combined-stack GB300 (
-
Windows thread partitioning and
"spawn"preservation are untested, andhasattr(os, "cpu_count")exists only for a mock (ignition/preparation/compile_pool.py:139,tests/preparation/test_compile_pool.py:467-476).test_windows_compiler_workers_fit_host_ram_with_larger_device_budgetmonkeypatchescompile_pool.ostoSimpleNamespace(name="nt")(omittingcpu_count), sohasattr(os, "cpu_count")incompile_pool.py:139falls back toNone→inner_threads = 1instead of testing Windows partitioning. No test assertsworker_start_methodon theos.name == "nt"branch (test_compile_pool.py:29-30andtest_forward_compile_options.py:283-284only assert whenos.name != "nt").- Fix: Remove
hasattr(os, "cpu_count")when switching tocpu_workers()(Blocker 1), and add/update a Windows-path test asserting bothcompile_threadsand thatworker_start_methodis not overridden to"subprocess"(preserving"spawn"from_OPTIONSon Windows).
-
Coordinate with Ready-To-Merge PR #597 and consider splitting bundled concerns (
ignition/preparation/compile_pool.py,ignition/preparation/aot.py).- Open PR #597 (reviewed
Ready To Merge) adds per-GPU-SKUgroups=admission toallocate_workersand updates_prepare_ranks; any host-wide worker/thread budgeting here should rebase cleanly onto #597's multi-group admission. Splitting the discrete worker VRAM sizing (704 MiB) from the nested/parent Inductor threading changes (AGENTS.md:198) will also let each change be benchmarked and merged independently.
- Open PR #597 (reviewed
Subtract / Simplify
- Delete the
1 GiBdiscretecompile_reserveclamp (ignition/preparation/compile_pool.py:49-55) and restoreheadroom_bytesdirectly in both expressions (:52,:55). Keeping_DISCRETE_WORKER_DEVICE_BYTES = 704 << 20alone already delivers most of the discrete worker-count increase (10 → 14workers at 12 GiB free / 2 GiB headroom;8 → 11at 4 GiB default headroom) without silently overriding configured headroom, adding a secondsharedconditional, or rewritingtest_compilation_preserves_configured_headroom(tests/preparation/test_compile_pool.py:443-452). - Collapse
CompilePool.__init__'s thread calculation (ignition/preparation/compile_pool.py:137-144): remove the mock-drivenhasattr(os, "cpu_count")guard (:139) and the unreachablemax(1, self.workers)guard (:140—:134-135already rejectsworkers < 1), and reuse the already-importedcpu_workers()(compile_pool.py:20). - Remove the standalone
24cap inForwardCache.prepare_many(ignition/preparation/aot.py:903) and restorecompile_threads=1(matchingaot.py:688anddocs/preparation-development.md:318), removing both the fourth distinctcompile_threadsauthority andtest_prepare_many_scales_inductor_compile_threads_with_cpu_count(tests/preparation/test_forward_compile_options.py:333-342).
Nits
- Replace formula-mirroring test assertions with concrete literals (
tests/preparation/test_compile_pool.py:28,tests/preparation/test_forward_compile_options.py:282): both recomputemin(8, ...)inline instead of pinning concrete expected values liketest_compile_pool.py:376-377. - Verify nested-process teardown on
SIGINT/ pool exit (ignition/preparation/compile_pool.py:167-169,tests/preparation/test_native_processes.py:123-162):test_cli_interrupt_leaves_no_compiler_processesonly spawns a single-levelSubprocPool(1); onceCompilePoolworkers spawn nestedworker_start_method="subprocess"Inductor children, add coverage ensuring no orphaned grandchild processes remain on interrupt or failure.
Dropped on verification
- Upstream Blocker claiming nested Inductor workers each initialize a 672 MiB CUDA context and must multiply
_DISCRETE_WORKER_DEVICE_BYTESbyinner_threads: Dropped as overstated on the device-VRAM axis. Under default_OPTIONS(ignition/preparation/compilation.py:28,'triton.autotune_at_compile_time': False), Inductor'sAsyncCompilesubprocesses compile Triton/C++ kernels on CPU rather than initializing full CUDA contexts and constant-folding buffers like the outer_compile_forwardworker (compile_pool.py:108-112). The verified blocker is host/unified RAM and CPU process overcommit (Blocker 1), while the704 MiBsingle-worker VRAM estimate only lacks empirical worst-case proof (Should Fix 2). - Upstream claim that
aot.py:903'scompile_threads=min(24, ...)governsBindingMismatchfallback recompilation: Corrected on verification.aot.py:980callsaot_forward(forward, options=self.options)→standalone_compile(..., options={'config_patches': _compile_options(options)})(aot.py:423-425), where_compile_optionsalways supplies_OPTIONS['compile_threads'](min(16, cpu_count),compilation.py:30), overriding24. Blocker 2 accurately scopes the bug to parent-rank_load/_warmspawning persistentAsyncCompilepools. - Upstream Minor claiming
_prepare_many'slen(pending) >= compiler.workersgate is a separate high-water-mark / head-of-line-blocking defect: Dropped as duplicate of Blocker 1; the pending-queue gate (aot.py:948-949) is unchanged and not independently broken once worker × inner-thread budgets are bounded. - Upstream suggestion to turn all four constants (
704 MiB,1 GiB,8,24) into new CLI/config switches: Dropped/narrowed. Adding configuration switches for internal sizing constants conflicts withAGENTS.md:188-190;_DISCRETE_WORKER_DEVICE_BYTESmatches existing_WORKER_DEVICE_BYTESstyle and needs empirical measurement rather than a flag, while the real contract violation is the1 GiBclamp silently overriding user-configuredheadroom_bytes(Should Fix 1). - Upstream claim flagging
ForwardCache.__init__strippingcompile_threadsfrom the cache key (aot.py:825) as an "unrecorded switch" defect: Dropped as low-signal; strippingcompile_threadsfrom the artifact cache key is pre-existing and intentional so compiled artifacts remain portable across hosts with different core counts. - Upstream standalone Minor flagging
DeferredCompiledForward.materialize_for_capture(aot.py:688) staying atcompile_threads=1: Subsumed into Blocker 2, sincecompile_threads=1during artifact materialization is the intended invariant (docs/preparation-development.md:318) thataot.py:903broke away from.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 98.2% -
triage:validation: 1.2% -
triage:design-review: 0.5% -
none: 0.0% -
triage:partial: 0.0% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.