#1 [high] Change: what the diff actually does (2 files, +19/−9)
Head 6991986 (base main 2acc3f3). 2 files, +19/−9. Full diff read.
ignition/components/flashinfer_sampling.py:
sample_probabilities(...)gains keyword-onlyrow_independent_rng: bool = False, forwarded tosampling.sampling_from_probs(flashinfer_sampling.py:35-38).- NEW
@torch.compiler.allow_in_graph def sample_probabilities_out(probabilities, samples, valid, seed, offset, *, row_independent_rng=False)which callssampling.get_sampling_module()for its side effect and thentorch.ops.flashinfer.sampling_from_probs_out(probabilities, samples, valid, None, True, seed, 0, offset, 0, row_independent_rng)— all positional, op schema lives in FlashInfer (not in this repo) (flashinfer_sampling.py:41-47).
ignition/components/sampling.py:
- import switched from
sample_probabilitiestosample_probabilities_out(sampling.py:24-28). PreparedSampling._filter_scoresloopfor row in range(self._rows)+ two.copy_()per row removed; one callsample_probabilities_out(probabilities, scratch["sampled_tokens"], scratch["sample_valid"], seed=scratch["packed_seed"], offset=scratch["packed_offset"], row_independent_rng=True)(sampling.py:596-597).
Behaviour kept: the same helper is used by both the captured path (__call__ → _filter_scores(self.scratch_tensors), sampling.py:599-607) and the dynamic/functional path (run → _filter_scores(scratch, local=True, row_inputs=...), sampling.py:656-674), so both now do one launch. Invalid rows stay benign because _sanitize_scores writes a dummy one-hot (sampling.py:304-312) and _normalize_probs writes 1.0 at token 0 when mass<=0 (sampling.py:324-332), so no NaN reaches the batched kernel for dead rows; _complete ignores rows whose epoch/slot don't match (sampling.py:363-378).
Dead code left behind: sample_probabilities (and its new row_independent_rng kwarg, and return_valid) now has no caller anywhere in the repo (search: only definition remains); verify_chain likewise unused in-tree (flashinfer_sampling.py:50-54).
#2 [high] Undeclared: docstring and design docs still mandate the per-row loop
Not mentioned in the PR description, and not touched by the diff:
-
PreparedSamplingclass docstring still says the opposite of the new code: "Each row uses a separate FlashInfer call with device seed and / offset=4*counter. CUDA's Philox subsequence is therefore zero regardless / of packed row or physical slot." (ignition/components/sampling.py:459-473, quoted text at 467-469). The diff changes_filter_scores(sampling.py:596) but not this docstring, so the file now contradicts itself. -
docs/core-design.md:1289-1294 states as the runtime contract: "Pass device seed and offset tensors to FlashInfer's sampler. Each request uses a one-row draw with Philox subsequence zero and word offset
4 * counter, so batch packing cannot change its random stream." A batched launch makes "one-row draw" false; the property that must be preserved is only the (seed, offset) → token mapping. -
docs/mtp-design.md:486-490 is the doc that anticipated exactly this change: "The ordinary decode sampler (
ignition/components/sampling.py) uses one-row FlashInfer calls so Philox subsequence zero is independent of packed lane position. Preserve this property for speculative requests: use per-request one-row chain invocations ... unless a library API supplies an equally qualified request-keyed stream." So the change uses the documented escape hatch, but the doc's statement about the ordinary decode sampler is now stale and neither doc is updated.
Also stale after this PR: philox4x32_reference's documented law "FlashInfer samples from the first word with CUDA curand_uniform conversion and an explicit offset of 4*counter" (sampling.py:236-242) now depends on FlashInfer's row_independent_rng implementation rather than on the one-row-per-call construction.
#3 [high] Dependency: repo tracks FlashInfer main, so "update the pin" has no file to change
The PR says "Merge local-inference-lab/flashinfer#208 and update the FlashInfer pin before merging this PR." In this tree there is no pin file to update:
- pyproject.toml:25 lists
flashinfer-python[b12x]in theprepareextra and pyproject.toml:47 declaresflashinfer-python = { git = "https://github.com/local-inference-lab/flashinfer.git", branch = "main" }. That is a branch dependency, not a commit pin. - No
uv.lockexists in the repository tree (list_files foruv*returns nothing at PR head or atmain), although docs/core-design.md:381-385, docs/model-preparation.md:145-152 and docs/api.md:1073 all describeuv.lockas the place that "records the resolved commit". - docs/model-preparation.md:147-152 names
.github/workflows/track-flashinfer-main.ymlas the 15-minute job that advancesuv.lockon main; no such workflow exists at head (.github/workflows/contains only helios-lifecycle.yml, native-serving.yml, python-cpu.yml, release.yml). It was added in 2925c555 (2026-11-20) and removed in 17bb3c4a (2026-11-22, "Remove extracted hyperflare_recipes, qualification drivers, and model tests from core Flare").
Consequences for this PR: (a) "update the pin" is already satisfied automatically once FlashInfer main carries #208 — anyone who runs uv sync gets it, which also means the PR body's merge-order requirement is not enforced by any file in the repo; (b) the charter line "pin dependencies to exact versions or commits (#215)" (charter, How We Work) is in tension with the current branch-tracking setup, and #215 itself was closed by yatesdr on 2026-11-19 with "Flare keeps the exact FlashInfer pin (pyproject.toml:25)"; commit 10467f1a ("Track FlashInfer main in pyproject.toml", 2026-11-20, Luke Alonso) is the change that moved the other way. That history is context a reviewer of this dependency-requiring PR needs.
#4 [high] Claims/evidence: node-count claim has no CI coverage; GPU test that would prove it is skipped
- PR adds no test files (diff touches only the two modules).
- The property this change depends on is already asserted by
test_native_flashinfer_rng_is_invariant_to_capacity_packing_and_physical_slot(tests/components/test_sampling_flashinfer.py:183-205): rows 1/2/4, three (seed, counter) pairs, slot rotations, assertslen(set(sampled)) == 1. Whole module is gated onFLARE_RUN_CUDA_TESTS=1and an explicitly assignedCUDA_VISIBLE_DEVICES(test_sampling_flashinfer.py:28-31); its replay path needsPreparedGraphBundle.start_worker(), i.e. the nativequalificationCargo feature (ignition/preparation/graphs.py:95-116; heliopause/Cargo.toml:16). - The GPU CI job does not exist:
.github/workflows/python-cpu.yml:30-33runs.venv/bin/python -m pytest tests/ -qwithCUDA_VISIBLE_DEVICES: "". So every test that could catch a slot-dependent RNG regression silently skips in CI. The PR states it could not run this file at all ("tests/components/test_sampling_flashinfer.pywas not executed viaGraphReplayWorkerbecauseflare_heliopausein the local.venvlacks thequalificationCargo feature"). - Node-count measurement (192 → 1, "23 total graph nodes") is a direct
torch.cuda.CUDAGraph(keep_graph=True)probe in the PR description; not reproducible from the repo, and node counting helpers in tests exist only for exported cores (e.g. tests/preparation/test_recorded_export_graph_cuda.py:87-90, tests/preparation/test_inductor_tuning_cuda.py:155-165) not for a component graph. - CPU claim
pytest tests/components/ -q= 185 passed / 55 skipped is plausible but self-reported; cannot be re-run here. - Parity scope disclosed honestly: 7 of 64 slots (0,1,7,15,31,48,63) on one SM120 GPU, at C=64 / vocab=16384, against FlashInfer PR #208 — not against
main's FlashInfer, and not whole-model.
#5 [high] Related work: #658 shares the file, #673 shares the component family, #555 multiplies the graphs
- #658 (open, same author, lukealonso, opened 2026-12-01) also edits
ignition/components/sampling.py(+5/−1: registersDeviceRequestState.vocab_idswithrecord_numeric_tensor). Different hunk from this PR (sampling.py:125-131 vs 596-597), so textual conflict unlikely, but the two PRs are the only open work on the file and both are by the same author. - #673 (open, kbenkhaled, 2026-12-02) reworks
ignition/components/logprobs.py—PreparedLogprobs, the sibling component thatPreparedSampling.prepare()constructs (sampling.py:543-544) and that runs inside the same decode graph. Same "reduce per-width/per-row work and compile count" motivation, different file; no file overlap. Its Autobot review treatsPreparedLogprobsas "used byPreparedSamplingand external speculative recipes". - #555 (merged, voipmonitor, 2026-11-27) "feat(capacity): add intermediate batch capacities 6, 12, and 24" touched sampling.py and added 6/12/24 to
BATCH_CAPACITIES(ignition/components/capacity.py:13). That multiplies the number of prepared decode graphs per export, which is the multiplier that makes this PR's per-graph node saving matter: the loop cost was paid once per captured batch-capacity graph, andMAX_CONCURRENCY = 64(capacity.py:11) is the largest. - #479 (merged, voipmonitor, 2026-11-23) also touched sampling.py (static fused addend / gated gather work); last merged change to the file before this PR (commit e091689b, 2026-11-23).
- #658's Autobot review lists
ignition/components/sampling.pyas production code in a sibling PR; no competing or overlapping change to_filter_scores/ the sampling launch exists on main (items_touching returns only #684, #658, #555, #479 for sampling.py, and only #684 for flashinfer_sampling.py). - Precedent inside the repo:
verify_chainalready passesrow_independent_rng=Truetosampling.chain_speculative_samplingwith the comment "Each row draws from its own seed and offset only, so its tokens do not depend on its batch slot" (ignition/components/flashinfer_sampling.py:50-54, present onmain). This PR is the plain-sampler counterpart of a mechanism the repo already relies on for speculative verification;verify_chaincurrently has no in-tree caller. - Superseded/undone: nothing on main is reversed. The per-row loop dates from the original prepared-sampling work (file history: 805531de "Share FlashInfer sampling and request state across model recipes", 7f4a2aa0, ffae55ab in 2026-10-10, all Luke Alonso).
#8 [high] Project fit: no served-workload benchmark (charter #210) and an unmerged dependency against the pin rule (#215)
- Evidence requirement (direct tension): the charter's How We Work says "Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)". This PR states: "whole-modelflare runlatency was not measured in this PR" and "Full-model core export andflare runserving benchmarks were not run", and its own headline is a node-count reduction plus an "Expected serving effect". So the charter's stated bar for a perf PR is not met by the PR's own account. - Pin requirement (tension, pre-existing): charter "Be explicit and pin everything ... pin dependencies to exact versions or commits (#215)" and roadmap item "FlashInfer dependency fix (#215): Untangle the FlashInfer cross-dependency issue while keeping builds strictly pinned". The repo currently tracks FlashInfer
mainby branch (pyproject.toml:47), and this PR's correctness depends on an unmerged FlashInfer PR (#208). #215 was closed by yatesdr with "Flare keeps the exact FlashInfer pin"; the switch to branch tracking was Luke Alonso's 10467f1a (2026-11-20) after that close. - Placement (aligned): the change stays inside the two Helios-ABI runtime interface modules that AGENTS.md:388-396 and tests/preparation/test_core_boundary.py:11-25 keep in core
ignition(flashinfer_samplingandsamplingare both inRETAINED_IGNITION_COMPONENTS); no per-model branch, no flag exposed to users, no new recipe. AGENTS.md:402-409: "Flare is fully coupled to FlashInfer/b12x by design ... Prefer proven b12x operators and FlashInfer sampling over duplicate kernels" — using a FlashInfer out-variant is the aligned choice over writing a local kernel. - Documented intent (aligned but docs not updated): docs/mtp-design.md:486-490 already authorises replacing one-row calls with a request-keyed stream "unless a library API supplies an equally qualified request-keyed stream" — this PR is that case — while docs/core-design.md:1289-1294 still encodes "one-row draw" as the contract (see the undeclared-changes entry).
- Graph-boundary rule (aligned): AGENTS.md:420-425 forbids eager fallbacks and runtime allocation; the change moves work from 192 graph nodes to 1 and writes into preallocated scratch, so it reduces rather than adds boundary work.
- Not a new captured-graph op family: no protobuf, manifest, or graph-kind change (PR description; the diff is 2 Python files), so the AGENTS.md:376-381 approval rule is not triggered by a new contract.
#11 [high] Claims: docs/performance-work.md and core-design.md prescribe exactly the measurement this PR did not run
docs/performance-work.md:35-59 ("Measurement") specifies the project's own bar for this class of change and names the tooling:
- "Use
qualify.gpu_replayfor complete GPU graph duration, including vocabulary projection, collectives, and sampling even when a reference engine executes them outside its main graph." (docs/performance-work.md:37-39) - "Verify improvements through an exported core loaded by
flare run CORE --embedding-table-storage ram, including Helios's asynchronous row delivery." (docs/performance-work.md:45-47) - Also: "Host graph-launch traces alone cannot attribute GPU work" (:42-43) and "Record raw measurements with their configuration, rerun noisy comparisons" (:56-57).
The PR used neither
qualify.gpu_replaynorflare run, and explicitly reports thequalificationCargo feature was unavailable in its.venv— the documented measurement path was blocked locally. Notequalifyis now external: 17bb3c4a (2026-11-22) removed "qualification drivers" from core Flare and tests/preparation/test_core_boundary.py:56 forbidsqualifyimports, so the documented tool may not exist in this repo — a separate docs/reality gap. Also: docs/core-design.md:1276-1279 says "Measure sampler cost inside the complete graph before changing it" — the exact instruction this PR's own limitation (no whole-model measurement) leaves unfulfilled.
#6 [medium] Recent activity: nothing conflicting landed in ignition/components since the PR branched
- PR head branch is named
unify-b12x-moe-collective-and-recurr(read_item #684), unrelated to sampling; several of the author's PRs share that branch name (e.g. #658's isfix/ga10b-export-preparation), so the branch name carries no stacking information here. mainhas not moved on the two changed files since the PR branched: "Commits on the default branch since this pull request branched (2acc3f3), touching its changed files: none" (orientation packet);search_historyfor both files confirms the newest commit is 6991986a, the PR head itself.- Last commits on
ignition/componentsbefore this PR: 555db719 (2026-11-30, Luke Alonso, migrate runtime patches onto public b12x contracts, #648), 50c876df (2026-11-28, Ricky Brent, state_transfer tiles), 9031847a (2026-11-28, Luke Alonso), 7745deea (2026-11-28, Martin Vit, Engram lookahead #566), 4d957175 (2026-11-27, Luke Alonso, recipe collective wrappers), 74618652 (2026-11-27, Martin Vit), c9693765 (2026-11-27, Martin Vit, #555), 966df82e (2026-11-27, Martin Vit, #482). No recent sampling-specific work other than #555's capacity addition; this PR builds directly on the stable sampling path rather than reversing anything. - The
ignition/componentscommit split over 180 days: Luke Alonso 108, Martin Vit 58, jasonc 26 (orientation packet).
#7 [medium] People: author is a charter priority contributor and the sampling.py owner; no reviewers engaged
- Author:
lukealonso, COLLABORATOR, one of the three priority contributors named by the charter ("Priority contributors (@voipmonitor,@original-el8,@lukealonso) carry extra weight" — read_charter, Respect contributors / How We Work). 38 merged PRs and 4 open in the last 180 days; merged areas: helios/src (28), docs (23), ignition/preparation (12), flare-cli/src (10), heliopause/src (8). - AI caveat on the owner-approval rule: AGENTS.md:376-381 requires "prior explicit approval from project owner Luke Alonso lalonso@gmail.com" before "introducing a captured-graph operation family". Since the author is that owner, and because this PR adds no new Flare graph kind, protobuf field, or recipe, the rule looks satisfied by authorship; it does add a call to a FlashInfer op (
torch.ops.flashinfer.sampling_from_probs_out) newly enabled by FlashInfer #208, not a new Flare operation contract. - Who owns this code:
ignition/components/sampling.py's history is overwhelmingly Luke Alonso (Commits touching sampling.py: 6991986a, 4d957175, then earlier Luke Alonso commits such as bce032c0, 16bb710f, 2a65f7f3 (derek), ae8ae46b (Martin Vit), bf59b78f, dda1600f, 99cfcd5b, 794b0bb4, 805531de, 7f4a2aa0, ffae55ab). Martin Vit and Jason Cook have also landed sampling changes (#555 capacities, 5e356e63 #208 DeepSeek top-p, 2a65f7f3 logprobs). - Reviewers of record in this area:
yatesdr(maintainer; closed #215 and #210, sets dependency and performance policy),original-el8(triage labels, dependency compatibility analysis),flare-autobot(runs case files and reviews on most PRs — note #658 and #673 both received Autobot case files/reviews within minutes of opening; #684 has none). - Engagement so far on this PR: zero comments, zero reviews, no labels, no CI checks (read_item #684 Discussion (0); orientation packet: "Reviews: none yet", "CI on the head commit: no checks").
#9 [medium] Reach and compatibility: shared sampler for every recipe, no ABI change, SM120-only evidence
- Declared reach: "No Helios runtime, Protobuf, core wire format, or CLI changes. Existing prepared model cores continue to load and serve unchanged." Consistent with the diff (2 Python files, no protobuf/graph-kind change). Exported cores embed their own captured graphs and cubins, so no ABI bump and no re-export is forced.
- Who is affected at serve time: every request on every newly exported core, since
PreparedSamplingis the shared decode sampler for all recipes (docs/core-design.md:537 listssampling.pyas the sampling component;PreparedSamplingis imported only from tests and used by recipes outside this repo —hyperflare_recipesper AGENTS.md:382-396). The change is path-shared, not model-specific: no per-model flag exists to turn it off. - Two execution paths both switch at once: the captured graph path (
__call__, sampling.py:599-607) and the dynamic functional path (run, sampling.py:656-674, used byfunctional(dynamic_inputs=True)/ AOT compilation). Anything downstream that counted on 64 separate launches (e.g. streams/events around sampler calls) is not visible in-tree. - Hardware: measured only on SM120 (RTX PRO 6000 Blackwell). Charter-supported targets are SM103, SM120 and SM121 (charter Goals; roadmap). Nothing here is GPU-arch-specific in principle (one kernel launch over the row grid), but no SM103/SM121 evidence exists.
- Configuration/defaults: unchanged;
MAX_CONCURRENCY = 64(ignition/components/capacity.py:11) andBATCH_CAPACITIES = (1,2,4,6,8,12,16,24,32,64)(capacity.py:13) mean the benefit scales with exported batch capacity — every graph in the catalog gets the smaller node count, most at small batches where the loop's fixed cost dominated. - Documentation that should have moved and did not: sampling.py:459-473 docstring, docs/core-design.md:1289-1294 (see the undeclared-changes entry). No operator-facing docs, no CLI help, no manifest field changes.
- Community/discord: description ends "Discord: lukealonso", which per AGENTS.md/docs/design-review.md is the required attribution line.
#10 [medium] Process: open/ready, no CI checks, no review, no Autobot case file, ungated merge-order dependency
- State: open, "ready for review" per the orientation packet (no draft flag), opened and last updated 2026-12-02 16:51 (read_item #684: single timestamp, so no edits since opening; updated == opened). Age at intake: under a day. Labels: none. Reviews: none. Comments: none.
- CI: "CI on the head commit: no checks" (orientation packet).
.github/workflows/python-cpu.ymltriggers onpull_requestwith no path filter and would runpytest tests/withCUDA_VISIBLE_DEVICES: ""(python-cpu.yml:1-33);native-serving.ymlandhelios-lifecycle.ymlalso exist. Whether the absence of checks is a queue delay or the workflows do not run for this head is not determinable from the local copy — but no Autobot case file was created either, whereas #658 and #673 both got a "case file opened" comment within minutes of opening (read_item #658, #673). Worth flagging to whoever watches process. - PR description completeness vs the charter's four parts ("why the change is needed, what changed, the claimed result, and the evidence backing it"): all four are present, plus explicit limitations — that is better than most; the gap is that the "claimed result" is a component node count, not a served-workload speedup.
- Self-reported dependency ordering ("Merge local-inference-lab/flashinfer#208 and update the FlashInfer pin before merging this PR") is a merge-sequence risk with no automated gate in the repo (see the dependency entry): if this lands while FlashInfer main lacks
row_independent_rng/sampling_from_probs_out, everypytest tests/run and every export that touches sampling fails at import/call time, including onmainafter merge. - Description does not mention the stale docstring/design docs (see entry 2) nor that
sample_probabilitiesbecomes dead code.
#12 [medium] Coverage: verdicts on every lead in the orientation packet
Followed every lead in the orientation packet:
- #658 (open, same author, sampling.py): RELEVANT — same file, different hunk (
DeviceRequestState.vocab_idsnumeric registration). Entry 5. - #404 (closed; name match on sampling.py): not relevant — per-request activation steering in recipes/server, no decode-sampler overlap.
- #116 (open issue;
return_validmatch): not relevant — GB10 KV-page/NaN serving issue; mentions sampling only as config detail. - #683, #668, #659 (open, same author): unrelated areas (CLI prog/image specs, multi-host selection, null continuation row aliasing).
- #576, #673, #645, #643, #644, #128, #102, #564, #559: only #673 relevant (sibling
PreparedLogprobs, entry 5). #645/#644/#643/#564/#559 are Helios scheduling/collective work; #102 changes finish-reason/EOS classification onsampled_tokensconsumption, not the launch; #128 closed collective-startup measurement PR. - Charter roadmap line 55 (FlashInfer dependency fix #215) and AGENTS.md operator rules: entry 8.
local-inference-lab/flashinfer#208: external, not in this repo's local copy; content known only from the PR description (addsrow_independent_rngtoSamplingFromProbKernel/SamplingFromProb/sampling_from_probs_out). Verified in-repo that no in-tree code provides that op:flashinfer_sampling.py:45-47callstorch.ops.flashinfer.sampling_from_probs_outdirectly and its schema lives in FlashInfer. Whether #208 is merged upstream cannot be checked from here.- Also checked and found nothing: a GitHub workflow that runs GPU tests (
FLARE_RUN_CUDA_TESTSappears in no workflow file); auv.lockin the tree (absent);qualify/qualificationdrivers in-tree (externally extracted).