Optimize C128 state pool allocation using request state pool - #28612
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
@ispobock more accuracy tests is finished and your comments is fix |
|
CI base-b-test-1-gpu-large / base-b-test-1-gpu-large error: This is a RoPE cache device mismatch in the DSV32 DSA indexer fused kernel; it is unrelated to this pr. @Fridge003 |
|
Could this have caused CUDA error 700 before the fix? |
|
@freeliuzc This PR focus on optimizing the C128 storage format, and resolve potential precision issues; there are no CUDA errors. |
| accept_index, | ||
| ) = eagle_sample(verify_input, batch, logits_output, vocab_mask) | ||
| new_seq_lens = batch.seq_lens + accept_lens | ||
| clear_unaccepted_c128 = getattr( |
There was a problem hiding this comment.
There was a problem hiding this comment.
OK, I will fix it and follow this rule in future PRs.
Motivation
Co-authored-by: shiyu7
This PR optimizes the C128 state slot lookup path.
The issue was introduced when the online C128/MTP path started deriving C128 state slots through SWA mapping. Before this change,
full_to_swa_index_mappingwas only a temporary translation table for SWA attention KV slots. The original radix/SWA cache lifecycle allows radix cache to keep the full KV prefix alive while the SWA sidecar KV for the same prefix may be tombstoned or freed earlier, such as through SWA-only eviction ordec_swa_lock_only().With online C128 + MTP, the state lookup path used logic equivalent to:
This made
full_to_swa_index_mappingpart of the C128 state indexing path. When a multi-turn request hit a radix-cached prefix, the full KV prefix could still be alive in the radix tree while the corresponding SWA mapping had already been cleared or reused. The online C128/MTP path could then read slot 0, an old slot, or a reused slot, causing accuracy degradation.Modifications
Decoupled C128 state from SWA mapping. C128 no longer uses
full_to_swaorswa_page_sizeto locate state slots.Changed C128 state indexing to request-scoped layout. Online C128 uses
req_pool_idx; offline C128 uses a per-request ring:req_pool_idx * ring_size + position % ring_size.Kept C4 unchanged on the SWA-based sliding-window path.
Changed C128 state pool allocation from token-proportional sizing to request-scoped sizing, and accounted for this fixed memory in DSV4 pool capacity estimation.
Updated online C128 MTP and PD disaggregation transfer paths to follow the new request-scoped C128 state layout.
Accuracy Tests
PD:
Non PD:
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ✅ Run #28432147498
Latest PR Test (Extra): ⏳ Run #28547079380