Skip to content

gpu: on an integrated device, a decode gemv warp asks L2 for its whole row before the walk - #27

Merged
midagedev merged 15 commits into
midagedev:mainfrom
juliankang4:dgx-spark-prefetch
Oct 11, 2026
Merged

midagedev merged 15 commits into
midagedev:mainfrom
juliankang4:dgx-spark-prefetch

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

The L2 row prefetch from #17 (#17 (comment)), as its own pull
request, now only on an integrated device (your option 1 after the A6000 A/B), and with a second entry per kernel so a
card with its own memory runs main's PTX. Part of #13.

A decode gemv warp walks its weight row with few loads in flight per lane: the walk's addresses are known in advance,
but each term feeds the next add. On a GB10 the gemv kernels read at 177.5 GB/s against 235.6 GB/s for a plain read of
the same memory (the section 2 reading on #13), so I read the step as waiting on DRAM latency more than on bandwidth.
With this change, each lane of the warp first issues prefetch.global.L2 for one 128-byte line of the row per pass,
starting at the line that holds the row's first byte. The whole row is requested before the walk, and the walk's loads
hit L2. The prefetch is a hint. It reads nothing into registers and changes no value.

Each kernel that walks a decode row gains a _prefetch entry that does this:

  • q4k_gemv and q6k_gemv (lib.rs), q4k_gemv_sel and q6k_gemv_sel;
  • qwen3moe_qkv_q4k, qwen3moe_o_resid_q4k and qwen3moe_head_q6k_argmax;
  • qwen3moe_gate_up_swiglu_q4k, for its gate row and its up row;
  • the four router-norm kernels (qwen3moe_router_norm, qwen3moe_router_norm_m, qwen35moe_router_norm,
    qwen35moe_router_norm_m): warp 0 asks for the block's f32 row on the first token, and the row loads into L2 while
    the norm runs.

gpu::row_prefetch reads CU_DEVICE_ATTRIBUTE_INTEGRATED once when the model loads (beside raw_device_integrated,
which the room on an integrated device already reads). Gpu and each qwen3moe kernel set keep it as row_prefetch,
and each launch of those kernels picks the _prefetch entry when it is set and the plain entry when it is not. The
GB10 reports 1; a card with its own memory reports 0 and launches only the plain entries, which are main's:
tools/ptx-scan.sh --no-jit generate_qwen3moe prints the same md5 as main for all 217 of main's entries, and the 12
_prefetch entries besides. Gpu::row_prefetch gives the same fact to the gates that compare a captured launch order
by name (hw_nodes_name_each_kernel_in_enqueue_order in graph.rs, and the V4.1 step and skew gates' shadow tables in
ds41_shadow.rs), so they expect the entry the device launches.

How the two entries share their body:

  • q4k_gemv, q6k_gemv and qwen3moe_o_resid_q4k call one #[inline(always)] walk over a const PREFETCH: bool;
    gate_up_row and norm_row_body take the same const. Both entries compute their row and call the walk.
  • q4k_gemv_sel, q6k_gemv_sel, qwen3moe_qkv_q4k and qwen3moe_head_q6k_argmax keep main's entry as it is, and
    the _prefetch entry is a copy of its body with the one prefetch call. Sharing those bodies through the same inline
    walk changed the plain entry's PTX (a block order, an or that became an add), so the md5 did not hold. Each of
    the four plain entries gains one doc line that names its copy.

The common Q4_K and Q6_K entries have callers outside qwen3moe too: enqueue_gemv_q4k in
crates/gpu-deepseek41/src/dense.rs, enqueue_gemv_q6k in crates/gpu-deepseek41/src/draft/head.rs and
enqueue_gemv_q4k_sel in crates/gpu-glm5next/src/tier.rs. They launch through Gpu, so on an integrated device
those paths get the prefetch as well. I timed only the Qwen3.6 step.

On two DGX Sparks, in one lease each against main at stock clocks (docs/contrib/dgx-spark.md section 3.5),
Qwen3.6-35B-A3B Q4_K_M decodes 16.2 % and 16.7 % faster at depth 6, 16.6 % and 16.8 % at depth 512, and 16.3 % and
16.1 % at depth 4096. Every arm generates the same ids. Prefill at P = 512 and 4096 does not move. The tables are
under "What I ran".

Other row walks do not prefetch yet: the Q3_K, IQ and Q5_1 gemvs, the DeepSeek and GLM crates' own kernels, and the
m-column entries (q4k_gemv_mcol, qwen3moe_qkv_q4k_mcol, qwen3moe_o_resid_q4k_mcol) that this model's dense Q4_K
projections take for a prompt of more than one token. I measured only the Qwen3.6 decode step, so I left them as they
are.

There are two commits. The first moves global_addr (the cvta.to.global.u64 conversion) from linear/delta.rs into
cores.rs, generic over the pointee and otherwise unchanged, so the prefetch can share it. The second adds the
prefetch, the _prefetch entries and the launch split.

Code shape

  • No second copy. Not fully (R14): four _prefetch entries are copies of their plain entry's body
    (q4k_gemv_sel, q6k_gemv_sel, qwen3moe_qkv_q4k, qwen3moe_head_q6k_argmax). Each copy's doc line says it is
    a copy and why, and each plain entry's doc names its copy, so a change to one points at the other. No gate on a
    card with its own memory runs the copies; on an integrated device the owning gates run only them. Shared through
    an inline walk, those plain entries no longer matched main's md5. The other
    eight share their body through a const PREFETCH walk. The prefetch itself is one helper,
    cores::l2_prefetch, whose address conversion is cores::global_addr, lifted out of linear/delta.rs by the
    first commit. Each call site passes its row's byte range (144 bytes per Q4_K superblock, 210 per Q6_K, 4 per f32),
    the range its walk reads. The device fact has one reader, row_prefetch.
  • Model code holds only architecture facts. The qwen3moe kernels gain the same _prefetch entries and the
    same launch split. The pick is a device fact read at load, not a lever, and no model branches on it.
  • Dead code is gone.
  • No silent failure. The prefetch is a hint and changes no output. Its caller keeps the range inside w, and
    each call site's range is the row the kernel then walks.
  • Comments state what is true now.
  • No relaxed gate. tools/unsafe-ratchet.txt goes from gpu 1682 188 to gpu 1717 191 with a
    PIN(2026-10-11): line that counts each part: the prefetch hint (one block), the three walks (three unsafe fns)
    and their six calls, the four copies' blocks (2 + 6 + 1 + 10) and the gate-up and router-norm entries'
    (1 + 4 × 2), each with its SAFETY line. The _prefetch entries that take more than seven arguments carry the
    clippy::too_many_arguments allow that main's kernel entries use, with the same reason, and the lint count stays
    at the ratchet's 41. tools/ref/ptx-shapes.tsv gains a row for each _prefetch entry in generate_ds41 and
    gate_e2e; the values are under "What I ran".
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed: crates/gpu/src/linear/delta.rs:117 (global_addr), lifted to
crates/gpu/src/cores.rs:73 and shared by linear::delta and cores::l2_prefetch. Duplication added: the four
copied _prefetch bodies above.

What I ran

On a Mac with the pinned nightly, at this branch's head on main 6d2b1765:

just mac-static upstream/main
mac-static: fmt-check rc 0 in 4 s — rustfmt diff blocks: 0
mac-static: lint rc 0 in 27 s — mac-check: lint ^warning: 41 = the ratchet 41 in tools/lint-ratchet.txt; ...
mac-static: combos rc 0 in 50 s — mac-check: combos rc 0; 11 shapes run, 0 red, 33 skipped (scoped), in 50 s ...
mac-static: check-arch rc 0 in 8 s
mac-static: check-comments rc 0 in 8 s
mac-static: check-defaults rc 0 in 0 s
mac-static: check-levers rc 0 in 6 s
mac-static: check-loads rc 0 in 64 s
mac-static: check-recipes rc 0 in 477 s
mac-static: check-rustflags rc 0 in 0 s
mac-static: check-unsafe rc 0 in 1 s
mac-static: check-waits rc 0 in 0 s
mac-static: total 479 s, base upstream/main
mac-static: ok
just affected upstream/main --no-box
affected: 6d2b17656..(working tree) — 15 changed files, 99 of 145 gate-recipes selected, 0 of 7 weekly-recipes by a trigger

tools/ptx-scan.sh --no-jit generate_qwen3moe (sm_86, the dev container's ptxas), main against this branch: the md5
block holds the same 217 entries with the same md5 on both, and this branch adds exactly q4k_gemv_prefetch,
q4k_gemv_sel_prefetch, q6k_gemv_prefetch, q6k_gemv_sel_prefetch, qwen3moe_qkv_q4k_prefetch,
qwen3moe_o_resid_q4k_prefetch, qwen3moe_head_q6k_argmax_prefetch, qwen3moe_gate_up_swiglu_q4k_prefetch,
qwen3moe_router_norm_prefetch, qwen3moe_router_norm_m_prefetch, qwen35moe_router_norm_prefetch and
qwen35moe_router_norm_m_prefetch. The main side here was main plus the two runner commits section 3.5 needs on a Spark
(#38 and #39), which change no kernel source: their only file under crates/ is the lever registry. To reproduce: build
generate_qwen3moe at main and at this branch, run the scan on each, and diff the lines after ptx-scan-md5:.

tools/ref/ptx-shapes.tsv gains a row for each _prefetch entry in generate_ds41 and gate_e2e. I scanned both
binaries on main and on this branch with tools/ptx-scan.sh (sm_86, ptxas 13.3.73, with the driver JIT) on a DGX Spark:

  • spill (ptxas) reads 0 for all 12 entries in both binaries, as their plain entries do. On main the column equals the
    table in all 285 and 217 rows, and every main entry reads the same spill, registers and jit_local on this branch.
  • jit_local is your 3090's JIT, which I cannot run. The GB10's JIT reads 0 for all 12. On main the GB10's JIT differs
    from the table in 13 rows of generate_ds41 and 8 of gate_e2e, always above it (for example q4k_gemv_tiles 184
    against 0), so it does not stand in for the 3090. I pinned the 12 rows at 0 like their plain entries. just gate-ptx-spill on your box is the check; a row that reads otherwise there takes your number.

I measured on main 2ce989d7 with those two runner commits and ran mac-static on 6d2b1765, then rebased the two
commits onto 0c8397db unchanged. The four upstream commits since 2ce989d7 add the remote static-tier tool
(tools/mac-remote.sh with its recipe, docs and check-recipes.sh lines) and change crates/serve/; none touches a
file of this branch.

The box gates need your workstation. On one DGX Spark I ran the 42 selected gate recipes that have a fixture-tier
line, through tools/box.sh's local mode in the dev container, once on main and once on this branch:

  • The same exit code on all 42. 19 pass on both. 12 fail on both at the same error line: reference data or corpora this
    machine does not have (ref_qwen35moe, ref_qwen4exp, ref-synth, ref-mtp, ref-vision,
    glm5next/corpus-prose.ids), the Qwen3.6 file, which the fixture tier does not mount, and gate-gpu-qwen38-serve's
    --place gate, which asks for a 3090. 4 exit 64 on both: the two-card recipes, which local mode leaves to the box.
    7 exit 66 on both: the V4.1 fixture set here does not hold the DSpark fixture draft.
  • gate-gpu-lib passes on this branch (194 tests, then the 3 hw_held_ tests), with
    hw_nodes_name_each_kernel_in_enqueue_order expecting q4k_gemv_prefetch on the GB10. The V4.1 step gate, whose
    shadow table now takes the device fact, is one of the 7 that exit 66 here, so its structure clauses ran on neither
    side. On your box the device is not integrated, and the tables hold main's names.

The A/B on two DGX Sparks

tools/ref/depth-qwen3moe.sh through tools/box.sh's local mode on each Spark's host, in one lease with LC_ALL=C,
six rounds with the order rotated each round, n = 96. The arms were
6 bin:ab-m4:6 512 bin:ab-m4:512 4096 bin:ab-m4:4096 6@BLOOMERY_AB_LOAD=arm (each bin: arm names its binary's
path): "ours" is this branch on main 2ce989d7, bin:ab-m4 is main 2ce989d7, and the last arm is the machine's A/A
at depth 6. Each machine built both binaries in the dev container (CUDA 13.3.1, the pinned nightly), and both builds
came out the same: ours sha256 a7aed7cdad5d…, main 1861c79d7097….

Decode, tok/s @ n=96, GB10, Qwen3.6-35B-A3B Q4_K_M (Qwen3.6-35B-A3B-Q4_K_M.gguf, sha256 4ac6a06bce551257…). The
step column is the mean of the rows' mean step.

Machine Depth main this branch ours / main, 6 rounds (95 % interval) Step, ms
Spark A 6 84.54 98.20 1.1616 ± 0.0070 11.83 → 10.18
Spark A 512 84.41 98.45 1.1664 ± 0.0020 11.85 → 10.16
Spark A 4096 81.38 94.66 1.1631 ± 0.0085 12.29 → 10.56
Spark C 6 84.66 98.78 1.1668 ± 0.0022 11.81 → 10.12
Spark C 512 84.58 98.80 1.1681 ± 0.0012 11.82 → 10.12
Spark C 4096 81.44 94.55 1.1611 ± 0.0110 12.28 → 10.58

The runner's ratio lines, each cut after its per-round values (the busy and cold counts after them are 0 throughout):

Spark A
ratio d=6     ours/bin:ab-m4  mean 1.1616 ± 0.0070 (n=6)  of means 1.1616  per round: r1 1.1610 r2 1.1492 r3 1.1670 r4 1.1629 r5 1.1677 r6 1.1619
ratio d=6     ours/ours@BLOOMERY_AB_LOAD=arm  mean 0.9987 ± 0.0038 (n=6)  of means 0.9987  per round: r1 0.9991 r2 0.9915 r3 0.9995 r4 1.0003 r5 1.0011 r6 1.0005
ratio d=512   ours/bin:ab-m4  mean 1.1664 ± 0.0020 (n=6)  of means 1.1664  per round: r1 1.1648 r2 1.1665 r3 1.1646 r4 1.1652 r5 1.1682 r6 1.1690
ratio d=4096  ours/bin:ab-m4  mean 1.1631 ± 0.0085 (n=6)  of means 1.1631  per round: r1 1.1504 r2 1.1614 r3 1.1649 r4 1.1719 r5 1.1589 r6 1.1710
Spark C
ratio d=6     ours/bin:ab-m4  mean 1.1668 ± 0.0022 (n=6)  of means 1.1668  per round: r1 1.1661 r2 1.1635 r3 1.1662 r4 1.1675 r5 1.1684 r6 1.1695
ratio d=6     ours/ours@BLOOMERY_AB_LOAD=arm  mean 1.0022 ± 0.0047 (n=6)  of means 1.0022  per round: r1 1.0036 r2 0.9993 r3 0.9987 r4 0.9991 r5 1.0104 r6 1.0020
ratio d=512   ours/bin:ab-m4  mean 1.1681 ± 0.0012 (n=6)  of means 1.1681  per round: r1 1.1677 r2 1.1677 r3 1.1678 r4 1.1690 r5 1.1698 r6 1.1666
ratio d=4096  ours/bin:ab-m4  mean 1.1611 ± 0.0110 (n=6)  of means 1.1611  per round: r1 1.1479 r2 1.1722 r3 1.1607 r4 1.1508 r5 1.1733 r6 1.1618
  • The saving is about the same at every depth, 1.65 to 1.73 ms a step, which fits a saving in the row walks: attention
    grows with depth and the row walks do not.
  • The A/A arm reads 0.9987 ± 0.0038 and 1.0022 ± 0.0047, so the ruler holds inside each lease.
  • Prefill, tok/s(pp), ours / main: the 6-token prompt reads 1.0784 ± 0.0208 on Spark A and 1.0919 ± 0.0235 on
    Spark C; its pass runs the expert, router-norm, Q6_K and head row kernels this touches. The 512- and 4096-token
    prompts run the gemm path, which this does not touch, and read 1.0064 ± 0.0108 and 1.0022 ± 0.0048 on Spark A,
    1.0024 ± 0.0061 and 1.0001 ± 0.0070 on Spark C.
  • Ids: at each depth every row of every arm generated the same 96 ids (one token sequence per depth over its rows: 18
    at depth 6, 12 at 512 and 12 at 4096).
  • Witness, on each machine: 86 witness blocks and no Xid. The SM clock read 2411 to 2483 MHz (Spark A) and 2411 to
    2470 MHz (Spark C) around the arms (maximum 3003 MHz; 208 MHz on the idle card before the first arm), and the
    clock-event mask was 0 in all 86 blocks. MemAvailable stayed between 93.9 and 116.7 GiB, above the 21.2 GB model
    file. [cpu-busy] 0 of 42 rows, cold 0 of 42, failed arms 0. local-apps carries [timing-card-busy] on the 24
    "pre" witnesses of our own arms (ours and the A/A arm): that process is the arm itself, loaded and waiting under
    --arm-sync. No "post" witness has it.

The card predicted +14 to +18 % at depth 6 and the runs read +16.2 % and +16.7 %.

spark-prefetch-rebase.card (sha256 e6d3d4cf3adb…, as the lease printed it)
# The decode gemvs' L2 row prefetch as `_prefetch` twin entries, launched when the device reports integrated
# (gpu::row_prefetch, read once at load); a card with its own memory launches the plain entries, which are main's
# PTX (ptx-scan --no-jit md5 block equal to main's, plus the twelve twins). On a DGX Spark, A/B against main in one
# lease (docs/contrib/dgx-spark.md section 3.5, stock clocks): ours is main 2ce989d7 plus the global_addr move and the
# twins (40d556a6); bin:ab-m4 is main 2ce989d7. Both trees carry the single-card timing mode, which no kernel reads.
# Prediction [measured]: the twins on main 9873a363 read +16.5 and +17.0 % at depth 6 on two DGX Sparks
# (spark-prefetch-split); the rebase moves no gemv, only the router's top-k (in both arms): +14..+18 %.
kind: ab
question: how much faster is a decode step on a DGX Spark when the decode gemvs launch their L2 row prefetch twins
  than main?
term: ours / bin:ab-m4, the per-round ratio of tok/s @ n=96, depth 6, GB10 (the runner's ratio line),
  generate_qwen3moe on the qwen35moe Q4_K_M file
unit: %
predict: +14..+18
rounds: 6
condition: tools/box.sh's local mode on a DGX Spark's host (BLOOMERY_BOX_CARD=local, the lease under
  BLOOMERY_LOCK_DIR), one lease, six rounds, arms 6 bin:ab-m4:6 512 bin:ab-m4:512 4096 bin:ab-m4:4096
  6@BLOOMERY_AB_LOAD=arm (this machine's A/A at depth 6), the order rotated each round; the binaries built in the
  dev container; the witness shows no other compute process on the card, no Xid, and MemAvailable above the model
  file's size before every arm; no row [cpu-busy]; the generated ids of every arm identical at each depth (the
  prefetch is a hint and changes no value)
decide-in: the pull request carries this sitting's ratios at each depth, the A/A arm's ratio, the machine line and
  the witness summary
decide-below: the pull request carries the earlier sittings' numbers and this one's, and names the gap; read the
  gemvs in nsys before any further claim
decide-above: the pull request carries it as measured
The earlier sittings: this form on the previous main, one entry with the device fact as an argument, the prefetch without the device gate, and its first form

This form, on main 9873a363 before the rebase (card spark-prefetch-split, the same arms against that main), read
1.1654 ± 0.0054 (Spark A) and 1.1700 ± 0.0044 (Spark C) at depth 6, 1.1627 ± 0.0049 and 1.1666 ± 0.0034 at depth 512,
and 1.1610 ± 0.0058 and 1.1653 ± 0.0107 at depth 4096, with an A/A arm of 1.0007 ± 0.0030 and 1.0032 ± 0.0082. The
rebase brought in the router's top-k change (#35), which both arms carry.

The form before this one kept one entry per kernel and passed the device fact as a prefetch: u32 argument, with
l2_prefetch returning at once when it was 0. On the same two Sparks against main it read 1.1644 ± 0.0081 (Spark A)
and 1.1698 ± 0.0153 (Spark C) at depth 6, 1.1669 ± 0.0008 and 1.1657 ± 0.0087 at depth 512, and 1.1655 ± 0.0066 and
1.1599 ± 0.0114 at depth 4096, with an A/A arm of 0.9958 ± 0.0062 and 1.0016 ± 0.0065. This form reads the same within
those intervals. Its forced-off arm is the reason for the second entry; see "What I ran into".

Before the device gate the prefetch ran on every card. Against main in one lease each, on Spark A and on a second
machine, Spark B, it read 1.1649 ± 0.0079 and 1.1609 ± 0.0050 at depth 6, 1.1653 ± 0.0029 and 1.1588 ± 0.0032 at
depth 512, and 1.1635 ± 0.0044 and 1.1535 ± 0.0106 at depth 4096 (card spark-prefetch-final, predicted +14 to
+18 %), with an A/A arm of 0.9987 ± 0.0041 and 0.9990 ± 0.0060. That is the form your A6000 A/B read at 0.9570 ± 0.0006.

The form in the #17 probe issued its lines from the row's first byte, so a row that starts inside a line and reaches
past ceil(bytes / 128) lines left its last line to the walk. On Qwen3.6 that is a quarter of the Q6_K down rows
(K = 512, 420 bytes). That form read 1.1675 ± 0.0046 on Spark A and 1.1626 ± 0.0072 on Spark B at depth 6 against
main. The form in this pull request counts lines from the line that holds the row's first byte; against the first
form in one lease on Spark B, under a non-inferiority card (spark-prefetch-aligned, predicted 0 to +0.5 %):

ratio d=6     ours/bin:ab-pf  mean 0.9988 ± 0.0056 (n=6)  of means 0.9988  per round: r1 0.9972 r2 1.0096 r3 0.9967 r4 0.9964 r5 0.9963 r6 0.9963
ratio d=512   ours/bin:ab-pf  mean 0.9968 ± 0.0031 (n=6)  of means 0.9968  per round: r1 0.9981 r2 0.9911 r3 0.9965 r4 0.9993 r5 0.9970 r6 0.9987
ratio d=4096  ours/bin:ab-pf  mean 0.9974 ± 0.0041 (n=6)  of means 0.9974  per round: r1 0.9993 r2 0.9896 r3 1.0006 r4 0.9990 r5 0.9973 r6 0.9986
card: verdict: pass: the lower bound -0.684 % is above -1 %

The effect came out below the predicted band but inside the ruler: −0.13 % at depth 6, not resolved by six rounds. I
kept the aligned form because it asks for every line of the row, which is what the helper's contract says.

I did not commit the cards, because docs/ is yours.

What I ran into

One entry with a runtime flag did not keep main's code where the prefetch is off. The form before this one passed
the device fact as an argument and returned from l2_prefetch at once when it was 0. I expected a card with its own
memory to run main's walk plus one uniform compare per row walk. It did not: with the argument forced to 0, the Spark's
walk read 0.9899 ± 0.0065 (Spark A) and 0.9879 ± 0.0106 (Spark C) of main's at depth 6, per round in the same lease.
The prefetch loop sits in each kernel's code whether or not it runs, so the compiler allocates registers for it. From
tools/ptx-scan.sh (registers per thread, main to that form):

Entry GB10 JIT sm_86 ptxas blocks an SM at sm_86
q4k_gemv_sel 48 → 52 48 → 48 5 → 5
qwen3moe_qkv_q4k 58 → 64 64 → 64 4 → 4
qwen3moe_o_resid_q4k 59 → 48 48 → 64 5 → 4
qwen35moe_router_norm 48 → 42 47 → 47 5 → 5

#[launch_bounds(256, 5)] on qwen3moe_o_resid_q4k held ptxas at 48 registers but spilled 136 bytes, so I did not
take it. A second entry per kernel avoids the question, and the md5 block shows it with no timing.

Sharing the body through an inline function can still change the plain entry's PTX. My first two-entry form put
every kernel's body in an #[inline(always)] walk over a const PREFETCH: bool, called by both entries. The const
removes the prefetch from the plain entry, but the md5 of four plain entries still moved: q4k_gemv_sel,
q6k_gemv_sel, qwen3moe_qkv_q4k and qwen3moe_head_q6k_argmax. tools/ref/ptx-canon.py on the two scans showed
blocks in another order and an or that became an add in an address. I did not find a source form that kept those
four byte for byte, so their plain entries are main's text and the _prefetch entries are copies. If you would rather
have one body and accept a PTX change in those four, the inline walk is the other choice; it would then need the A6000
non-inferiority A/B that the md5 avoids here.

Two cuda-oxide limits shaped the code, in case they help the next kernel that needs two entries:
thread::index_1d and the other thread index helpers work only inside a #[kernel] or #[device] fn, so each entry
computes its row and passes it to the walk; and a generic #[device] fn compiles as #[inline(never)], so the walks
are plain #[inline(always)] fns, not #[device] ones.

Your nsys table also shows qwen35moe_router_norm 30 us faster with the prefetch on the A6000. A card with its own
memory runs the plain entry here too; a separate pull request can switch that one kernel, with your A/B.

Hardware

DGX Spark, two machines of the same build: NVIDIA GB10 (compute capability 12.1), driver 595.84 (nvidia-smi:
NVIDIA GB10, 595.84, CUDA Version 13.2), CPU Cortex-X925 and Cortex-A725 (20 cores), 128 GB unified memory, Ubuntu
24.04.5 LTS, kernel 6.17.0-1032-nvidia. The dev container has CUDA 13.3.1, LLVM 21.1.8 and the pinned nightly. The
kernels are sm_86 PTX through the driver's JIT (docs/contrib/dgx-spark.md section 5, answer 7). Clocks are stock:
maximum SM clock 3003 MHz, 2411 to 2483 MHz read around the arms, clock-event mask 0.

Docs

I did not change the docs. The spot this moves is docs/contrib/dgx-spark.md section 2, "our gemv kernels' own rate
is still unread" and the decision rule under it. By the whole-step reading on #13 (2061.4 MB a step over the step's
p50), main reads 175.4 and 175.3 GB/s in these leases and this branch 204.5 and 204.8 GB/s [derived: #13's byte count, not re-read on this build]. That is the whole step, not the gemv kernels' own rate the rule names, which I have
not re-read with ncu and nsys on this build.

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev The red contrib-check t0 on this PR comes from two self-tests that fail on main too, as far as I can tell. The run failed in check-recipes at tools/ref/lease.sh's trace-waiter-frees-lease (got [1], want [0]) and at the queue class test, which timed out (rc 124). Of the 18 PR check runs on main since 2026-10-10 17:38 UTC, 7 failed: 5 at trace-waiter-frees-lease and 2 at queue order, also rc 124.

On a DGX Spark, LC_ALL=C bash tools/ref/lease.sh --self-test failed this way once in 38 runs. My guess at the cause: lease_trace_take starts the waiter with (setsid bash -c ... 9>&- ... &). The child that bash forks for the background job keeps descriptor 9 until it applies 9>&-, just before it execs setsid, and the subshell around it exits without waiting for that. The test calls lease_free as soon as its own subshell exits, so the child can still hold the lease at that moment. Closing descriptor 9 in the subshell before the fork, (exec 9>&-; setsid ... &), would close that window. A copy with that change passed 30 of 30 runs, but so did the original in the same 30, so this proves nothing yet. I have not looked at the queue tests.

I can't rerun the workflow from here, so I'm leaving that with you.

@midagedev

Copy link
Copy Markdown
Owner

@juliankang4 Thank you for the diagnosis. The red contrib-check is ours, not this PR's. We take your fix for lease.sh (close descriptor 9 before the fork) and look at the queue tests too.

This PR is in our landing train now. The fixture gates are running, and the A6000 A/B (non-inferiority, 14 rounds) runs right after. We merge it here when both are green.

@midagedev

Copy link
Copy Markdown
Owner

@juliankang4 The A6000 A/B is in, and the prefetch loses there. Qwen3.6-35B-A3B Q4_K_M, depth 6, 14 interleaved rounds, one process per arm, same lease:

main this PR ratio
decode 203.58 tok/s 194.82 tok/s 0.9570 ± 0.0006
prompt (6 ids) 466.49 tok/s 437.55 tok/s 0.9380 ± 0.0010

Every round reads 0.955 to 0.959, so this is not noise. Our card predicted −0.5 to +2 %. It assumed a warp frees its lines as it walks, so about half a row per warp is in flight. That is the term that was wrong. Your L2-room concern looks right: the A6000 has 6 MB of L2.

So we cannot land it as it is. We land the rest of the train without it today. Two ways forward, your choice:

  1. Prefetch only where it pays. Read one device fact at load, for example the integrated (unified memory) attribute or L2 size against the rows in flight, and keep the A6000 on today's path.
  2. Bound the lines in flight per warp, so the in-flight bytes fit the L2 on both cards.

We will run nsys on both arms on the A6000 and post the per-kernel times here, so you can see which kernels lose. Thank you for the careful PR. The Spark gain is real, and we want it in.

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev Thank you for the A/B and the clear table. I'll take option 1.

The fact I'd read is CU_DEVICE_ATTRIBUTE_INTEGRATED. The engine already reads it at load for the room on an integrated device (raw_device_integrated in crates/gpu/src/lib.rs), and it matches where the gain comes from: on the GB10 the gemvs wait on DRAM latency, not on bandwidth. An L2 rule would turn the prefetch on for the A6000's smaller rows, and nothing says those gain there. Your prompt row lost more than decode, so I would rather not guess.

The plan for this branch:

  • read the attribute once when the model loads and pass it to the kernels that prefetch as one argument, so each kernel stays one source;
  • on a discrete card the argument is 0 and the walk is main's, apart from one uniform branch per row walk. That still needs your A6000 A/B, now as a non-inferiority one;
  • re-time on two DGX Sparks against main, with the same tables as now.

Option 2 could give the A6000 something too, but I can't time it there, and each try would cost you an A/B. If your nsys times show the loss only in gate_up_row and the head, I'll open that as a separate issue with the numbers.

@midagedev

Copy link
Copy Markdown
Owner

The per-kernel numbers I promised. Nsight Systems on the A6000, both builds, Qwen3.6-35B-A3B Q4_K_M, depth 6, mean of 6 decode replays.

The step goes from 4876 to 5079 us (+203 us, +4.2 %). The gaps between kernels do not move.

kernel base us PR us delta
qwen3moe_gate_up_swiglu_q4k 810.0 894.9 +84.8 (+10.5 %)
qwen3moe_qkv_q4k 759.3 803.3 +43.9 (+5.8 %)
q6k_gemv 355.6 389.3 +33.7 (+9.5 %)
qwen3moe_o_resid_q4k 388.9 421.1 +32.2 (+8.3 %)
qwen3moe_head_q6k_argmax 596.0 627.7 +31.6 (+5.3 %)
qwen35moe_router_norm 522.9 492.9 −30.0 (−5.7 %)

The rest move less than 5 us. The loss also shows on kernels whose rows in flight fit the 6 MB L2 (qkv at about 3 MB), so L2 room is not the whole cause. The router norm gains, and it is the one kernel with other work before its walk.

So your option 1 (prefetch only on an integrated device) fits these numbers. Thank you for the careful PR.

Also: we changed CONTRIBUTING today. A number from your own NVIDIA card now counts for your PR on that card, with the nvidia-smi line, both commits, the model file, and the commands with output.

@juliankang4 juliankang4 changed the title gpu: a decode gemv warp asks L2 for its whole row before the walk gpu: on an integrated device, a decode gemv warp asks L2 for its whole row before the walk Oct 11, 2026
@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev Thank you for the nsys table. I pushed option 1: the prefetch now runs only when CU_DEVICE_ATTRIBUTE_INTEGRATED is set, read at load and passed to each prefetching kernel as one argument. On two DGX Sparks against main it reads 1.1644 ± 0.0081 and 1.1698 ± 0.0153 at depth 6, and 1.1655 ± 0.0066 and 1.1599 ± 0.0114 at depth 4096, the same ids in every arm. I updated the description with the tables.

One thing to know before your A6000 A/B: with the argument at 0 the kernels are not main's. The prefetch code moves register allocation even where it does not run (sm_86 ptxas: qwen3moe_o_resid_q4k 48 to 64 registers, five blocks an SM to four), and on the Spark the forced-off walk reads 0.9899 ± 0.0065 and 0.9879 ± 0.0106 of main's. If your non-inferiority A/B misses, I can give each prefetching kernel a second entry without the prefetch, so that a card with its own memory can run main's PTX, which ptx-scan's md5 column can show with no timing. The description has the details under "What I ran into".

Your table also shows qwen35moe_router_norm 30 us faster with the prefetch on the A6000. This branch turns that off there too.

@midagedev

Copy link
Copy Markdown
Owner

Thank you. Yes, please add the second entry without the prefetch. Then a card with its own memory runs main's PTX, and ptx-scan's md5 column proves it with no timing run, so this PR needs no A6000 A/B. The router_norm gain on the A6000 can be a separate small PR later, with our A/B.

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev Done: each prefetching kernel now has a _prefetch entry, and the host picks it at launch from CU_DEVICE_ATTRIBUTE_INTEGRATED. A card with its own memory launches only the plain entries. tools/ptx-scan.sh --no-jit generate_qwen3moe gives the same md5 as main for all 217 of main's entries, and adds the 12 _prefetch entries. So the A6000 runs main's PTX, and this needs no A6000 A/B.

Four of the twelve are copies of their plain entry's body: q4k_gemv_sel, q6k_gemv_sel, qwen3moe_qkv_q4k and qwen3moe_head_q6k_argmax. I first put each body in an #[inline(always)] walk over a const PREFETCH: bool for both entries to call. That works for the other eight. For these four, the plain entry's PTX still moved (blocks in another order, an or that became an add), so their plain entries are main's text, and each copy says why in its doc line. If you prefer one body and a PTX change in those four, that is the other choice, but then it needs your A6000 A/B again.

On the same two DGX Sparks against main 2ce989d7, in one lease each: 1.1616 ± 0.0070 and 1.1668 ± 0.0022 at depth 6, and 1.1631 ± 0.0085 and 1.1611 ± 0.0110 at depth 4096, with the same ids in every arm. That matches the one-entry form. I rebased onto 0c8397db and updated the description: the md5 result, the new tables, and under "What I ran into", what made the four copies necessary.

Agreed on the A6000 router_norm gain as a separate PR later.

@midagedev

Copy link
Copy Markdown
Owner

Thank you. I am checking af9c455 now: our own ptx-scan of generate_ds41 and gate_e2e against main, and the new ptx-shapes rows. If both hold, it goes into the next landing train. Keeping the four plain bodies as main's text is the right choice.

midagedev and others added 15 commits October 11, 2026 21:39
… and decision share one expansion

serve::media::expand_spans (each placeholder run of the prompt ids expanded to its image's
token count, a placeholder carried in text refused by name) moves with Expanded and ExpandError
to crates/vision/src/media.rs, the model-generic owner beside MediaModel, so the decision crate
can call it without a serve dependency. serve calls it and maps ExpandError into MediaError.
A move: serve's gates unchanged and green.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… as the release does (vision R4c-b)

- request: images in llama.cpp's order (the request's `images`, then the state's image_url
  parts), each a data URL, at most 8; the state comes back without those parts. videos stays
  501, a non-data URL and a ninth image stay 400. The request is valid with images; encode and
  the label model refuse them by name (NotSupported, llama.cpp's hint), so today's seats answer
  as before.
- encode_media(tok, req, &dyn MediaModel, counts, max): the media piece is the placeholders and
  a "\n" tokenized in one call, each pad run expanded to its image's count through
  vision::media::expand_spans; Encoded.image_spans names them; fixed counts the media ids; a
  placeholder in text and media ids past the context are refused by name.
- gate-decision-clef: hw_clef_image_ids_equal_the_release — every set D request's input_ids equal
  the release's, list for list (6 of 6). Set D (images.jsonl) states no identity, so this clause
  reads it raw beside the same run's reference.jsonl (its revision equals clefvis.sh's, its ids
  equal) — a substitute for a family check until the writer states one.
FAIL-first: D3 (no "\n" after the last image) red on the box at c1 234, c2 1108, c3 234, i640
338, i1024 806; D1 and D2 red in host tests (set D has no state image part to catch them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ile, from the listing or the verified cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eat flags and projector, the encoder reserve in the whole-fit verdict (qwen35_open::open_seated), Body35's media hidden call, the image refusals by name

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s with the encoder, 501 with llama.cpp's hint without it, the image 400s, the --hf projector pick

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… open_tower open a seat's projector and tower for any serve seat, merged_cells and Flags::wanted beside them (span_rows loses its rows_of parameter); image_plan holds the plan's side of an image input free of the encoder crates (the tower's reserve on the stage card, the refusal that names it, the rotation table's bytes per position) so every build's placement can take it; ds41's seat opens through them

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd prefill_media in serve_seats/qwen3, the tower's reserve and the rotation tables in qwen3moe's placed plan and whole fit (each named in the ctx and whole-fit lines), the &VISION record; gate_qwen3_serve's --images clauses: set E prompt ids, set F chat inside the CUDA/CPU agreeing prefix with a first divergence only at a near tie (PIN F_NEAR_TIE 0.1), an image slot beside a text slot, the refusals and the plan's reserve, each FAIL-first by its own mutant

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ion_seat::open_seat takes the file the seat resolved (the decide seat's --hf pick), open_tower, merged_cells; the whole-fit line's encoder note has one owner, image_plan::note

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the gates that reach it, the Qwen3.6 image clause's plan budget has its defaults twin, rustfmt

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…is tree on a contributor's machine with a card of its own

- docs/contrib/local-check.md rows 1, 3, 4, 5 and 7. No ssh and no rsync: bash runs the same command line in this tree,
  guard and profile and exports included. The environment file is BLOOMERY_ENV_FILE (default ~/bloomery-env.sh; missing: 69).
  Refused (64) on a host that is not Linux, with BLOOMERY_BOX_QUEUE=1, and where /root/bloomery-cpu.lock exists.
- BLOOMERY_LOCK_DIR (tools/ref/lease-probe.sh's LOCK_DIR, /root when unset) holds the timing lease, the holds, the gate
  locks, the V4.1 load lock and queue and the batch hold. Local mode defaults it to ~/.cache/bloomery/locks and makes it.
  It refuses (64) a relative path, which two trees would read apart, and /root however it is spelled, where its guard
  would make the box's lease file; an environment file or BLOOMERY_BOX_ENV that moves it after the guard is refused (64),
  and so is an environment file's BLOOMERY_ARCH other than the one the recipe expanded. lease-probe.sh's holds glob and
  give-way check and gpu-gate.sh's lock descriptors take the path whole, so a path with a space or a ; works.
- lease-probe.sh owns the box's mark: on_box (/root/bloomery-cpu.lock exists) and box_lock_dir (a directory that is
  /root). box.sh, gpu-gate.sh and lease_take read them.
- gpu-gate.sh: BLOOMERY_BOX_CARD=local takes one lock, bloomery-gate-local.lock, for what the machine shows, and leaves
  CUDA_VISIBLE_DEVICES as it finds it; its lock directory is never /root (64). `both` in BLOOMERY_CARD or
  BLOOMERY_GATE_CARD is refused (64); a held lease is waited for as the lock is. On the box, BLOOMERY_BOX_CARD=local and
  a BLOOMERY_LOCK_DIR other than /root are refused (64), as lease_take refuses another lease file there.
- CUDA_OXIDE_BACKEND is unset after the environment file (row 7), so cargo oxide builds and keeps its own backend (no
  rc 70 check). BLOOMERY_REMOTE adds no CARGO_BUILD_JOBS.
- The command runs without the variables box.sh reads on this side (BLOOMERY_MODEL above all: the model crate's tests read
  it as a model path), without box.sh's own outputs (BLOOMERY_REF_MODEL_PROFILE, the fixture tier's BLOOMERY_CARD_BUDGET
  and BLOOMERY_FIXTURE_MODEL) and without the lease's file names, as over ssh.
- box-gc.sh refuses (64) local mode: its root is then the contributor's tree, whose binaries are their own runs.
- Unset or 0 leaves the ssh, rsync and queue arguments box.sh builds byte-identical, direct and queued.
- card-tests: the local mode cases, the lock directory (two holds' give-way under a path with a space among them), the
  refusals, LOCAL=0 against unset, and on the box gpu-gate.sh's box refusals; the helpers drop the new variables a caller
  in local mode would pass. gpu-gate.sh --self-test: the local lock, the V4.1 load lock, a held lease.
FAIL-first: against main's box.sh, gpu-gate.sh, lease-probe.sh, lease.sh and box-gc.sh, 27 card tests are red. With
gpu-gate.sh's local arm removed the self-test's six local cases are red, and with take_local not reading the lease its
lease case is red. On a stand-in for the box (a root container where /root/bloomery-cpu.lock exists), removing
gpu-gate.sh's box refusal turns its two card tests red.
…ERY_BOX_CARD=local): timing-card.sh times the one card nvidia-smi lists by UUID, the lease and its trace sit in BLOOMERY_LOCK_DIR, the witness prints the card, its Xid count, the shared memory pool and the machine, and depth-qwen3moe.sh fails an arm on an Xid or a lost card

FAIL-first: against the local mode commit's timing-card.sh, lease.sh, arm-place.sh, depth-qwen3moe.sh and lcpp-warm.sh,
18 card tests are red on a Mac (the same 18 of 583 on Linux): 17 of the 18 local mode cases (the 18th, an arm on a card
that answers, is a control) and lease_take's machine lease under BLOOMERY_LOCK_DIR. With lease.sh's local label and its
trace path in the lock directory removed, the lease self-test's tag-local-busy and trace-file-lock-dir are red. Against
the local mode commit's runner the stub suite's local, local-xid and local-twocard cases are red (3 of 69, on Linux).
With the journal check reading its stderr with its stdout, the case of a journal that only warns on stderr is red; with
the local refusal tagged [timing-cards], its tag case is red. The pool line's fields are pinned by the stub suite's
local case alone (with the earlier pool line, 1 of 69 is red on Linux); the bound on the UUID query and the journal
check's skip for root have no test that can see them.
…ork's cargo-oxide (87bc9518, merged on bloomery) reads `[target.<triple>] extra-rustflags`, so .cargo/cuda-oxide.toml carries znver3 (with -sse4a) for x86_64-unknown-linux-gnu only and target-cpu=native for aarch64-unknown-linux-gnu, and .cargo/config.toml takes the same aarch64 table; the flat znver3 reached aarch64 builds, where rustc warned on every crate and crashed in LLVM on glob and regex-syntax. check-rustflags reads each list's codegen options in every spelling rustc takes (-C x, -Cx, --codegen, target_cpu for target-cpu), holds each triple's two lists equal, x86_64 to znver3 and -sse4a, aarch64 to an aarch64 CPU name (native, generic, cortex-*, neoverse-*, apple-*) and no target-feature, and refuses a top-level CPU flag; its twelve cases (the old flat list and its joined spelling, znver3 or haswell or an x86 feature or the target_cpu spelling on aarch64, a missing side, ...) run red on every call. The x86_64 flags an oxide build gets with --target x86_64-unknown-linux-gnu are byte-identical to the flat list's. The [patch] pin moves 4da6c138 -> 87bc9518 (pin/4da6c138 is tagged); 87bc9518 differs from 4da6c138 only in crates/cargo-oxide, so the backend crates are untouched

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…t the pinned rev (midagedev#36 review) — a cargo-oxide older than 87bc9518 reads only the top-level extra-rustflags and ignores the [target.<triple>] tables without a word, so with this branch's .cargo/cuda-oxide.toml it would build the host code without znver3 and -sse4a while every check stays green. A command that builds with cargo-oxide (one that names `cargo oxide`, `gate.sh --oxide` or `release/build.sh`, once any `release/build.sh --check`, which only reads built binaries, is taken out of it, so a build chained after a --check is still checked) now reads `cargo install --list` on the box, after the BLOOMERY_BOX_ENV exports so a CARGO_HOME or PATH set there is the one checked, and goes on only when its cargo-oxide line names the pin's rev (`...?rev=<rev>#<short>`); any other rev, or an install with no rev (a path install), stops with rc 70 naming the installed rev, the pin and the reinstall line in docs/BUILD.md. Other commands are unchanged. card-tests: the remote command of each of the three forms carries the check, after a BLOOMERY_BOX_ENV CARGO_HOME, and so does a --check chained with a build; a plain cargo call and a lone `release/build.sh --check` do not; the check run against a stub `cargo install --list` passes the pin and refuses 4da6c138 and a path install. FAIL-first: with the old box.sh the presence check and both refusals were red (the pin case passed)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…pointee, so the decode gemvs' L2 row prefetch shares it

A move: ptx-scan --no-jit of generate_qwen3moe equal to main's, the table and the md5 of all 215 entries.
…e row before the walk

Each lane issues prefetch.global.L2 for one 128-byte line of the warp's row per pass, from the line that holds the row's
first byte, before the walk. A hint: it changes no value. Each kernel that walks a decode row gains a `_prefetch` entry
that does this: q4k_gemv, q6k_gemv, q4k_gemv_sel, q6k_gemv_sel, qwen3moe_qkv_q4k, qwen3moe_o_resid_q4k,
qwen3moe_head_q6k_argmax, qwen3moe_gate_up_swiglu_q4k (its gate and up rows) and the four router-norm kernels (warp 0,
on the first token). row_prefetch reads CU_DEVICE_ATTRIBUTE_INTEGRATED when the Gpu and each kernel set load; the host
launches the `_prefetch` entry on an integrated device and the plain one elsewhere, and the launch-order gates name the
entry Gpu::row_prefetch picks. On a card with its own memory the prefetch costs more than it hides (an A6000 read 0.957
of main's decode with it on), and the plain entries there are main's: ptx-scan --no-jit of generate_qwen3moe prints the
md5 of all 217 of main's entries unchanged, plus the twelve `_prefetch` entries.

q4k_gemv, q6k_gemv and qwen3moe_o_resid_q4k share their body with their `_prefetch` entry through one inline walk over a
const PREFETCH, as gate_up_row and norm_row_body do. For q4k_gemv_sel, q6k_gemv_sel, qwen3moe_qkv_q4k and
qwen3moe_head_q6k_argmax that walk changed the plain entry's PTX, so the `_prefetch` entry is a copy of the body. A
single entry that took the device fact as an argument did not keep main's code where the prefetch does not run: sm_86
ptxas put qwen3moe_o_resid_q4k at 64 registers instead of 48, and that walk read 0.99 of main's on the Spark.

On a DGX Spark (GB10, stock clocks), Qwen3.6-35B-A3B Q4_K_M decode tok/s over main's in one lease, six rounds, n = 96,
on two machines: 1.1616 ± 0.0070 and 1.1668 ± 0.0022 at depth 6, 1.1664 ± 0.0020 and 1.1681 ± 0.0012 at depth 512,
1.1631 ± 0.0085 and 1.1611 ± 0.0110 at depth 4096; prefill at P = 512 and 4096 reads 1.0001 to 1.0064 of main's, each
interval holding 1. A same-binary A/A arm read 0.9987 ± 0.0038 and 1.0022 ± 0.0047.
@midagedev

Copy link
Copy Markdown
Owner

This branch now points at its commit in the 0.3.0 release train. The ptx-scan of generate_qwen3moe keeps all 217 existing entries byte-identical and adds the 12 prefetch entries. It lands with the release tonight.

@midagedev
midagedev merged commit fed530d into midagedev:main Oct 11, 2026
1 check failed
midagedev added a commit that referenced this pull request Oct 11, 2026
…its fork

A `9>&-` on the command is applied after its words are expanded. The background
child held the lease through the $(declare -f …) fork, so on a loaded CI runner
the next take or probe found it held (#27). The subshell now runs `exec 9>&-`
first. The self-test gains trace-waiter-frees-lease-slow-fork, which slows that
fork by 0.3 s: it fails on the old spawn and passes on the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 13, 2026
… locality was the term

The opening says what the document is, where each lever stands and how to read it, and explains GEMV and PDL. The
Verdict gains a Status column; it keeps the design's predictions, and where one was refuted it is struck with a pointer
to section 10, which holds the measured values for each card. Section 4.4 opens with "Closed by section 10's
measurement" and the rule's arithmetic with the measured c_node. In the text four predictions are struck with the
corrected value and the measuring comment beside them: c_node 0.6 to 1.5 µs (now 0.553 µs), the row-locality form's
−1.4 ms bound on GB10 (passed at stock clocks by −1.550 ms on public commits and −1.65 and −1.69 ms under a lease, and
by −1.62 ms at a 1989 MHz cap), 0 ± ruler on the A6000 (0.9570 of main's decode tok/s), and section 4.3's 74 KB in
flight (66 to 295 KB at the JIT's 4 blocks per SM). Section 10 adds the prefetch pair on public commits (fed530d
against 4a89639 at stock clocks), the lease numbers from midagedev#27, the A6000 run and the router rescan that landed (midagedev#35).
headpick-warmup.md and adaptive-picks.md cite sparkdec by section instead of line, and adaptive-picks.md 3.14 now
cites lever 1d (section 4.3), whose model gives 0 on the A6000, instead of the router regrid's band.
juliankang4 added a commit that referenced this pull request Oct 13, 2026
…s what its earlier commits earned

A merged pull request is labelled from its merge commit against that commit's first parent. A rebase merge, the only
kind this repository's merge button allows, has no merge commit: merge_commit_sha is the pull request's last commit,
so the diff covers that commit alone, and the labels its open runs put on for the earlier commits came off at the
merge. A merge now adds labels and removes none. Walking back the pull request's commits does not fix the diff: a
stack pushed at once (#27, #36, #38, #39) lists every commit below it, so each would take the whole stack's labels.
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 13, 2026
… locality was the term

The opening says what the document is, where each lever stands and how to read it, and explains GEMV and PDL. The
Verdict gains a Status column; it keeps the design's predictions, and where one was refuted it is struck with a pointer
to section 10, which holds the measured values for each card. Section 4.4 opens with "Closed by section 10's
measurement" and the rule's arithmetic with the measured c_node. In the text four predictions are struck with the
corrected value and the measuring comment beside them: c_node 0.6 to 1.5 µs (now 0.553 µs), the row-locality form's
−1.4 ms bound on GB10 (passed at stock clocks by −1.550 ms on public commits and −1.65 and −1.69 ms under a lease, and
by −1.62 ms at a 1989 MHz cap), 0 ± ruler on the A6000 (0.9570 of main's decode tok/s), and section 4.3's 74 KB in
flight (66 to 295 KB at the JIT's 4 blocks per SM). Section 10 adds the prefetch pair on public commits (fed530d
against 4a89639 at stock clocks), the lease numbers from midagedev#27, the A6000 run and the router rescan that landed (midagedev#35).
headpick-warmup.md and adaptive-picks.md cite sparkdec by section instead of line, and adaptive-picks.md 3.14 now
cites lever 1d (section 4.3), whose model gives 0 on the A6000, instead of the router regrid's band.
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 13, 2026
… locality was the term

The opening says what the document is, where each lever stands and how to read it, and explains GEMV and PDL. The
Verdict gains a Status column; it keeps the design's predictions, and where one was refuted it is struck with a pointer
to section 10, which holds the measured values for each card. Section 4.4 opens with "Closed by section 10's
measurement" and the rule's arithmetic with the measured c_node. In the text four predictions are struck with the
corrected value and the measuring comment beside them: c_node 0.6 to 1.5 µs (now 0.553 µs), the row-locality form's
−1.4 ms bound on GB10 (passed at stock clocks by −1.550 ms on public commits and −1.65 and −1.69 ms under a lease, and
by −1.62 ms at a 1989 MHz cap), 0 ± ruler on the A6000 (0.9570 of main's decode tok/s), and section 4.3's 74 KB in
flight (66 to 295 KB at the JIT's 4 blocks per SM). Section 10 adds the prefetch pair on public commits (fed530d
against 4a89639 at stock clocks), the lease numbers from midagedev#27, the A6000 run and the router rescan that landed (midagedev#35).
headpick-warmup.md and adaptive-picks.md cite sparkdec by section instead of line, and adaptive-picks.md 3.14 now
cites lever 1d (section 4.3), whose model gives 0 on the A6000, instead of the router regrid's band.
juliankang4 added a commit that referenced this pull request Oct 13, 2026
… locality was the term

The opening says what the document is, where each lever stands and how to read it, and explains GEMV and PDL. The
Verdict gains a Status column; it keeps the design's predictions, and where one was refuted it is struck with a pointer
to section 10, which holds the measured values for each card. Section 4.4 opens with "Closed by section 10's
measurement" and the rule's arithmetic with the measured c_node. In the text four predictions are struck with the
corrected value and the measuring comment beside them: c_node 0.6 to 1.5 µs (now 0.553 µs), the row-locality form's
−1.4 ms bound on GB10 (passed at stock clocks by −1.550 ms on public commits and −1.65 and −1.69 ms under a lease, and
by −1.62 ms at a 1989 MHz cap), 0 ± ruler on the A6000 (0.9570 of main's decode tok/s), and section 4.3's 74 KB in
flight (66 to 295 KB at the JIT's 4 blocks per SM). Section 10 adds the prefetch pair on public commits (fed530d
against 4a89639 at stock clocks), the lease numbers from #27, the A6000 run and the router rescan that landed (#35).
headpick-warmup.md and adaptive-picks.md cite sparkdec by section instead of line, and adaptive-picks.md 3.14 now
cites lever 1d (section 4.3), whose model gives 0 on the A6000, instead of the router regrid's band.
@juliankang4 juliankang4 added the gpu The card engine: crates/gpu*, crates/app label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants