Repository navigation
Conversation
gemm_iq2xxs decodes the file's 66-byte super-blocks through the IQ2_XXS grid and the computed signs, keeps 2s + 1 an integer factor of the block sum and scales by d/8 in the epilogue. gate_gemm runs a routed top-9 stack and a ragged odd-super-block slab under the four routings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
midagedev
force-pushed
the
bolt-prefill-g1
branch
from
October 16, 2026 11:35
017a4d6 to
b9ea337
Compare
The JIT scan (gate-ptx-spill on the 3090, sm_86) was red on exactly this entry in both bins before the rows: spill=0 jit_local=0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nemotron_h_moe::PASS_ROWS and GpuModel<Body>::prefill / prefill_with, the surface the batched pass fills in; today each pass runs its ids as steps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pass embeds its ids, runs each Mamba-2 layer as one scan over its rows, appends the attention K/V rows and runs the group-16 flash in runs of MAX_PASS_ROWS, routes the MoE rows in two launches and runs the routed and shared experts as one _sel launch over the pass's slots. Projections run their family's multi-column gemv in runs of 8 rows. Each MoE layer's results are the pass's last row's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Several ids run GpuModel::prefill, one id a step, the Nano's split; the serve gate's Bolt head feed is the same call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
--prefill auto (the default) and gemm run NemotronHMoeModel::prefill, pass and step the step chain, the nemotron_h paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The latent pair and the attention projections run gemm32 on the rows' q8 blocks of 32 over the pass's one-expert table, filled once a pass; up to 8 rows they keep the multi-column gemv. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each NVFP4 projection gets a Q8_0 twin at load (its rows decoded times the tensor scale, coded per 32 as quantize_row_q8_0), which a pass past 8 rows runs as one gemm32 on the rows' q8 blocks of 32. The routed and shared experts take the grouped GEMM where the build has an IQ2_XXS entry, else their _sel launches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
prefill_near_mainlines and prefill_then_step_near_mainlines, each a fixture-oracle clause and a real-tier one: every prompt through prefill, alone and before its last id as a step, keeps the cosine floor against mainline's logits, the step path's distance printed beside. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…triage; cargo fmt Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pass past 8 rows runs an NVFP4 site as a GEMM over its Q8_0 twin when the twins were derived, otherwise as the multi-column gemv runs. The twins are planned only when the card's room after the body's load holds every twin and a 2 GiB margin, so a card the twins do not fit (the 3090's 24 GB) loads where main loads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
midagedev
force-pushed
the
bolt-prefill-g1
branch
from
October 16, 2026 11:47
30ce3f3 to
1986367
Compare
midagedev
added a commit
that referenced
this pull request
Oct 16, 2026
Baseline cards for the engine's g1c head (rebased onto #327 dd369dc + the split): the derived P=512 row over g1b's measured rates, the per-row gqa_flash_seg launch term (0.90 s A6000 / 1.06 s 3090 at P=4096, nsys s1733/s1734) replaced by 48 enqueues a pass-layer. Co-Authored-By: Claude Code <[email protected]>
midagedev
added a commit
that referenced
this pull request
Oct 16, 2026
Baseline cards for the engine's g1c head (rebased onto #327 dd369dc + the split): the derived P=512 row over g1b's measured rates, the per-row gqa_flash_seg launch term (0.90 s A6000 / 1.06 s 3090 at P=4096, nsys s1733/s1734) replaced by 48 enqueues a pass-layer. Co-Authored-By: Claude Code <[email protected]>
midagedev
added a commit
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 16, 2026
Closed
midagedev
added a commit
that referenced
this pull request
Oct 16, 2026
Baseline cards for the engine's g1c head (rebased onto #327 dd369dc + the split): the derived P=512 row over g1b's measured rates, the per-row gqa_flash_seg launch term (0.90 s A6000 / 1.06 s 3090 at P=4096, nsys s1733/s1734) replaced by 48 enqueues a pass-layer. Co-Authored-By: Claude Code <[email protected]>
midagedev
added a commit
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 16, 2026
This was referenced Oct 17, 2026
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bolt (nemotron_h_moe) batched prefill
Before this change, Bolt ran its prompt as decode steps, about 81 tok/s on the A6000. Now a prompt runs as layer-major passes of up to 448 ids:
enqueue_stepsscan over the pass's rows, bit for bit the steps' scan.MAX_PASS_ROWS.9·mslots;mslots;_sel.gate_nemotron_serveandgenerate_qwen3moe(--prefill auto) now run Bolt prompts throughprefill.gate_nemotron_h_moe_e2egainsprefill_near_mainlines(_real)andprefill_then_step_near_mainlines(_real).Change class: float sum order / precision. A pass past 8 rows reads q8 blocks of 32 at its Q8_0 and NVFP4 sites, so it is held to mainline (cosine floor), not to the step path's bits.
Stacked on #327 (the grouped GEMM's IQ2_XXS entry,
d63973f5): this branch isbolt-prefill(39fff4df) rebased onto it. Without #327, the experts take_sel.GPU Evidence
All runs go through the box queue (
tools/box.sh,BLOOMERY_BOX_QUEUE=1).Real Bolt, A6000. Command:
generate_qwen3moe --prompt <729 ids> -n 24 --prefill step|auto(--prefill autois the default).load arch=nemotron_h_moe resident_bytes=27414672948 ctx=4096 slots=1 layers=88 graph_nodes=1084 in 8.8 s. The plan isrows:448 x2, and the tokens equal the step arm's:[1010, 1784, 6330, 1307, 1278, 16194, 37691, 19570, 1454, 1278, 34059, 2274, 24806, 4837, 2246, 28462, 1044, 7654, 19797, 2455, 1321, 95254, 1455, 9523]._selexperts): the same load line, the same 24 ids.Fixture tier at 177f5ae (before the GEMM arms;
just gate-gpu-nemotron-h-moe-e2eand-serve,BLOOMERY_TIER=fixture):gate_nemotron_h_moe_e2ePASSED, with 8 clauses run and 3 left to the real tier.gate_nemotron_servePASSED, with the seat running the batched prefill.Real-tier
gate_nemotron_h_moe_e2eat 39fff4d, the tree under this PR with_selexperts (A6000): rc 1, one clause red.prefill_near_mainlines_real, 10 of 10 prompts, e.g.prose512 … cosine 0.999992,code4096 … cosine 0.999937,prose64 … cosine 0.999875 (floor 0.999).prefill_then_step_near_mainlines_real, 9 of 10. The red prompt:prose64 64 tokens, argmax 2082 mainline 2082 step 2082, cosine 0.997937 (floor 0.999), max |delta| 2.5779; the step path's cosine 0.999401, max |delta| 0.6988 FAIL.cosine 0.999993.The real tier now takes 806 s, past 0.75× of the 900 s bound.Corrected: the binary ran 131 s (gpu-gate.sh: gate_nemotron_h_moe_e2e ran 131 s (exit 1)). The 806 s is the item's wall time, box queue wait and build included.gate-batch's budget check reads that wall time, so it refused a rerun without--over-budget-ok.Real-tier
gate_nemotron_h_moe_e2eon f706328, this PR's head with gpu: the grouped GEMM takes IQ2_XXS stacks (Bolt prefill experts) #327's grouped experts (A6000): PASSED, rc 0.clauses: 10 ran, 0 left to the real tier;gpu-gate.sh: gate_nemotron_h_moe_e2e ran 105 s (exit 0).prefill_near_mainlines_real: 10 of 10 prompts gated PASS, with prose64 atcosine 0.999920.prefill_then_step_near_mainlines_real: 9 of 10 prompts gated PASS; prose1 has no pass before its step.Per prompt, cosine on this path / on the step path:
prose64 clears the floor once the experts change their sum order: 0.997937 with
_selat 39fff4d, 0.999466 here. That fits the near-tie explanation, but the diagnostic run is what shows it.Real-tier
gate_nemotron_h_moe_e2eat the head 1986367 (room-gated twins, restacked on gpu: the grouped GEMM takes IQ2_XXS stacks (Bolt prefill experts) #327 c0d5fb3):clauses: 10 ran, 0 left to the real tier;gpu-gate.sh: gate_nemotron_h_moe_e2e ran 107 s (exit 0).cosine 0.999920on the prefill path,0.999466with a step after. These are f706328's lines, unchanged.resident_bytes=22757815860, no twins, so the NVFP4 sites run the 8-column gemv): rc 1,ran 116 s (exit 1). Both prompt-path clauses are red on one prompt, prose64:prefill_near_mainlines_real: prose64 … cosine 0.998342 (floor 0.999), max |delta| 2.7192 … FAIL;prefill_then_step_near_mainlines_real: prose64 … cosine 0.997558 (floor 0.999), max |delta| 2.6105 … FAIL.Fixture e2e at 39fff4d (
BLOOMERY_TIER=fixture, A6000):PASSED: gate_nemotron_h_moe_e2e,clauses: 10 ran, 5 left to the real tier.4 of 10 prompts gated PASS, e.g.prose512 … cosine 0.999569 (floor 0.999) … PASS.cosine 0.819054where the step path gives0.999514. It is the same prompt that is red on the real tier, so the queued diagnostic run covers it too.FAIL-first mutant at 39fff4d, fixture tier: one line in
prefill.rsmakes the head read the pass's row 0,(m - 1) * sh.hidden * f→0 * sh.hidden * f. Result:red=1.prefill_near_mainlinesgoes red:4 of 10 prompts gated FAIL, e.g.prose512 … cosine 0.113264 (floor 0.999) … FAIL, with the gated cosines 0.06–0.11.prefill_then_step_near_mainlinesstays green, as expected: its last row runs as a step, which never reads the pass's head row.Speed at the head 1986367 (perf; one lease per card, 2 rounds; llama.cpp
-ngl 99 -fa on -ub 512in the same lease):Speed: perf's same-lease A/B (box job s1700, A6000, one lease, card
bolt-e1-pp-a6000, 2 rounds, 0 FAIL rows; the numbers are as perf reported them)._selexperts)_selexpert cost, which is larger than derived. Removing it accounts for most of the 2.8× from 39fff4d to f706328.Not in this PR yet (the release line: pp ≥ llama.cpp on both cards, offload measured)
--n-cpu-moeequivalent). Its design is inbolt-host-tier-boundary.md. B1 (the 9-slot handoff and the card-only combine) is running; then B2 (placement), H1 (the host's relu² union) and B3 (the body).prefill_edges: a clause across pass boundaries (models' GLM round).Not in this PR
glm-m2lanes).🤖 Generated with Claude Code