Skip to content

Fix(deepseek-v4 pro): let MoE post_ffn use automatic dependency tracking - #879

Open
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:fix/moe-remove-post-ffn-manual-dep
Open

Fix(deepseek-v4 pro): let MoE post_ffn use automatic dependency tracking#879
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:fix/moe-remove-post-ffn-manual-dep

Conversation

@yanghaoran29

Copy link
Copy Markdown
Contributor

Summary

  • Remove manual_dep=True from MoE post_ffn so the framework tracks the real hc_prehc_post producer/consumer edge.
  • Keeps post_ffn from being treated as an independent buffer that can race under EP scheduling.

Test plan

  • moe.py -p a5 with fixed moe_scale_aligned_fixture, 5 runs across device pairs 0,1 / 2,3 / 1,2
  • All 5 PASS under mainline gate (rdiff>0.3%, allow ≤5%); over-threshold ratio ≈ 2.13%–2.14%
  • CI / review confirmation on a5 EP2 MoE

Made with Cursor

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The MoE post_ffn allocation no longer requests manual dependency management. Its tensor shape and FP32 data type remain unchanged.

Changes

MoE dependency update

Layer / File(s) Summary
Update post_ffn allocation
models/deepseek/v4-pro/moe.py
The allocation removes manual_dep=True and keeps the [T, HC_MULT] FP32 tensor shape.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Poem

A rabbit checks the tensor line,
No manual ties remain to bind.
Its shape stays steady, clear, and bright,
FP32 hops through the night.
post_ffn now runs free—
A tidy change for MoE!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: enabling automatic dependency tracking for the DeepSeek V4 Pro MoE post_ffn operation.
Description check ✅ Passed The description explains the dependency-tracking change, its scheduling purpose, and the completed test results.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yanghaoran29
yanghaoran29 force-pushed the fix/moe-remove-post-ffn-manual-dep branch 2 times, most recently from c75fa41 to 35ccc30 Compare July 31, 2026 09:19
manual_dep=True on post_ffn was blocking the real hc_pre → hc_post edge,
so hc_post could observe stale post_ffn under EP scheduling.
@yanghaoran29
yanghaoran29 force-pushed the fix/moe-remove-post-ffn-manual-dep branch from 35ccc30 to 22fea4a Compare July 31, 2026 09:20
@yanghaoran29 yanghaoran29 changed the title Fix: let MoE post_ffn use automatic dependency tracking Fix(deepseek-v4 pro): let MoE post_ffn use automatic dependency tracking Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant