Skip to content

Comments

[megatron] feat: add script for qwen3_235b_grpo training on npu platform#5242

Draft
wangshuyang31 wants to merge 2 commits intoverl-project:mainfrom
wangshuyang31:wangshuyang31-patch-1
Draft

[megatron] feat: add script for qwen3_235b_grpo training on npu platform#5242
wangshuyang31 wants to merge 2 commits intoverl-project:mainfrom
wangshuyang31:wangshuyang31-patch-1

Conversation

@wangshuyang31
Copy link

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, veomni, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new training script for qwen3_235b_grpo on an NPU platform. The script configures various environment variables and hyperparameters for a verl.trainer.main_ppo training run. My review identified two critical issues in the shell script that would prevent it from executing correctly. One is a typo in a Hydra override argument, and the other is an incorrect placement of shell redirection, which would lead to some arguments being ignored. I have provided suggestions to resolve these issues.

Comment on lines +153 to +155
trainer.device=npu 2>&1 | tee "logs/$(date +%Y%m%d_%H%M).log" \
+actor_rollout_ref.rollout.engine_kwargs.vllm.compilation_config.cudagraph_capture_sizes="[8, 16, 32, 64, 128]" \
+actor_rollout_ref.rollout.engine_kwargs.vllm.compilation_config.cudagraph_mode="FULL_DECODE_ONLY" \
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The shell redirection 2>&1 | tee ... is misplaced in the middle of the python3 command's arguments. This will cause all subsequent arguments (lines 154-155) to be piped to tee instead of being passed to the Python script. Additionally, the trailing backslash \ on the last line is a syntax error. The redirection should be moved to the end of the entire command to ensure all arguments are correctly passed to the script.

Suggested change
trainer.device=npu 2>&1 | tee "logs/$(date +%Y%m%d_%H%M).log" \
+actor_rollout_ref.rollout.engine_kwargs.vllm.compilation_config.cudagraph_capture_sizes="[8, 16, 32, 64, 128]" \
+actor_rollout_ref.rollout.engine_kwargs.vllm.compilation_config.cudagraph_mode="FULL_DECODE_ONLY" \
trainer.device=npu \
+actor_rollout_ref.rollout.engine_kwargs.vllm.compilation_config.cudagraph_capture_sizes="[8, 16, 32, 64, 128]" \
+actor_rollout_ref.rollout.engine_kwargs.vllm.compilation_config.cudagraph_mode="FULL_DECODE_ONLY" 2>&1 | tee "logs/$(date +%Y%m%d_%H%M).log"

trainer.save_freq=100 \
trainer.total_epochs=1 \
trainer.default_local_dir="${CKPTS_DIR}" \
trainer.device=npu 2>&1 | tee "logs/$(date +%Y%m%d_%H%M).log" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

trainer.device=npu 2>&1 | tee "logs/$(date +%Y%m%d_%H%M).log" \这一行 2>&1 | tee "logs/$(date +%Y%m%d_%H%M).log应该放在结尾

@wangshuyang31 wangshuyang31 marked this pull request as draft February 9, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants