perf(ds4): extend sparse prefill scheduling to 10K - #684
Draft
dusterbloom wants to merge 12 commits into
Draft
Conversation
Collaborator
Author
|
Clean public-head validation for
This is +0.851 tok/s / +0.335% over the cited 254.07 tok/s Vulkan result at the same token count. All three clean one-token runs emitted Caveat: matched token count and Strix Halo class, but not a proven identical prompt or model artifact. Sparse prefill itself remains approximate; this proves the performance gate, not full behavioral parity. |
…-sparse-prefill-wide
10 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.
Summary
2,048-token numerical bands, admitting one physical frontier up to 10,240
tokens
retaining and uploading its quadratic score mask
raw/compressed KV transport in F16, and stream each selected latent row once
across sixteen wave32 heads
independent 2K attention bands, and chronological state commit
commits from perf(ds4): default mixed ROCmFP MMQ prefill on gfx1151 #683
Exact prefill, dense-flash prefill, decode, non-ratio-4 attention, and unsupported
backend shapes retain their existing paths. No runtime flag, memory guard,
cache, worktree, or private BWS policy was added.
Production workflow
Strix Halo
gfx1151, 98.3 GB ROCmFPX MIX artifact, target-only sparseprefill, native top-6 routing, fused autoregressive decode, Q4_0 K/V cache,
caches off, 9,133-token SWE-bench-shaped prompt, and up to 128 generated
tokens:
619413cd6471f1The final two warm prefill samples were 252.09 and 252.26 tok/s. The matched
128-output-token warm sample saved 3.522 seconds. Decode code is unchanged;
its small movement is reported, not claimed as a decode optimization. Sparse
replay produced 47 tokens in one warm sample and 128 in the other, so whole
wall is compared only between matched 128-token samples.
The earlier clean-head 7,680-token receipt remains 254.921 tok/s, nominally
0.335% above the cited 254.07 tok/s Vulkan result at the same token count. The
prompts, artifacts, and quality protocols are not proven identical, so this PR
does not claim a cross-runtime record from that comparison.
Memory and execution shape
The ratio-4 analytic path removes retained masks from 21 attention layers:
That memory headroom permits the five-band frontier without a runtime memory
guard. The four full-vocabulary quality processes reported zero swaps; the
end-to-end runs had no OOM, managed-memory cliff, or system-manager failure.
Failure found by the real workflow
The first maskless implementation passed units but segfaulted on the real
9,133-token request. A GDB hardware watchpoint found the generic ring-mask
writer overwriting the layer-2 graph header: after omitting the layer-major
score mask, control incorrectly fell through to old-row logic that assumes a
saved ring unavailable in layer-major prefill.
The root-cause correction restricts that branch to
causal_batch && !layer_major_batch. It adds no fallback, allocation, flag,or defensive guard. The corrected source crosses the former crash point and
passes the real workflow.
Qualification
Release HIP
gfx1151, build concurrency capped at four. The full pinned-Halotest_deepseek4_unitpasses, including the ratio-4 boundary formula and afocused explicit-mask versus analytic-mask GPU oracle with bit-identical
streaming-attention output.
The unchanged Q2048/Q8192/Q8192/Q2048 ABBA harness used four frozen real-domain
token tapes, 128 teacher-forced full-vocabulary rows, and 32 greedy rows per
arm:
Code, tool, and multilingual passed the preregistered limits. Prose passed its
top-1 and greedy rules but measured KLD 0.011536 against the frozen
max(0.006, 1.25 * noise)limit of 0.011216, a 0.000320 miss. This isconsistent with the inherited sparse replay noise, but the sample remains
reported as failed: no threshold was changed and it was not rerun until
passing. The focused kernel oracle is bit-identical.
Known limitation
Sparse prefill remains approximate and nondeterministic across identical
same-arm replays. State and logit hashes differ even within equal-width
controls. These results do not claim bitwise full-model determinism.
The 9,133-token timing fixture carries an agent-shaped coding transcript but
no actual tool schema and only a 128-token output budget. It directly exercises
the changed path; it is not a complete agent-task quality proof.
Scope
This PR contains public scheduling, selected-row dataflow, F16 transport,
generic HIP attention-kernel work, tests, and the narrow ring-mask root-cause
fix. It contains no private Behavioural Working Set mask, calibration, expert
reuse, slab, or placement policy. Temporary attribution telemetry was removed
before the final commit.