Add: compose DeepSeek V4 HCA decode TP output - #938
zhangqi-chen merged 1 commit into
Conversation
📝 WalkthroughWalkthroughAdded a complete DeepSeek-V4 HCA decode output path for context parallelism. The module includes distributed JIT kernels, deterministic fixtures, a PyTorch golden model, active-row and sentinel-tail comparison, and a configurable CLI runner. ChangesHCA output context parallelism
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI as CLI test runner
participant Launcher as l3_decode_hca_output_cp
participant Kernel as decode_hca_output_cp
participant Runtime as Distributed runtime
participant Golden as golden_decode_hca_output_cp
CLI->>Launcher: Run selected fixture
Launcher->>Runtime: Allocate communication windows and signals
Launcher->>Kernel: Execute across SP ranks
Kernel->>Runtime: Exchange attention data and reduce-scatter output
CLI->>Golden: Compute reference output
CLI->>Golden: Compare active rows and sentinel tail
Possibly related PRs
Suggested labels: 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@models/deepseek_v4_flash_dspark/decode_hca_output_cp.py`:
- Around line 60-78: Add an import-time ValueError guard alongside the existing
fixture validation checks to ensure CMP_TOPK is greater than
max(FIXTURE_CMP_SLOTS). Use a descriptive message explaining that the fixture
compressed slots exceed the configured top-k capacity, before any fixture
execution or golden validation occurs.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9b40ae86-e5d6-4e12-b2fc-3a575a215b1c
📒 Files selected for processing (1)
models/deepseek_v4_flash_dspark/decode_hca_output_cp.py
70d61b9 to
279be3f
Compare
279be3f to
90464b6
Compare
ebf199e to
6d3b0a4
Compare
- Chain rank-local HCA heads through TP token/head exchange, sharded output projection, and dependency-ordered FP32 reduce-scatter. - Select TP-derived shapes from `--tp 1/2/4` at import time and default standalone and CI execution to TP2. - Consolidate the TP output path and fixtures into `decode_hca.py`, reuse the shared output projection, and validate dynamic caches, compressed slots, inverse RoPE, and inactive capacity tails.
6d3b0a4 to
e3c2397
Compare
output projection, and dependency-ordered FP32 reduce-scatter.
--tp 1/2/4at import time and defaultstandalone and CI execution to TP2.
decode_hca.py,reuse the shared output projection, and validate dynamic caches,
compressed slots, inverse RoPE, and inactive capacity tails.