Repository navigation
[perf] feat: add profiler post hook, fix behaviors and allow comprehensive torch profiler - #7408
Merged
wuxibin89 merged 18 commits intoAug 19, 2026
Merged
Conversation
ETOgaosion
marked this pull request as ready for review
August 14, 2026 06:05
ETOgaosion
requested review from
PeterSH6,
eric-haibin-lin,
tongyx361,
vermouth1992,
wucong25 and
wuxibin89
as code owners
August 14, 2026 06:05
`ranks` are global GPU ranks (as in training roles). A tp>1 engine must profile its whole replica, so filter during trace relocation to keep only the requested GPUs: e.g. tp=2 ranks=[0,8] -> only GPU 0 and 8 in save_path, their tp-mates (1, 9) stay in the per-replica sub-directory. Relocated traces are named by absolute global rank (rollout-replica<n>-globalrank<g>_) so files line up with the configured ranks. Assisted-by: Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
ETOgaosion
force-pushed
the
feat/perf_with_post_hook
branch
from
August 14, 2026 06:11
594fad6 to
7093712
Compare
ETOgaosion
force-pushed
the
feat/perf_with_post_hook
branch
from
August 14, 2026 10:13
d6f1f28 to
bfae285
Compare
wuxibin89
reviewed
Aug 19, 2026
| # `ranks` in the rollout profiler config are global GPU ranks (as in the training roles); | ||
| # map them to the replica that owns them so e.g. ranks=[0, 8] with tp=8 profiles the replicas | ||
| # holding global ranks 0 and 8 (replicas 0 and 1), not replica indices 0 and 8. | ||
| self.replica_world_size = ( |
Collaborator
There was a problem hiding this comment.
Do we really need to profile rollout(vllm/sglang) in RL framework? Maybe prometheus metrics is a better option.
wuxibin89
approved these changes
Aug 19, 2026
This was referenced Oct 2, 2026
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?
Now torch profiler discrete mode creates:
When discrete=False, the actors' profiling results fused to actor-rollout-ref_train_step1_rank0-of-16_pid10256_20260814122731089.json
For compute log probs:
For Rollout:
For trainer:
For discrete=False:
Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI){modules}includefsdp,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,fully_async,one_step_off,like[megatron, fsdp, doc]{type}is infeat,fix,refactor,chore,test[BREAKING]to the beginning of the title.[BREAKING][fsdp, megatron] feat: dynamic batchingTest
API and Usage Example
# Add code snippet or script demonstrating how to use thisDesign & Code Changes
Checklist Before Submitting
Important
Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=alwaysci-requestchannel in theverlSlack workspace. (If not accessible, please try the Feishu group (飞书群).)recipesubmodule, please also update the reference to the submodule commit viagit submodule update --remoteorcd recipe && git pull origin main.