Repository navigation
Conversation
|
Follow-up checks on this PR, one by one:
Gates: zig build test passes on the branch; lean has 0 new problems. No engine code changed on this level, only the test. |
|
Review of #1355–#1359 against main e9b69ed, in stack order.
|
|
Tested on a discrete card under Windows: one RTX 4090 (24 GB, The overrun reproduces on the base, and on this card it faults below 257 rows too:
At the tip neither faults: every paged arm serves all of its requests and the server is alive at the end. With paging on, its solo and undrafted replies equal the base's paging replies (16/16 where the base answered, bf16 and fp8). |
…fy rows at a time The partials (pm, pl, po) hold most_verify rows, as a decode round has; a prompt chunk on a pool lane (up to max_rows) took the scalar paged path with all its rows in one launch and wrote past them: a 257-row prompt on a pool lane faulted (CUDA_ERROR_ILLEGAL_ADDRESS), 129..256 rows overwrote pl and po silently. The paged partial and merge now go through the chunk's rows most_verify at a time, each row as before; a decode round is one slice, the same launches as before.
… a time cuda_forward.zig runs a paged chunk's partial and merge 128 rows a launch, on queries, row tables and outputs shifted to the slice's first row, with the segment table and the round's params unshifted. qwen-page-slices runs that against one launch over every row and against the contiguous kernels, bf16 and fp8: 127, 128, 129, 255, 256, 257 and 4096 rows of one paged stream, and two streams of 127 to 4096 rows with one on pages and one contiguous (slices crossing from one to the other). Every row is the same bytes, the 128-row partials' guards hold, and a slice that leaves its row tables at row 0 is red. `qwen-page-slices small` runs the 129 to 257-row cases alone, for compute-sanitizer.
…with a host test of their launches The loop that runs a paged prompt chunk's partial and merge most_verify rows at a time moves from cuda_forward.zig into cuda_attention.pagedSlices, unchanged, so a host test can record its launches without a device. A 257-row chunk issues three partial and merge pairs (128, 128 and 1 rows), each on the queries, row tables, ancestors and outputs of its first row, bf16 and fp8; 1, 127, 128, 129, 256, 257 and 4096 rows issue one pair per started slice and merge every row once.
9ec466d to
eba333d
Compare
|
Added both. Host test (commit "cuda qwen3_5: a paged chunk's slices are cuda_attention.pagedSlices, with a host test of their launches"): the slice loop moved unchanged from Device check (GB10, Qwen3.6-35B-A3B MLX-4bit,
The kernel-contract test from the earlier commit ( |
Found while porting the rest of #1156. On main a prompt on a pool lane runs the scalar paged attention partials with all of its chunk's rows in one launch. With 4096-row prompt chunks that overruns
pm/pl/po, which hold 128 rows (most_verify):CUDA_ERROR_ILLEGAL_ADDRESS;pl/powithout an error.Repro on main:
TF_QWEN_KV_PAGES=256 TF_QWEN_KV_PAGES_ALL=1, one 257-token prompt.The fix runs the paged partials and their merge in launches of at most
most_verifyrows. A decode round is still one launch.Gates on GB10 (Qwen3.6-35B-A3B and Qwen3.8-27B MLX 4-bit, bf16 and fp8 KV): flags unset == main on 37/37 greedy outputs per configuration, and with
TF_QWEN_KV_PAGES=256paging == main paging on 22/22 solo and resumed outputs. The every-stream-on-pages runs with 9k-token prompts are in the stacked #1357.zig build test -Dnvcc=/usr/local/cuda/bin/nvccexits 0, lean shows 0 new.