perf(ds4): elide intermediate prefill logits - #633
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…d preserve cuda mmq fallback
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| candidate.mode == cache.prefill_mode; | ||
| if (!candidate.ready || !same_owner || | ||
| n_tokens > candidate.n_tokens) { | ||
| const bool can_cache_dominant = !logits_needed; |
There was a problem hiding this comment.
does this mean single-chunk prompts never populate the cache? eg --chunk 512, a 5–512 token prompt goes straight to the terminal/logits path, with logits_needed always true, so can_cache_dominant is false and every request rebuilds the layer-major graph
repeated single-chunk prompts with the same shape rebuild the layer-major graph on every request...was that case benchmarked, or is the build cost small enough that it does not matter?
extra: A snapshot boundary also sets need_logits to true because restoring that snapshot later requires the logits from that exact position.
Status
Draft: fresh current-main qualification does not support merging this as a performance PR.
The old +4.1% dual-GPU and +5.7% Strix-only measurements were made against an older
main. Since then, #640 and #647 merged and changed the relevant DeepSeek4 paths. The old gfx1151 MMQ tile edits also overlap newer code in currentmainand are no longer part of the reconciled candidate.Remaining candidate scope
The current-main reconciliation keeps only the DeepSeek4 logits-elision work:
A focused unit test was added for the graph-cache replacement policy. That local candidate has not been pushed because its fresh performance result is not acceptable.
Fresh current-main results
Base: current
mainatc994209a2c03c1bf3426924aba52b5edc05501ffLocal reconciled candidate:
d38bb5dc5d883b37f3ba7822bf864d51c501070dMatched Lucebox6 runs used the same ROCmFP2 model, placement, prompt, runtime settings, cache policy, two warmups, and five measured requests per arm. Main was bracketed around the candidate.
Every request produced the same exact response SHA-256:
cd5cb9fb5ac3c4f4007e8b41d117da21622439cd05c1728f3e82f90e4f869dadThe 2048-token candidate arm had high variance, but it did not show a positive signal and therefore fails closed. No performance claim is made from it.
Validation completed on the local reconciliation
gfx1151;gfx1201, HIP graphs enabled, ROCm 7.2.4;test_deepseek4_unitexitedOKon physical gfx1201 and gfx1151;git diff --checkclean;Evidence root:
/home/cheese/pr590-pr633-ready-20260825T1815ZManifest SHA-256:
26e936d5ad47d26cc9b45ce9c01d87d9e6e83543c0435faeaa2780678a4b497f