Skip to content

Conversation

@yurekami
Copy link
Contributor

Summary

The Profiler class was using incorrect attribute names that don't exist in ProfilerConfig:

  1. Changed self.config.profile_ranks to self.config.ranks - the ProfilerConfig dataclass uses ranks, not profile_ranks

  2. Changed self.config.step_start/step_end to self.tool_config.step_start/step_end - these attributes exist on TorchProfilerToolConfig, not ProfilerConfig

Changes

  • verl/utils/profiler/profile.py:59: Fixed profile_ranksranks
  • verl/utils/profiler/profile.py:79-81: Fixed profile_ranksranks and condition check
  • verl/utils/profiler/profile.py:109: Fixed self.config.step_start/step_endself.tool_config.step_start/step_end

Test Plan

  • The changes align attribute names with ProfilerConfig definition in config.py
  • Verified that TorchProfilerToolConfig contains step_start and step_end fields

Fixes #4663

🤖 Generated with Claude Code

The Profiler class was using incorrect attribute names that don't exist
in ProfilerConfig:

1. Changed `self.config.profile_ranks` to `self.config.ranks` - the
   ProfilerConfig dataclass uses `ranks`, not `profile_ranks`

2. Changed `self.config.step_start/step_end` to
   `self.tool_config.step_start/step_end` - these attributes exist on
   TorchProfilerToolConfig, not ProfilerConfig

Fixes volcengine#4663

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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 correctly fixes several AttributeError bugs in the Profiler class by using the correct attribute names from ProfilerConfig and TorchProfilerToolConfig. The changes are accurate and address the issues described. I've added one suggestion to improve the file path construction in the save method, making it more robust and platform-independent by using os.path.join instead of string concatenation.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

Profile _validate fuction does not have config.profile_ranks attribute

2 participants