Add: compose DeepSeek V4 SWA decode TP output - #937
zhangqi-chen merged 2 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdded a DeepSeek-V4 SWA decode output pipeline with distributed attention, sharded output projection, reduce-scatter, deterministic fixtures, PyTorch golden validation, poisoned-tail checks, and a CLI for compilation and test execution. ChangesSWA decode output pipeline
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant l3_decode_swa_output_cp
participant decode_swa_output_cp
participant DistributedCollectives
CLI->>l3_decode_swa_output_cp: Launch distributed decode
l3_decode_swa_output_cp->>decode_swa_output_cp: Invoke device kernel
decode_swa_output_cp->>DistributedCollectives: Exchange attention outputs
decode_swa_output_cp->>DistributedCollectives: Reduce-scatter projected output
decode_swa_output_cp-->>CLI: Return o_local
Possibly related PRs
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 |
eb9e73a to
41038c0
Compare
| in this path (model.py:478-479 selects base rope_theta when compress_ratio==0). | ||
| Companion files: attention_csa_draft.py (ratio=4) | ||
| attention_hca_draft.py (ratio=128).""" | ||
| # ci: devices=4 |
| parser.add_argument( | ||
| "--mode", | ||
| choices=("all", "tp1", "tp4"), | ||
| default=None, | ||
| help="execution mode; defaults to TP1 for an explicit single device and all paths otherwise", | ||
| ) |
There was a problem hiding this comment.
use --tp 1/2/4,like style in moe/lmhead
- Chain rank-local SWA heads through TP token/head exchange, sharded output projection, and FP32 reduce-scatter - Consolidate TP1 and TP4 paths behind explicit modes while isolating their runtimes in combined CI execution - Reuse the shared output projection and validate max and subcapacity token layouts
- Specialize TP-derived shapes from --tp 1/2/4 before importing kernels - Default to TP2 so the two-card CI runs the distributed output path - Validate max and subcapacity layouts through one TP-generic fixture
81fe974 to
4d7a6d1
Compare
output projection, and dependency-ordered FP32 reduce-scatter.
--tp 1/2/4at import time and defaultstandalone and CI execution to TP2.
decode_swa.py, reusethe shared output projection, and validate max and subcapacity layouts
with exact inactive-tail checks.