[feature] Add dense CP support for Qwen3-Omni - #3915
Conversation
Signed-off-by: hbhflw2000 <417911774@qq.com>
| ) | ||
|
|
||
|
|
||
| def pad_batch_sequences_for_context_parallel( |
There was a problem hiding this comment.
possible to re-use current utils?
There was a problem hiding this comment.
Thanks, this is a good point. I checked the existing CP helper. slice_batch_for_context_parallel operates after embedding merge and slices inputs_embeds, while this Qwen3-Omni path needs a pre-slice raw-batch normalization step so that Megatron's dense CP zigzag split receives tensors divisible by TP * CP * 2, while the full input_ids are still preserved for thinker-side mRoPE.
So I don't think directly reusing that helper is semantically safe here. The current code already reuses the shared padding primitives, but I agree the framework should probably have a clearer raw-batch sequence normalization utility. I can either add a clarifying comment in this PR, or follow up with a small utility extraction that can be shared by Qwen3-Omni and Qwen3-VL packed paths.
|
/ok to test 68bfc03 |
Signed-off-by: hbhflw2000 <417911774@qq.com> Signed-off-by: mollys <mollys@mollys.nvidia.com>
Signed-off-by: hbhflw2000 <417911774@qq.com> Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.com>
What does this PR do ?
Add dense context parallelism support for Qwen3-Omni thinker training.
Changelog
input_idsfor mRoPE while using local CP tensors for loss/attention.GitHub Actions CI
See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.
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
Validation:
ruff checkruff format --checkgit diff --check12 passed1 passedUpcoming follow-up:
Related to #3317