Add HybridModel DeepSeek-V4 layer construction - #6405
Draft
FDecaYed wants to merge 12 commits into
Draft
Conversation
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
(cherry picked from commit b7c36fa) Signed-off-by: Hongxiao Bai <hongxiaob@nvidia.com> Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@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>
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 DeepSeek-V4 layer construction
Summary
Add HybridModel symbols, specs, ratio handling, and construction for DeepSeek-V4 after the native attention and mHC runtime contracts are available.
Scope
Dand MLA+symbols.hybrid_dsv4_stack_speccallable and callable-spec handling in training and builder entry points.dsv4_hybridand MLA use from C/H/W patterns.csa_compress_ratios, validating each ratio against its symbol.Production diff: 6 files, +195/-20. Test diff: 3 files, +153/-136.
Non-goals
Review boundary and dependencies
Requires #6402 (D2) and #6401 (P2); D3 is not a dependency. The local branch is built on D2 and temporarily carries:
993fe75090— patch-equivalent to the current [Split 1/N of #3430] feat(mHC): basic pytorch implementation of manifold hyper connection #4531 prerequisite;2ebb42e43c— patch-equivalent to P2;a82126a5621b09cfda5abaa1c16b90640c10bedb— this PR’s own change.The exact own diff is 9 files, +348/-156. Please review the last commit only. After D2 and P2 merge, the own commit will be replayed directly onto then-current
main.Provenance
Reconstructed from current HybridModel APIs plus the post-#6020 DSv4 residual. #5795 is the historical behavior/test oracle, #6372 defines the current CSA namespace, and #5960 supplies attention-teacher correctness inherited through D1/D2.
Validation
Passed locally:
Signed-off-bytrailer;git diff --check, and focused API/import scans;Black’s whole-file checks for
megatron/training/argument_utils.pyandmegatron/training/arguments.pyretain the same baseline formatting failures; the D4 hunks introduce no new formatting regression. Runtime pytest is blocked on the bare macOS environment without the Linux CUDA stack. Focused GPU tests and full functional CI remain required after publication.Current functional constraint
C/H/W layers currently require explicitly selecting the callable
hybrid_dsv4_stack_specwithtransformer_impl='transformer_engine'. Omitting the DSv4 spec or selecting an inference-optimized/default stack can leave the new submodule slots asIdentityOp; those configurations are unsupported and must not be advertised. A later early-rejection check is optional and does not block this construction slice.Sibling rebase constraint
D4 can merge without #6404 (D3). Both touch
megatron/training/argument_utils.pyandmegatron/training/arguments.py; if D3 merges first, D4’s rebase must retain D3’s omitted-versus-explicit backend resolution while adding the C/H/W inference and ratio normalization here.Local artifact
D4-hybrid-dsv4-layer-construction.patch, generated from the own commit only. Verify it against SHA256SUMS.
Before publication
After D2 and P2 merge, replay only D4’s own commit onto current
main, preserve any already-merged D3 backend-default logic, confirm the final HybridModel/mHC call signatures and explicit-spec constraint, then rerun focused construction/forward tests and full functional CI.