Skip to content

[Backport] Fix Qwen3.5 context parallel in core_dev_r0.16.0 - #4873

Open
mid2doubao wants to merge 1 commit into
NVIDIA:core_dev_r0.16.0from
mid2doubao:fix-qwen3.5-cp-r0.16
Open

[Backport] Fix Qwen3.5 context parallel in core_dev_r0.16.0#4873
mid2doubao wants to merge 1 commit into
NVIDIA:core_dev_r0.16.0from
mid2doubao:fix-qwen3.5-cp-r0.16

Conversation

@mid2doubao

Copy link
Copy Markdown

When integrating mcore with ms-swift/llamafactory for Qwen3.5 context parallel (CP), the core_dev_r0.16.0 branch encounters the same bug resolved in #3529. This commit backports the fix from main to core_dev_r0.16.0 to unblock Qwen3.5 CP training.

What does this PR do ?

This PR backports the context parallel (CP) fix for Qwen3.5 from PR #3529 to the core_dev_r0.16.0 branch.

Motivation & Context:
While integrating Megatron Core with downstream open-source frameworks (such as LLaMA-Factory and ms-swift) to support Qwen3.5 with Context Parallelism (CP), the ms-swift documentation explicitly points out that Qwen3.5 CP is currently ONLY supported in mcore dev branches.

Consequently, we are relying on the latest dev branch, core_dev_r0.16.0. However, during Qwen3.5 training on this branch, we encountered the exact same bug that was previously resolved in the main branch via PR #3529. This critical fix has not yet been synchronized to core_dev_r0.16.0.

To unblock Qwen3.5 CP training for the open-source community relying on this latest dev branch, this PR backports the specific changes from #3529 (commit 6c02944) to core_dev_r0.16.0. I have verified locally that this synchronization successfully resolves the issue.

⚠️ 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: Related to #3529
(Reference Commit from main: 6c02944)

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

(Note for reviewers: As this is a pure backport of the already approved and merged PR #3529, no new logic is introduced beyond what was previously tested and reviewed in main.)

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.

For MRs into `dev` branch The proposed review process for `dev` branch is under active discussion.

MRs are mergable after one approval by either eharper@nvidia.com or zijiey@nvidia.com.

When integrating mcore with ms-swift/llamafactory for Qwen3.5 context parallel (CP), the core_dev_r0.16.0 branch encounters the same bug resolved in NVIDIA#3529. This commit backports the fix from main to core_dev_r0.16.0 to unblock Qwen3.5 CP training.
@mid2doubao
mid2doubao requested review from a team as code owners May 19, 2026 16:53
@copy-pr-bot

copy-pr-bot Bot commented May 19, 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.

@mid2doubao

Copy link
Copy Markdown
Author

@NVIDIA/mcore-oncall Hi team! This is a pure backport from main (#3529) to unblock Qwen3.5 Context Parallelism for downstream integrations (like ms-swift/llamafactory) on the latest dev branch.

Could you please help approve the workflow run and take a look when you have a moment? Thanks!

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants