Add HybridModel hash MoE routing - #6403
Draft
FDecaYed wants to merge 4 commits into
Draft
Conversation
Rematerialize the full current diff of NVIDIA#5929 at 1b35b41 onto the pinned main base. Co-authored-by: Hongxiao Bai <hongxiaob@nvidia.com> Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Rematerialize the full current diff of NVIDIA#4531 at f1df30c onto the pinned main base, retaining the current-main partial CUDA graph cleanup. Co-authored-by: Yan Xu <yxu1@nvidia.com> Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com> Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Rematerialize frozen P2 9f86bee988afdab12ca34906f3ac16fafb872691 on current main plus the current NVIDIA#5929 and NVIDIA#4531 prerequisites, preserving current-main fused MLA construction. Include the post-frozen FP32 mapping correctness fix from dev d8b7108. Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Rematerialize frozen P4 eeac0315e9058f8b9eb71898b9bde1879873ab15 on the P2 candidate. Preserve current-main partial CUDA graph dispatcher outputs while forwarding token IDs required by hash routing. Signed-off-by: Deyu Fu <deyuf@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
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.
Add HybridModel hash MoE routing
Summary
Add complete Hash MoE behavior for HybridModel, from token-ID transport through router selection, MoE execution, metrics, recompute, and gradient finalization.
Scope
Non-goals
Review boundary and dependencies
Requires #6401 (P2). The local branch temporarily carries P2 and its #5929/#4531 prerequisites, but this PR’s own review commit is:
c9657bcd64c91a375e242a013aab3cc3a6731c71Its exact own diff is 16 files, +946/-45. Please review that commit only. This will target
main, not apull-request/<P2>base; after P2 merges, the own commit will be rebased onto currentmain.Provenance
Reconstructed from the Hash MoE behavior tracked by #5795, including the focused recuts #5938 and #5945. The original feature and forced-routing correction came from #4481 and #5130.
Validation
Completed locally:
Signed-off-bytrailer;git diff --check;Black 26.3.1 passes 14 of 16 files. The two whole-file failures in
megatron/training/argument_utils.pyandmegatron/training/arguments.pyare identical on the P2 parent; P4 adds only one non-formatting line to each. Isort passes 15 of 16 files; thearguments.pyfailure is also present on the P2 parent, and P4 changes no imports there.Runtime pytest is unavailable in the bare macOS environment because PyTorch/CUDA is not installed. Focused CUDA tests and full functional CI remain required after publication. No dependency or lock-file change is part of this commit.
Local artifact
P4-hybrid-hash-moe-routing.patch, generated from the own commit only. Verify it against SHA256SUMS.
Before publication
After P2 merges, replay this own commit onto then-current
main; recheck current router, partial CUDA-graph, MTP, and gradient-finalization contracts; rerun focused/static validation; then verify signing/trailers and launch full functional CI.