Recommendation: Ready To Merge
The Round 1 should-fix and cleanup items are cleanly addressed at head 3c3c4df: ignition/planning.py now validates that explicitly selected GPUs have supported architectures before calling params.filter_world_sizes(), passes chosen or supported into both world-size filtering call sites, documents the contract on ParameterGroup.filter_world_sizes, and covers automatic, explicit, SM120, SM121, and unsupported SM90 cases in tests/cli/test_planning.py. No correctness, safety, concurrency, or system-level regressions were introduced, and the change keeps capability-specific tensor-parallel policy cleanly inside recipes rather than core ignition. Confirm python-cpu.yml CI is green on 3c3c4df before merging.
Merge Risk
Level: Low
- Scoped to a single one-shot CLI planning function (
ignition/planning.py:565-614) invoked only during setup (ignition/cli/preparation.py:70,ignition/cli/serve.py:200, 270, 422,ignition/cli/bench.py:186); zero impact on serving hot paths, concurrency/locks, memory budgets, or serialized manifests/wire formats. - Backward compatible with recipes whose
filter_world_sizes()ignorescontext.gpus, verified against both in-repo overrides (tests/cli/test_planning.py:81-85,tests/cli/test_commands.py:55-59). - Preserves
CapacityError(exit 4) overUsageError(exit 2) for explicitly selected unsupported GPUs (ignition/planning.py:573-575,ignition/errors.py:13-22,ignition/cli/__init__.py:373-377).
Walkthrough
ignition/planning.py:566-577: Constructssupporteddirectly as a tuple, resolveschosenand checks both--gpusindex bounds (UsageError) andgpu.supported(CapacityError) ahead ofparams.filter_world_sizes(), and passesreplace(pre_context, gpus=filter_gpus)wherefilter_gpusischosenwhen selected orsupportedotherwise.ignition/planning.py:581-591: Retains the post-filteringlen(chosen) not in plan_sizesvalidation/capacity check and automaticlen(supported) < plan_sizes[0]check after removing the relocatedgpu.supportedloop.ignition/planning.py:611-613: Threadsgpus=filter_gpusintocandidate_params.filter_world_sizes()insidecandidates()so automatic planning and capacity-relief candidates see the same supported GPU set.ignition/parameters.py:560-565: Documents thecontext.gpusandcontext.world_sizecontract onParameterGroup.filter_world_sizes.tests/cli/test_planning.py:568-599: Addstest_filter_world_sizes_receives_selected_or_supported_gpusexercising automatic and explicit planning on SM120, SM121, and unsupported SM90 syntheticGpudescriptors, including a guard (:573-574) that ensures the SM90 case fails if unsupported GPUs ever reachfilter_world_sizes().
Pre-merge Checks
- [PASS] Security / malicious screen: Small, pure-Python change across planning, docstrings, and unit tests; no I/O, subprocesses, deserialization, or untrusted input handling added.
- [PASS] Charter & value fit: Keeps hardware/TP policy inside recipe
RecipeParameterssubclasses with no model-specific branches or flags in coreignition, supporting SM120/SM121 single- and cross-node serving. - [PASS] Related / duplicate / conflict check: Cleanly extends the
ParameterContext.gpushook introduced in #545; no competing open PR and rebase-clean onmain. - [WARN] Tests & verification evidence: New CPU unit test is isolated and covers both
plan_sizesandcandidates()passthrough plus the SM90CapacityErrorguard (author reports 29 passed acrosstests/cli/), butpython-cpu.yml(.github/workflows/python-cpu.yml:30-33(not opened)) should be confirmed green on3c3c4df, and live 3-node SM121 validation lives in external companion PRlocal-inference-lab/hyperflare-recipes#103.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Optional: eliminate
filter_gpusby rebindingpre_context(ignition/planning.py:576-577, 611-613). Afterparams.validate(pre_context)at:563, every remaining read ofpre_context(:577,:585,:612) expects the resolved GPUs. Rebinding once:
removes thepre_context = replace(pre_context, gpus=chosen if chosen is not None else supported) plan_sizes = params.filter_world_sizes(world_sizes, pre_context)filter_gpuslocal, avoids repeatinggpus=filter_gpus, and letscandidates()at:611stay on its original single line (candidate_params.filter_world_sizes(world_sizes, replace(pre_context, root=candidate_params))).
Nits
- Multi-host phrasing in
ignition/parameters.py:563-564: On multi-host paths (ignition/cli/serve.py:199-204, 421-426),plan()receivesselected=tuple(range(len(gpus)))covering all participating ranks' GPUs even when--gpusis omitted locally. Clarifying "(when explicit GPUs or multi-host ranks are selected)" would make the docstring exact for both single- and multi-host callers. - Optional exit-code assertion in
tests/cli/test_planning.py:598-599: Capturingas exc_infoand assertingexc_info.value.exit_code == 4(or adding a mixed supported+unsupported selection case) would pin the exit-code contract even more explicitly, thoughCapacityErroralready maps directly to exit 4 inignition/errors.py:21-22.
Dropped on verification
- Discovery Dossier A5 & Value Proposition "Must fix #1/#2" (stale
c2ef797snapshot): Superseded by head3c3c4df, where all claimed edits (hoistedgpu.supportedcheck, tuplesupported,filter_gpusreuse incandidates(), docstring update, and SM90 test using_recipe()/_gpu()) are present. - Subtraction S2 ("delete
if any(not gpu.supported ...): return ()attests/cli/test_planning.py:573-574as unreachable dead code"): Factually incorrect. Line:577falls through to(4,)(not()as claimed), so for the 4-GPU SM90 case at:597-599(selected=(0, 1, 2, 3)), lines:573-574are the exact regression detector that converts a leaked unsupported GPU intoUsageErrorand fails the test; removing them would let the SM90 test falsely pass even if the Round 1 bug returned. - Subtraction S1 optional follow-on (guard-clause rewrite of
ignition/planning.py:567-575): Dropped because the proposed snippet constructedtuple(gpus[index] for index in selected)before checkingany(index >= len(gpus) ...), which would raiseIndexErrorinstead ofUsageError. - Correctness F1 / Dossier A4 ("hoisting
if not gpu.supported:regresses mixed explicit--gpuserror precedence and contradicts:583-584"): Not a defect. Rejecting genuinely unsupported hardware withCapacityError(exit 4) ahead of world-size/TP-count validation is clearer and guaranteesfilter_world_sizes()never sees unsupported devices (whereas passingtuple(g for g in chosen if g.supported)as suggested would passgpus=()on all-unsupported selections). The comment at:583-584refers specifically to the generic GPU-countCapacityErrorimmediately below it (:586-589). - Correctness F1 sub-claim (hypothetical recipe filtering on
len(context.gpus)turning single-GPU explicitCapacityErrorintoUsageError): GPU-count checks are handled byplanning.plan(:581-591), not byfilter_world_sizes(); this is not a planning defect. - Correctness F2(b) ("unsupported peer GPU raises a local-looking message at
ignition/planning.py:574-575"): Pre-existing behavior onmain(ignition/planning.py:585-587), unchanged by this PR. - Correctness F3 ("
params.validate(pre_context)atignition/planning.py:563receivesgpus=()whilefilter_world_sizesreceives real GPUs"): Pre-existing intentional lifecycle design onmain(validateruns pre-GPU inignition/cli/preparation.py:58andignition/planning.py:563, then withgpusandworld_sizeat:585andfit()at:478). - Correctness F4 sub-claim ("
tests/cli/test_planning.py:589-590is vacuous"): Low-signal; it establishes the SM120 baseline alongside:594-595, which directly exercises bothplan_sizesandcandidates()passthrough and fails onmain. - Subtraction S3 ("missing hook contract in
docs/preparation-development.md:32-36and redundantworld_size is Nonein docstring"): Low-signal;docs/preparation-development.md:32-36lists all 11 hooks by name without per-hook context contracts, and documentingcontext.world_size is Noneusefully distinguishesfilter_world_sizes()fromfit().