Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4e1c05e
[trainer, cfg] feat: Add AlgorithmConfig dataclass for type-safe algo…
openhands-agent Jun 20, 2025
9ed10fa
Complete algorithm config dataclass migration
openhands-agent Jun 21, 2025
646a1e7
Remove temporary test files
openhands-agent Jun 21, 2025
d7aa12b
Revert changes and rename algorithm config to algo config
openhands-agent Jun 21, 2025
109340d
Update compute_advantage type annotations and fix linting
openhands-agent Jun 21, 2025
89e4b34
Update all core_algos.py functions to use AlgoConfig type annotations
openhands-agent Jun 21, 2025
f0f406f
Fix compute_grpo_outcome_advantage function signature to include Algo…
openhands-agent Jun 21, 2025
637a358
Merge main into feat/algorithm-config-dataclass
openhands-agent Jun 22, 2025
9eeab2e
init frozen adaptor
eric-haibin-lin Jun 29, 2025
1b85290
move to profiler folder
eric-haibin-lin Jun 30, 2025
ba93223
backward compat namespace move
eric-haibin-lin Jun 30, 2025
da8d771
fix lint
eric-haibin-lin Jun 30, 2025
0b1cb62
remove omega_conf_to_dataclass type
eric-haibin-lin Jun 30, 2025
2c25c76
Refactor algorithm config classes to use frozen dataclasses and BaseC…
devin-ai-integration[bot] Jun 30, 2025
520b23d
Revert documentation changes and fix omega_conf_to_dataclass call
devin-ai-integration[bot] Jun 30, 2025
80685b4
Fix config.get() call in compute_advantage function
devin-ai-integration[bot] Jun 30, 2025
2df1773
Merge main branch and resolve conflicts
devin-ai-integration[bot] Jun 30, 2025
52c62b3
Fix lint issues after merge
devin-ai-integration[bot] Jun 30, 2025
562a111
Fix type annotation and docstring coverage issues
devin-ai-integration[bot] Jun 30, 2025
81d7edf
Add test_base_config_on_cpu.py to allow list and update omega_conf_to…
devin-ai-integration[bot] Jun 30, 2025
a6df414
fix test
eric-haibin-lin Jun 30, 2025
6e743a5
fix litn
eric-haibin-lin Jun 30, 2025
ffa8d77
convert to dataclass upfront
eric-haibin-lin Jun 30, 2025
12c22b8
Merge branch 'feat/algorithm-config-dataclass' of code.byted.org:data…
eric-haibin-lin Jun 30, 2025
e2fac2c
update import stmt
eric-haibin-lin Jun 30, 2025
969a734
merge with main
eric-haibin-lin Jun 30, 2025
69a1a17
fix lint
eric-haibin-lin Jun 30, 2025
f1f4047
add _target_ to megatron config
eric-haibin-lin Jun 30, 2025
7bcd0fe
fix ranks init
eric-haibin-lin Jun 30, 2025
0eacb9f
adjust line-len
eric-haibin-lin Jul 1, 2025
ac19891
adjust len=120
eric-haibin-lin Jul 1, 2025
c907607
merge with main
eric-haibin-lin Jul 1, 2025
e63bbb0
fix lint
eric-haibin-lin Jul 1, 2025
8bce67d
merge with master
eric-haibin-lin Jul 3, 2025
fb93f20
merge with main
eric-haibin-lin Jul 4, 2025
c195f00
Merge remote-tracking branch 'oss/main' into feat/algorithm-config-da…
eric-haibin-lin Jul 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix type annotation and docstring coverage issues
- Add return type annotation to BaseConfig.get() method
- Remove sppo_eta field from AlgoConfig class
- Add missing docstrings to profiler functions:
  - log_gpu_memory_usage in performance.py
  - mark_start_range, mark_end_range, mark_annotate in profile.py

Resolves Type Annotation and Docstring Coverage CI checks

Co-Authored-By: H <linhaibin.eric@gmail.com>
  • Loading branch information
devin-ai-integration[bot] and eric-haibin-lin committed Jun 30, 2025
commit 562a1112803a400b498545e780b5155001ec0acf
2 changes: 1 addition & 1 deletion verl/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class BaseConfig(collections.abc.Mapping):
This allows instances of this class to be used like dictionaries.
"""

def get(self, key: str, default: Any = None):
def get(self, key: str, default: Any = None) -> Any:
"""Get the value associated with the given key. If the key does not exist, return the default value.

Args:
Expand Down
3 changes: 0 additions & 3 deletions verl/trainer/config/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,3 @@ class AlgoConfig(BaseConfig):

# Filter groups parameters (used in DAPO and Entropy)
filter_groups: Optional[FilterGroupsConfig] = None # Filter groups configuration

# SPPO parameters
sppo_eta: Optional[float] = None # SPPO eta parameter
8 changes: 8 additions & 0 deletions verl/utils/profiler/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ def _get_current_mem_info(unit: str = "GB", precision: int = 2) -> Tuple[str]:


def log_gpu_memory_usage(head: str, logger: logging.Logger = None, level=logging.DEBUG, rank: int = 0):
"""Log GPU memory usage information.

Args:
head (str): A descriptive header for the memory usage log message.
logger (logging.Logger, optional): Logger instance to use for logging. If None, prints to stdout.
level: Logging level to use. Defaults to logging.DEBUG.
rank (int): The rank of the process to log memory for. Defaults to 0.
"""
if (not dist.is_initialized()) or (rank is None) or (dist.get_rank() == rank):
mem_allocated, mem_reserved, mem_used, mem_total = _get_current_mem_info()
message = f"{head}, memory allocated (GB): {mem_allocated}, memory reserved (GB): {mem_reserved}, device memory used/total (GB): {mem_used}/{mem_total}"
Expand Down
25 changes: 25 additions & 0 deletions verl/utils/profiler/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,39 @@ def stop_trace(self):


def mark_start_range(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> None:
"""Start a profiling range marker (no-op implementation).

Args:
message (Optional[str]): Message to associate with the range marker.
color (Optional[str]): Color for the marker visualization.
domain (Optional[str]): Domain for the marker.
category (Optional[str]): Category for the marker.
"""
pass


def mark_end_range(range_id: str) -> None:
"""End a profiling range marker (no-op implementation).

Args:
range_id (str): Identifier of the range to end.
"""
pass


def mark_annotate(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> Callable:
"""Decorator to annotate a function with profiling markers (no-op implementation).

Args:
message (Optional[str]): Message to associate with the annotation.
color (Optional[str]): Color for the marker visualization.
domain (Optional[str]): Domain for the marker.
category (Optional[str]): Category for the marker.

Returns:
Callable: Decorator function that returns the original function unchanged.
"""

def decorator(func):
return func

Expand Down