Add: support 1M context in DeepSeek V4 SWA decode - #994
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughSWA decode now uses token-local dynamic RoPE tensors. The harness computes active-position rows, supports mixed start positions up to 1M positions, validates bounds, and forwards runtime options through TP1 and distributed execution paths. ChangesSWA token-local RoPE flow
Merge Risk: ⚪ Minimal · up to The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant CLI
participant build_tensor_specs
participant init_rope_rows
participant decode_swa_tp1
CLI->>build_tensor_specs: pass start_pos and batch
build_tensor_specs->>init_rope_rows: compute active-position RoPE rows
init_rope_rows-->>build_tensor_specs: return token-local cosine and sine rows
build_tensor_specs-->>decode_swa_tp1: provide dynamic tensor specifications
CLI->>decode_swa_tp1: pass start_pos and enable_l2_swimlane
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
instead of M.max_position_embeddings, leaving the global model
configuration untouched.
tensors on decode_swa, decode_swa_tp1 and l3_decode_swa, binding
their token axis dynamic on every test and L3 entry.
feed freqs_cos and freqs_sin straight into qkv_proj_rope and
sparse_attn_swa; position_ids stays in the ABI for host admission
and golden semantics.
build_tensor_specs from rope_theta, replacing the full-context
build_rope_tables table, and cache them across the cos and sin
initializers.
wrap into the fixed physical pool.
entries, deriving the batch from the list length and rejecting
negative positions or ones past MAX_SEQ_LEN; the output-only entry
rejects the flag.
distributed specs share the single-rank fixture path, and size the
kv_cache comparator mapping to the actual token count.
consumes the token-local RoPE tensors directly.
Validated on A2/A3 devices at TP1 and TP2 for 128, 16K and 1M local
contexts plus a mixed (16K, 16K, 128K, 512K) workload at S=8, with
both kv_cache and x_out passing. Related to #962.