feat: Add context parallel support for Qwen3.5 MoE#1560
Merged
Conversation
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
- Unit tests for CPAwareGatedDeltaNet: extract_local_positions, undo/redo load balancing, conv1d boundary exchange, AllGatherConcatFn, forward fast path delegation, and init checks - Unit tests for parallelizer: apply_cp linear_attention branch coverage (cp_mesh attachment, warning paths, mixed full+linear attention) - Functional test: 2-GPU torchrun comparing CP=1 vs CP=2 forward outputs and gradients for GatedDeltaNet linear attention Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
CPAwareGatedDeltaNet inherits from HF GatedDeltaNet which stores hidden_size as a direct attribute, not under a config object. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
- Replace P2P-based conv1d boundary exchange with FLA's causal_conv1d that natively supports CP context - Refactor functional test baseline to use _forward_with_cp for consistent comparison with CP=2 - Simplify unit tests: consolidate edge cases into parametrized test, remove trivial TestInit and redundant TestAllGatherConcat Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
- Fix ruff format issues in cp_linear_attn.py and parallelizer.py - Pin flash-linear-attention to git commit 7cbe461b (includes fla.ops.cp) - Update uv.lock accordingly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
The override-dependencies block was injected by update_pyproject_pytorch.sh for container environments and should not be checked in. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Replace hard assert with warning + continue for blocks whose attn_module is not DotProductAttention, consistent with the linear_attention branch handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
Contributor
Author
|
/ok to test 4807fb2 |
@zpqiu, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
Contributor
Author
|
/ok to test 8978884 |
Contributor
|
/ok to test 8e70593 |
akoumpa
reviewed
Mar 19, 2026
Contributor
|
/ok to test b950cc9 |
akoumpa
approved these changes
Mar 19, 2026
Contributor
|
Thanks a lot @zpqiu for the contribution, very much appreciated. Please feel free to LMK if there's anything I can help with. |
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.
What does this PR do ?
Add CP support for Qwen3.5 MoE.
Changelog
Before your PR is "Ready for review"
Pre checks:
If you haven't finished some of the above items you can still open "Draft" PR.
Additional Information
Add context parallel support for Qwen3.5 #1498
Convergence Experiment