Repository navigation
docs: sparkdec.md §9 gives the cc 12.1 JIT's registers and blocks per SM for the eight decode entries; gate_up and o_resid fit 4 blocks per SM, not 5 - #70
Merged
Conversation
… SM for the eight decode entries; gate_up and o_resid fit 4 blocks per SM, not 5 Open term 3 is answered with the table from midagedev#17: registers and cuOccupancyMaxActiveBlocksPerMultiprocessor of the plain and the _prefetch entries on a Spark. The count in the term is eight, as section 1 lists. The terms derived from the sm_86 scan's 5 blocks per SM are corrected in place at 4: the verdict's 1c, section 1's per-SM limits and slots, section 2's waves column with a note under it, the router's register count in section 4.2 (48, not 47), section 4.3's o_resid tail, section 5.2's warps per SM with a note under its table, and section 5.3's ratio. In section 4.3 the second wave is 64 blocks and the old 74 KB reason for the tail no longer holds, so the tail's cause is open; 1c's Δ is kept and says it assumes the regrid removes the whole tail. Section 5.2's premise that 48 registers cannot hold two iterations is limited to the sm_86 scan, and the JIT's overlap is marked unverified. No measured number and no lever estimate changes. adaptive-picks.md and headpick-warmup.md cite sparkdec.md by line; their three citations follow the text to its new lines.
73 of 79 tasks
6 of 7 tasks
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.
What and why
Open term 3 of
docs/research/sparkdec.md§9 asks for the registers the cc 12.1 JIT gives the decode entries. #17 comment 6117957831 measured them, and your reply asked for the table to be folded into §9. This adds the table under term 3 and corrects in place the terms derived from the sm_86 scan's 5 blocks per SM, since two plain entries fit 4 on a Spark; no measured number and no lever's Δ changes.What changes
The table gives registers and blocks per SM of the eight entries from §1, for the plain entries and for the
_prefetchentries that main launches on an integrated device. Two plain entries fit at most 4 blocks per SM, not 5:qwen3moe_gate_up_swiglu_q4k(62 registers) andqwen3moe_o_resid_q4k(59). In the_prefetchentriesq4k_gemv_selalso drops to 4 (64 registers). Blocks per SM is whatcuOccupancyMaxActiveBlocksPerMultiprocessorreturns: the most blocks of that size that fit on one SM, not a count taken from a running kernel. The build §2 timed (04d0c0ae) gives the plain column's values, so no measured number in §2 moves. The term also said seven entries, and §1 lists eight, so it now says eight.The corrected terms, all
[derived]from the table and listed in §9 term 3:o_resid_q4k's 256 blocks sit on 192 slots, not 240. The Δ cell keeps −0.07 ms and now says it holds if the regrid removes the whole tail (§4.3).[unverified]note on the JIT's allocation and the[cited; ... confirm with cuDeviceGetAttribute on the Spark]flag on the per-SM limits are replaced by the reading (1536 threads, 65536 registers, 102400 B of shared memory per SM, 48 SMs, the same on two Sparks). "The static blocks per SM carry over" now names the two plain entries that do not, andq4k_gemv_sel_prefetch.gate_up_swiglu_q4kat 3.00 on GB10, not 2.40, ando_resid_q4kat 1.33, not 1.07. The note says which blocks per SM the column uses, and thatgate_up_swiglu_q4k's 3.00 waves are all full, so in this model its 2.89 µs tail is not a partial-wave tail; a kernel in whole waves still has a tail.o_resid_q4kis 64 blocks, not 16. Its 512 warps hold 128 to 576 B each a round, about 66 to 295 KB, against the 118 to 353 KB of §5.1. The old reason for the tail (up to 74 KB, under the need at every latency) no longer holds, and the new count alone cannot say whether the wave is short of bytes, so the paragraph now gives the tail's cause as[unverified]. The −0.07 ms of 1c is kept; the text says it assumes the regrid removes the whole 1.76 µs tail, which is unverified, sincegate_up_swiglu_q4khas a tail in whole waves.[unverified: SASS not read]; the Q4_K rows and §4.3's count assume they do not, and a warp would hold up to twice as much if they do. Both rows have 32 warps per SM, not 40 (4 × 256 / 32), so 4.1 to 18.4 KB in flight per SM, as inqkv_q4k's row.o_resid_q4k's last cell no longer calls its tail a wave tail.docs/research/adaptive-picks.md(lines 149 and 286) anddocs/research/headpick-warmup.md(line 593) citesparkdec.mdby line. The cited sentences move from lines 170 and 196 to 177 and 209, so the three citations move with them.I did not re-price 1c, measure the tails or read the JIT's SASS. Whether 1c should become a bound ("≤ −0.07 ms", as 1d is written) is your call.
Code shape
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up. Nothing Rust is touched.Duplication found or removed (
path:line), or "none": none.What I ran
On the branch, based on main
e659f4fe, withtools/contrib-check.sh --tier t0 --only '^check-'(everytools/check-*.sh):This ran on a Mac (the host line reads Darwin arm64) with no GNU
timeout, so the units ran unbounded.The change is Markdown only, so no gate applies. I checked the table cell by cell against the output of the occupancy script in the linked comment, recomputed every corrected value from it, checked the
row_prefetchcitation (crates/gpu/src/lib.rs:1936) at maine659f4fe, and checked that the three moved citations in the other two documents point at the same sentences as before.Hardware (if the change is for a machine)
The readings were taken with the host driver 595.84 on DGX Spark (GB10, cc 12.1, 48 SMs), kernel 6.17.0-1032-nvidia: the plain entries on two Sparks and every
_prefetchentry on one, from an empty environment and a freshCUDA_CACHE_PATH. Repeated runs agree, and the registers equaloxart_jit's over the whole.oxartsection. The module is thebloomery-gpuPTX of abloomery-servebuilt from maindd187c1d. The conditions are in the linked comment. This pull request runs nothing on a Spark.