Skip to content

[Tracking] DeepSeek-v4 HybridModel merge plan - #5795

Draft
hxbai wants to merge 1 commit into
NVIDIA:mainfrom
hxbai:codex/dsv4-main-port
Draft

[Tracking] DeepSeek-v4 HybridModel merge plan#5795
hxbai wants to merge 1 commit into
NVIDIA:mainfrom
hxbai:codex/dsv4-main-port

Conversation

@hxbai

@hxbai hxbai commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

DeepSeek-v4 HybridModel merge plan

Summary

This PR is the merge guide for the DSv4 feature set frozen at the current
development cutoff. The implementation has been reconstructed on frozen
main bb5647a9bdd044af85ca323b1aef5ede02e96a37 as reviewable functional
units; historical PRs are behavioral provenance, not a commit sequence to
replay. This recut will not continuously refresh from main.

The final supported path is HybridModel only. This effort does not continuously
absorb later development-branch features.

Reusable prerequisites remain separate from the nine DSv4-specific children.
We will publish by dependency rounds: a child is opened only after its direct
bases merge, and is rebased onto current main so its GitHub diff contains
only that slice. We are not using stacked PRs for parallel review.

Existing external prerequisites

Fresh reusable prerequisites

DSv4-specific series

  • D1 — unfused SBHD compressed sparse attention ([PR TBD])
  • D2 — SBHD DSv4 orchestration and indexer-loss scaling ([PR TBD])
  • D3 — fused SBHD CSA/DSA backend ([PR TBD])
  • D4 — HybridModel DSv4 symbols, specs, and construction ([PR TBD])
  • D5 — packed THD CSA/DSA algorithms ([PR TBD])
  • D6 — packed THD DSv4 attention orchestration ([PR TBD])
  • D7 — static contiguous-CP layout and boundary primitives ([PR TBD])
  • D8 — static-CP DSv4 attention integration ([PR TBD])
  • D9 — Hybrid-only FLOP/MoE accounting, functional E2E, and GB200 64K recipe ([PR TBD]; H100 golden required before publication)

Dependency order

Reusable prerequisite edges:
P1 -> P2 -> {P3, P4}, P7 -> P8,
{#5008, P4, P7} -> P10, and {#5672, P4, P8} -> P11.
P9 depends on #4495. P4 and P10 are logically distinct features despite their
router-code dependency.

DSv4 edges: {P1, P6} -> D1, {D1, P6} -> D2,
D2 -> D3, {D2, P2} -> D4, {D3, P6} -> D5,
{D2, D5} -> D6, D5 -> D7, {D6, D7, P9, P11} -> D8,
and {D4, D8, all recipe prerequisites} -> D9.

The braces indicate work that may be reviewed in the same publication round
after its shared base has merged; they are not stacked review branches.

Detached work

The following work is independent of this frozen DSv4 merge and is linked for
provenance only:

Item Relationship
#4452 Generic Hybrid MLA plus/QK-norm support; not consumed by the frozen recipe
#5412 Legacy fused-MLA query-alias compatibility gate; not a dependency
#5931 / #5485 Nested full-iteration CUDA-graph buffers; separate execution mode
#5933 + #5934 / #2987 Optimizer-state offload; pursue as one independent end-to-end PR if desired

Explicit non-goals

  • GPTModel support
  • Dynamic context parallelism
  • SFT-specific packing extensions
  • Optimizer-state offload
  • Full-iteration CUDA-graph support
  • Features developed after the frozen cutoff

Original authors and contributors remain credited in each reconstructed PR
through links to the relevant source PRs.

Each published slice is recreated as one signed, signed-off commit on its
publication base. Round-0 links above are live; later links are added only
after their direct dependencies merge.

@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

FDecaYed added a commit to FDecaYed/Megatron-LM that referenced this pull request Jul 21, 2026
Add configurable boundary-fill semantics and roll packed THD MTP inputs across contiguous context-parallel shards without crossing sequence boundaries.

Reconstructed from the MTP portion of NVIDIA#5795 on top of the padded-cu-seqlens fix in NVIDIA#4495.

Signed-off-by: Deyu Fu <Deyu.Foo@gmail.com>
FDecaYed added a commit to FDecaYed/Megatron-LM that referenced this pull request Jul 21, 2026
Add the unfused compressed sparse attention algorithm, inert configuration fields, and focused algorithm coverage without enabling a model variant.

Reconstructed from NVIDIA#4458 and its corrections as part of the frozen feature set in NVIDIA#5795.

Signed-off-by: Deyu Fu <Deyu.Foo@gmail.com>
FDecaYed added a commit to FDecaYed/Megatron-LM that referenced this pull request Jul 21, 2026
Enable SBHD-only DSv4 Hybrid attention orchestration, model-variant validation, backend-explicit specs, and MTP layer-ratio plumbing.

Reconstructed from NVIDIA#4458, NVIDIA#4518, NVIDIA#5018, and NVIDIA#5526 as part of the frozen feature set in NVIDIA#5795.

Signed-off-by: Deyu Fu <Deyu.Foo@gmail.com>
FDecaYed added a commit to FDecaYed/Megatron-LM that referenced this pull request Jul 21, 2026
Map the canonical padded vocabulary size into TransformerConfig for hash routing and hide the redundant generated CLI field.

Reconstructed from NVIDIA#4481 and the frozen feature set in NVIDIA#5795.

Signed-off-by: Deyu Fu <Deyu.Foo@gmail.com>
Replace the historical aggregate with the frozen HybridModel-only feature oracle used to define the reviewable prerequisite and DSv4 slices. Exclude GPTModel support, dynamic context parallelism, SFT-specific packing, optimizer-state offload, and full-iteration CUDA graphs. Align the HybridEP padding flag with the current NVIDIA#5008 contract.

Signed-off-by: Deyu Fu <deyuf@nvidia.com>
@FDecaYed
FDecaYed force-pushed the codex/dsv4-main-port branch from 9596ade to 234919d Compare July 23, 2026 15:53
@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

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.

@FDecaYed FDecaYed changed the title [main] DeepSeek-v4 full support on main [Tracking] DeepSeek-v4 HybridModel merge plan Jul 23, 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.

2 participants