Skip to content

Conversation

@tardis-key
Copy link
Contributor

@tardis-key tardis-key commented Nov 24, 2025

What does this PR do?

  1. add role in annotate call for megatron_workers.py
  2. update doc

#4206

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, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • 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.

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 support for discrete profiling for MindSpeed on Ascend devices by adding a role parameter to @DistProfiler.annotate decorators in verl/workers/megatron_workers.py. This allows for more granular profiling data collection. The documentation has also been updated to reflect this new capability.

My main feedback is that the changes for discrete profiling seem incomplete. While the role parameter has been added to methods in ActorRolloutRefWorker, it's missing from similar annotations in CriticWorker and RewardModelWorker within the same file. Applying this change consistently would make the feature complete and more robust.

@tardis-key tardis-key changed the title [megatron] feat: support discrete profiling for mindspeed [WIP][megatron] feat: support discrete profiling for mindspeed Nov 24, 2025
This is a tutorial for data collection using the GRPO or DAPO algorithm
based on FSDP on Ascend devices.
This is a tutorial for performance data collection using the GRPO or DAPO algorithm
based on FSDP on Ascend devices, which is also applicable on MindSpeed(Megatron)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just describe like based on FSDP or MindSpeed (Megatron) on Ascend devices., same as chinese version.

@tardis-key tardis-key force-pushed the main branch 2 times, most recently from 892d57f to 9af5016 Compare November 26, 2025 06:28
@tardis-key
Copy link
Contributor Author

After configuring profiling for tests/speical_npu/run_qwen2_5_05b_grpo.sh, the profiling directory is as follows,

    • root
      | - actor_compute_log_prob
      | - actor_update
      | - ref_compute_log_prob

And the result of tests/speical_npu/run_qwen2_5_05b_grpo_mindspeed.sh are also consistent.

Due to an exception in collecting "generate" under AgentLoop, the "generate_sequences" folder was not obtained. This will be fixed in another PR.

@tardis-key tardis-key force-pushed the main branch 2 times, most recently from b890bf5 to bd7868c Compare November 26, 2025 08:10
@@ -1,10 +1,10 @@
Data collection based on FSDP backend on Ascend devices(en)
Data collection based on FSDP or MindSpeed(Megatron) on Ascend devices(en)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change title to Performance Data collection based on ..., same as the chinese version.


@register(dispatch_mode=make_nd_compute_dataproto_dispatch_fn(mesh_name="critic"))
@DistProfiler.annotate(color="pink")
@DistProfiler.annotate(color="pink", role="update_critic")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Align with actor, here role should be critic_update


@register(dispatch_mode=make_nd_compute_dataproto_dispatch_fn(mesh_name="critic"))
@DistProfiler.annotate(color="pink")
@DistProfiler.annotate(color="pink", role="update_critic")
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, change the role name to critic_update

@FightingZhen
Copy link
Collaborator

After configuring profiling for tests/speical_npu/run_qwen2_5_05b_grpo.sh, the profiling directory is as follows,

    • root
      | - actor_compute_log_prob
      | - actor_update
      | - ref_compute_log_prob

And the result of tests/speical_npu/run_qwen2_5_05b_grpo_mindspeed.sh are also consistent.

Due to an exception in collecting "generate" under AgentLoop, the "generate_sequences" folder was not obtained. This will be fixed in another PR.

Suggest fix the rollout period data unavailable error in this PR @tardis-key

@tardis-key
Copy link
Contributor Author

All review comments have been revised, and the pr has been rebased to latest code.

@tardis-key
Copy link
Contributor Author

tardis-key commented Dec 18, 2025

After configuring profiling for tests/speical_npu/run_qwen2_5_05b_grpo.sh, the profiling directory is as follows,

    • root
      | - actor_compute_log_prob
      | - actor_update
      | - ref_compute_log_prob

And the result of tests/speical_npu/run_qwen2_5_05b_grpo_mindspeed.sh are also consistent.
Due to an exception in collecting "generate" under AgentLoop, the "generate_sequences" folder was not obtained. This will be fixed in another PR.

Suggest fix the rollout period data unavailable error in this PR @tardis-key

#4320 is working on this. And that fix involves profiling of async inference engine and will take some time. As VeRL is to be released soon, it is recommended that this pr should be merged to enable the discrete profiling on MindSpeed.

@tardis-key tardis-key changed the title [WIP][megatron] feat: support discrete profiling for mindspeed [megatron] feat: support discrete profiling for mindspeed Dec 18, 2025
@FightingZhen FightingZhen merged commit b3e7678 into volcengine:main Dec 19, 2025
70 of 72 checks passed
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.

2 participants