[M4] feat: Add M4 end2end qwen3_vl example#2117
Conversation
📝 WalkthroughWalkthroughThis PR threads a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/megatron/bridge/training/utils/train_utils.py (1)
571-584: Removepg_collectionparameter fromtrack_moe_metrics()call. The function does not accept this parameter and will raiseTypeErrorat runtime. Thepg_collectionparameter is for other Megatron-Core APIs likeTransformerModelandget_megatron_optimizer, not fortrack_moe_metrics().
🤖 Fix all issues with AI agents
In `@src/megatron/bridge/models/qwen_vl/modelling_qwen3_vl/transformer_block.py`:
- Line 32: Remove the unused import ProcessGroupCollection from
megatron.core.process_groups_config in transformer_block.py to fix the F401 lint
error; alternatively, if it was intended for typing, add it to a type-only
import (e.g., from typing import TYPE_CHECKING / inside an if TYPE_CHECKING
block) and reference it in relevant function/class annotations such as any
transformer block constructor or method that would accept process group types.
🧹 Nitpick comments (2)
src/megatron/bridge/models/qwen_vl/modelling_qwen3_vl/text_model.py (1)
63-64: UseProcessGroupCollection | Nonefor nullablepg_collection.As per coding guidelines: Use 'T | None' for nullable types instead of 'Optional[T]'.♻️ Proposed fix
- pg_collection: ProcessGroupCollection = None, + pg_collection: ProcessGroupCollection | None = None,src/megatron/bridge/models/qwen_vl/modelling_qwen3_vl/model.py (1)
63-64: UseProcessGroupCollection | Nonefor nullablepg_collection.As per coding guidelines: Use 'T | None' for nullable types instead of 'Optional[T]'.♻️ Proposed fix
- pg_collection: ProcessGroupCollection = None, + pg_collection: ProcessGroupCollection | None = None,
| from megatron.core.packed_seq_params import PackedSeqParams | ||
| from megatron.core.transformer.transformer_block import TransformerBlock | ||
| from megatron.core.utils import WrappedTensor, deprecate_inference_params, make_viewless_tensor | ||
| from megatron.core.process_groups_config import ProcessGroupCollection |
There was a problem hiding this comment.
Remove unused ProcessGroupCollection import (F401).
Static analysis flags this as unused; drop it or wire it into type hints.
🧹 Proposed fix
-from megatron.core.process_groups_config import ProcessGroupCollection📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| from megatron.core.process_groups_config import ProcessGroupCollection |
🧰 Tools
🪛 Flake8 (7.3.0)
[error] 32-32: 'megatron.core.process_groups_config.ProcessGroupCollection' imported but unused
(F401)
🤖 Prompt for AI Agents
In `@src/megatron/bridge/models/qwen_vl/modelling_qwen3_vl/transformer_block.py`
at line 32, Remove the unused import ProcessGroupCollection from
megatron.core.process_groups_config in transformer_block.py to fix the F401 lint
error; alternatively, if it was intended for typing, add it to a type-only
import (e.g., from typing import TYPE_CHECKING / inside an if TYPE_CHECKING
block) and reference it in relevant function/class annotations such as any
transformer block constructor or method that would accept process group types.
2cce048 to
ee07d70
Compare
|
/ok to test 603f213 |
22efc7d to
8fdb5a4
Compare
|
/ok to test 8fdb5a4 |
|
/ok to test 49569e7 |
49569e7 to
cc9b85f
Compare
|
/ok to test cc9b85f |
Signed-off-by: conver334 <conver334@gmail.com>
What does this PR do ?
Add M4 end2end qwen3vl example
How to Run
Changelog
GitHub Actions CI
See the CI sectionin 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