Repository navigation
flashnext cuda: the MTP head's experts run on the call's last row only - #1925
Conversation
|
Thanks @jschmied, a neat find. Reviewed: only the call's last row reaches |
forwardHead writes the head's cache for every row, but only the last row of a call reaches d.out: the attention and its write-back stay over all rows, and the experts, their write-back and the copy out run on that row alone, moved to row 0 as the scores path already does. Prompt chunks and absorbed rounds no longer run the head's MoE on rows nothing reads. On a GB10 (FP4-Local, --parallel 1, A B B A fresh servers): TTFT -0.8 % at 6k and -0.5 % at 24k tokens (every new run below every old one); six greedy replies and their drafted and accepted counts are equal.
287f86d to
6b9d2c1
Compare
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Thanks @jschmied! This is in TensorFold 1.2.2, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.2 |
Found while measuring the draft head for #1870.
forwardHeadwrites the MTP head's cache for every row of a call, but only the call's last row reachesd.out. So the attention and its write-back stay over all rows, and the experts, their write-back and the copy out now run on the last row alone. It's moved to row 0, as the scores path already does. Prompt chunks and absorbed rounds no longer run the head's MoE on rows nothing reads.A/B (GB10,
nvidia/Qwen3.8-Flash-Next-FP4-Local,--parallel 1 --context 40960 --prompt-cache-gib 0; fresh servers in the order maine8b3639a7, branch, branch, main; two time-to-first-token readings per cell):Every branch reading is below every main reading. The range's first number uses the first main run only, since the last main run may have overlapped a build on the box.
Six greedy replies (temperature 0, MTP drafting on) hash the same in all four runs, and so do their drafted and accepted counts (for example 24 rounds, 127 drafted, 103 accepted for the first).
Overlap: #1786 and #1866 move this loop into
cuda_mtp_pieces.zig(runPiece, captured as CUDA graphs keyed by row count). Whichever lands second needs a rebase. If #1786 goes first, I'll move the change intorunPiece, with its graph key taking the experts' single row.Checks (GB10, on main
e8b3639a7): lean 0 new,zig build testand the CI set pass,git diff --checkclean.