feat(rollout): add rollout-side torch profiler trigger via sglang#2038
Open
niu0421 wants to merge 1 commit into
Open
feat(rollout): add rollout-side torch profiler trigger via sglang#2038niu0421 wants to merge 1 commit into
niu0421 wants to merge 1 commit into
Conversation
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.
Add CLI-driven torch profiler support for the rollout (sglang) side, complementing the existing train-side --profile-target.
Currently, profiling sglang engines during rollout requires manually calling the /start_profile HTTP endpoint. This PR exposes the
existing SGLangEngine.start_profile() / stop_profile() API through RolloutManager, triggered at a user-specified rollout_id.
Changes:
engine.start_profile.remote() / engine.stop_profile.remote() on all rollout engines
Usage:
--rollout-profile-start-rollout-id 1
--rollout-profile-num-steps 10
--rollout-profile-output-dir /tmp/rollout_traces
Validation:
Tested with tests/test_qwen2.5_0.5B_async_short.py on 4×H20: