Repository navigation
Conversation
…s keys A non-final prompt chunk's last layer feeds only a head nobody reads. Keep gains `none`; on such a chunk the last layer runs its norm, K/V projection, head norms and RoPE, then stops. The final chunk is unchanged. `cuda_prompt_tail.unread` refuses this when a tap on the last layer, a learning/MLP/pocket reader, prompt int8 or an image chunk reads its rows. The 32K host fill passes `none` on chunks 1-7 and `last` on chunk 8. GB10, Qwen3.6-35B-A3B-NVFP4: cold 2K/8K/32K replies are byte-equal to main and a resumed chat turn equals its fresh run. The host suite and `test-qwen35-prefill-host` pass; the new test fails with `none` disabled.
…evice checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names #3060.
@jschmied's base-new-new-base run measures -28.4 ms median per round and -34.5 ms median adjacent at 32K (-0.5..-0.6 %), 3-4 ms at 8K, and level at 2K, with tokens equal. The ledger rows and receipt carry the numbers.
- states.py reads the disk tier's state file and the K/V blocks it names, and hashes their payloads. - The receipt compares current main against the review head at both marks: equal recurrence, convolution and K/V bytes. - Added the Unreleased bullet naming #3060 that the pre-flight expects.
- The in-file yielded-prefix test's fake engine now declares layers, taps, learning, mlp, pockets and int8. - test-host-a, zig-b and zig-windows failed to compile the prompt-tail read on the fixture; test-qwen35-prefill-host passes 25/25.
- The 32K fixture uses grid_rows after main split it from max_rows; max_rows now allows an 8K solo pass and overflowed the 64K capacity.
… checkpoint leaves the page cache On a GB10 the memory admission read /proc/meminfo alone. MemAvailable counts the page cache, which CUDA can't allocate until the kernel reclaims it: after one 60 GB checkpoint read CUDA reported 60.17 GiB free against MemAvailable's 115.85 GiB, and admission granted 103.44 GiB, 43.27 GiB above CUDA's figure (#1857). Both admission readers, poolFor and readPool (the Qwen3 embedding and reranker engine, the speech engine's limit), now take the smaller of the host figure and CUDA's free (cuda_memory.boundFree), less the same reserve. The parked share is the part of that free above MemAvailable, so its debug line stays true. Before the weights check, the CUDA open on an integrated device advises POSIX_FADV_DONTNEED on the shards core's loader opens (checkpoint.shardFiles: the weight map's files inside the model folder, else model*.safetensors) through checkpoint_cache.drop, so a checkpoint just downloaded or read is not refused for its own cached pages. Only clean cached pages go; no file's bytes change, and an index naming a file outside the folder drops nothing. After the load no second drop runs: each loader's own release (#1884) has dropped its load-only pages already and keeps the ranges it reads at run time, such as Flash Next's n-gram rows. Discrete cards and Windows keep their counts (boundFree passes them through and the drop never runs off an integrated Linux device); Metal and HIP don't reach this code. Admission sizes streams and caches only, so replies keep their tokens. The docs' unified-memory budget says the same. Host tests replay the 6 Nov figures; a GB10 device check is owed.
The qwen3_5 CUDA EXL3 admission and weights loader hard-coded the mul1
codebook: cuda_exl3_admit.zig looked only for .mul1 marker tensors and
checked only mul1 kernel variants, and cuda_exl3_weights.zig set
.codebook = .mul1 on every Weight and Layer literal.
The CUDA kernel variants table (zig/src/cuda/exl3.zig::variants) already
enumerates mcg at every supported width (halves 2..16), so the kernels
can decode mcg-codebook checkpoints on any supported bpw. The GLM CUDA
family (families/glm/cuda_exl3.zig) already loads mcg checkpoints the
same way through its own admit path.
This change teaches the Qwen3.5 CUDA loader to accept either codebook:
cuda_exl3_admit.zig
* add mcg_magic = 0xCBAC1FED alongside mul1_magic
* Group now carries .codebook: cuda.exl3.Codebook
* group() detects .mul1 first (keeps mul1 the common case),
then .mcg, else refuses with UnsupportedQwenQuantization
* denseGroup() uses g.codebook for variant lookup
cuda_exl3_weights.zig
* dense() sets .codebook = gr.codebook
* experts() captures the first expert's codebook, asserts every
expert of the same layer uses the same codebook, and the Layer
literal carries that codebook
cuda_exl3_loader_test.zig
* new test: an mcg-codebook group admits with codebook .mcg
* new test: an mcg marker with the wrong magic is refused
test-qwen35-exl3-admission-host: 5/5 pass, no error logs.
test-exl3-cuda-host: 671/681 pass, 10 skip (unchanged from baseline).
…oat64 reference plant put NVFP4_NZ5's +5s only into the random fill, so gate 4 (sums) and the non-finite gate never saw one on the nz5 kinds, and each +5 stood alone in its group at a power-of-two scale. The stress fill now holds +5s among its 4s and 6s. NVFP4_NZ5 has no -5 to mirror one, so they come two on equal inputs, mirrored by a -4 and a -6: the sums stay exact in any order and the result as small as before. The float64 reference reads nz's codes, 0b1000 as 5, under block 32's scales, which on the random and non-finite fills is the value block 16's reading gave. The non-finite fill plants +5s as the random fill does, and E2M1's entry on the stress fill's codes is a second planted control, red at gate 4. The fills and the weight live in contract_nvfp4_nz5.zig, plant moved there unchanged, so contract_nvfp4_fact.zig stays within 600 lines.
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.
CI for a landing train: #3060 #3192 #3412 #3543 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.