[DFlash2] Add configurable MoE draft FFN - #1059
Draft
qianlihuang wants to merge 1 commit into
Draft
Conversation
Signed-off-by: qianlihuang <yiliu.dong@qq.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews
🔴 Require approval from approved reviewers listWaiting for any of
This rule is failing.All pull requests must have at least one approving review from a member of the approved reviewers list before merging.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Refs #1057.
Make the DFlash2 feed-forward implementation configurable while preserving the existing attention, convolution, selector, and draft-block paths.
draft_ffn_type=moeadds a Qwen3.5-compatible routed-plus-shared expert block;denseremains the default.The checkpoint contract stores fused routed-expert tensors as
[experts, 2 * intermediate, hidden]and[experts, hidden, intermediate], while MoE geometry remains outside the shared attention config. Invalid top-k geometry fails closed.This first PR intentionally excludes router auxiliary loss, routing diagnostics, verifier warm start, expert parallelism, and serving-runtime changes so those concerns can be reviewed independently.
Tests
The focused suite covers dense-default compatibility, config serialization, fused checkpoint keys, non-mutating model config, fail-closed geometry, and reference MoE forward/backward. The skipped test requires CUDA.
Checklist
I have filled in: