Skip to content

Disag MR3: Add heterogeneous KV/Mamba reshard planners - #5188

Merged
wdykas merged 1 commit into
NVIDIA:mainfrom
wdykas:dynamo-kv-reshard
Jun 22, 2026
Merged

Disag MR3: Add heterogeneous KV/Mamba reshard planners#5188
wdykas merged 1 commit into
NVIDIA:mainfrom
wdykas:dynamo-kv-reshard

Conversation

@wdykas

@wdykas wdykas commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Pure range-intersection planners that map a request's paged KV (and Mamba conv/ssm state) from a source parallelism to a differently-sharded destination -- the math a disaggregated prefill->decode handoff needs.

  • I, the PR author, have personally reviewed every line of this PR.

What does this PR do ?

⚠️ For major changes (either in lines of code or in its impact), please make sure to first share a design doc with the team. If you're unsure what's the best way to do so, contact @NVIDIA/mcore-oncall.

Issue tracking

For PRs from open-source community contributors:

  • New features: a linked issue is required. Please open a feature request and reference it here before submitting the PR.
  • Small updates (bug fixes, minor improvements): a linked issue is recommended and will accelerate the PR review process.

Linked issue:

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

Code review

Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!

All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.

Step 1: Mark PR as "Ready for Review"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

Step 2: Final Review

For PRs that change megatron/core, once all expert reviewers have approved, the Final Review label is applied automatically and final reviewers are assigned.

For PRs outside megatron/core, this step is skipped.

Step 3: Approved

Once all required reviewers have approved, the Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

@wdykas
wdykas requested review from a team as code owners June 5, 2026 17:36
@copy-pr-bot

copy-pr-bot Bot commented Jun 5, 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.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This PR has been automatically converted to draft because all PRs must start as drafts.

When you are ready for review, click Ready for Review to begin the review process. This will:

  1. Add the oncall reviewer (optional reviewer)
  2. Add required review teams based on your changes

See the contribution guide for more details.

@svcnvidia-nemo-ci
svcnvidia-nemo-ci marked this pull request as draft June 5, 2026 17:36
@wdykas
wdykas force-pushed the dynamo-kv-reshard branch 9 times, most recently from 8f7c7c8 to bfd7580 Compare June 8, 2026 17:42
Comment on lines +44 to +48
global_rank: int
tp_size: int
tp_rank: int
layer_start: int # global Mamba-layer index of this rank's first layer
num_layers: int # Mamba layers held locally (this PP stage)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to pass a process group object here instead of the individual config fields?

@wdykas
wdykas marked this pull request as ready for review June 16, 2026 14:38
@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team June 16, 2026 14:38
@svcnvidia-nemo-ci svcnvidia-nemo-ci added Approved All necessary approvals have been made complexity: medium labels Jun 16, 2026
@wdykas

wdykas commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8651d77

@wdykas

wdykas commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test cab03e5

Signed-off-by: wdykas <wdykas@nvidia.com>
@wdykas
wdykas force-pushed the dynamo-kv-reshard branch from cbb85f8 to 40b87bd Compare June 22, 2026 19:02
@wdykas

wdykas commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 40b87bd

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/27984695431

Merged via the queue into NVIDIA:main with commit 93a7642 Jun 22, 2026
84 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved All necessary approvals have been made complexity: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants