[feat](kt-kernel): add native MXFP4 routed-expert LoRA SFT - #2185
Open
yyj6666667 wants to merge 2 commits into
Open
[feat](kt-kernel): add native MXFP4 routed-expert LoRA SFT#2185yyj6666667 wants to merge 2 commits into
yyj6666667 wants to merge 2 commits into
Conversation
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.
What does this PR do?
This PR adds standalone CPU LoRA forward/backward support for DeepSeek V4 native MXFP4 routed experts.
Main changes:
dXdirectly from packed row-major weights, without an additional transposed base-weight copy.The scope of this PR is one CPU routed-expert MoE layer. Whole-model DeepSeek V4 attention backward and training-framework integration are left for a follow-up.
Related to #1921.
Tests
0.008501, minimum cosine0.999965.DeepSeek-V4-Flash-0731layer 3 smoke: 256 experts, H=4096, I=2048, top-k=6, rank=8; TP1 and TP2 passed.0.007374, minimum cosine0.999973; inactive expert gradients remained zero and the packed base checksum was unchanged after backward and a LoRA update.Before submitting