Repository navigation
cuda: Flash Next refuses non-finite draft rows by name and never indexes past its ID table - #2753
Conversation
|
A second read of this one found work before it lands: the new host tests aren't wired into any CI step yet, the sampled and masked verify paths gain a stream sync that can be folded into the one they already have, a few finite-path parity tests are missing, and the description should list three behaviour changes (a verify row that is non-finite only in grammar-masked columns is now refused,
|
|
Follow-up round is in (
The GB10 A/B (greedy, sampled top-k, full-row, structured output, concurrent streams, tokens equal and decode level) runs on this head next; it lands only on that.
|
|
The GB10 A/B on this head (
So the extra reduction and readback on sampled verify rows don't show up in decode. This goes on the landing queue once this head's CI finishes. A missed push event meant CI never started, so the PR was closed and reopened to start it.
|
Exercise the shared two-lane draft loop, per-row verify refusals and finite sampling and mask parity. Run the nonfinite host gate in the CUDA aggregate and Linux nightly shard.
5b0f143 to
3eb0e4b
Compare
#2721 added tf_qmmf_native_fp4_check and the e2m1 pair decode to qmmf.cu behind -Dnative-fp-decode; default builds are byte-identical. #2753 refuses non-finite Flash Next draft rows by name and checks verify rows after one completion wait, with finite rows unchanged. #2802 pins that Flash Next declares no chunk_invariant. Each row's note names the change.
#2721 added tf_qmmf_native_fp4_check and the e2m1 pair decode to qmmf.cu behind -Dnative-fp-decode; default builds are byte-identical. #2753 refuses non-finite Flash Next draft rows by name and checks verify rows after one completion wait, with finite rows unchanged. #2802 pins that Flash Next declares no chunk_invariant. Each row's note names the change.
Scope and figures corrected to the PRs (#2700, #2670, #2338, #2491, #2680, #2557, #2597, #2760's load time, #2753's verify-row wait, #2681's ledger row), #2831's and #2682's lines rewritten to what the code does, #2709 given its own line above #2609's, the duplicate #2404, #2576, #2597 and #2699 entries and the copy of #2609's line under 1.2.6 removed, entries spaced one blank line apart, and the released sections restored to the v1.2.6 tag's text (#1651's 1.2.2 line and six blank lines in 1.2.5 and older).
What this changes
Flash Next on CUDA reported
ProposalPaddingPickwhen a draft-head row reduction came back non-finite (#2734). The name pointed at score padding, but the row was invalid:fn_row_beststarts from negative infinity and INT_MAX and only moves on a strict greater-than, so an all-NaN or all-negative-infinity row keeps that sentinel, and its log-sum-exp is NaN whenever the row holds a NaN. The batched head also cast the unchecked column and indexed the compact ID table with it, which can read out of bounds in a fast build.core/proposal_rows.ziggainsScores.pickBest: it takes the reduction (top value, log-sum-exp, signed column bits) and refuses a non-finite top, a non-finite log-sum-exp, a negative column or one past the logical row withProposalNonfinite, then maps the column through the existingglobal(). Existing selectors are unchanged.Finite rows pick exactly what they picked before: the same token mapping, probability formula and keyed sampler. The NaN's source isn't found yet; this makes it fail by its real name and never read out of bounds. No cache clearing or kernel arithmetic changes.
Checks
zig build test-flashnext-proposal-host test-flashnext-proposal-pack-hoston this head (maincd6060a436): pass. New tests infamilies/flashnext/cuda_mtp_nonfinite_test.zigandzig/proposal_rows_host.zigcover {-inf, NaN, INT_MAX bits, 0}, finite maxima with NaN log-sum-exp, negative and end-of-row columns, both NaN signs and infinities in candidates, through the real loneOps.pick, the shared head's selection, raw verify draws and the real top-k sampler with fake CUDA readbacks.zig build compile-cuda-tests -Dtarget=aarch64-linux-gnu: pass. Full host suite on the original base: 383/383 steps, 1436/1443 tests (7 skipped). Lean: 0 new. Files at most 600 lines.Still to come
Sampled and masked verify rows now run the existing reduction kernel and a small readback, and that cost isn't measured yet. A GB10 A/B (Flash Next, main against this branch, prompt passes, a decode sweep and chat, sampled as served) is queued; this lands only if it reads level with tokens equal.
Refs #2734.