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
adjust len=120
  • Loading branch information
eric-haibin-lin committed Jul 1, 2025
commit ac198911b082ae274ececfd7d82c8649c0897636
13 changes: 12 additions & 1 deletion verl/utils/profiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@
from .performance import marked_timer
from .profile import DistProfiler, mark_annotate, mark_end_range, mark_start_range

__all__ = ["GPUMemoryLogger", "log_gpu_memory_usage", "mark_start_range", "mark_end_range", "mark_annotate", "DistProfiler", "DistProfilerExtension", "ProfilerConfig", "simple_timer", "marked_timer"]
__all__ = [
"GPUMemoryLogger",
"log_gpu_memory_usage",
"mark_start_range",
"mark_end_range",
"mark_annotate",
"DistProfiler",
"DistProfilerExtension",
"ProfilerConfig",
"simple_timer",
"marked_timer",
]
14 changes: 12 additions & 2 deletions verl/utils/profiler/empty_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@
from typing import Callable, Optional


def mark_start_range(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> None:
def mark_start_range(
message: Optional[str] = None,
color: Optional[str] = None,
domain: Optional[str] = None,
category: Optional[str] = None,
) -> None:
pass


def mark_end_range(range_id: str) -> None:
pass


def mark_annotate(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> Callable:
def mark_annotate(
message: Optional[str] = None,
color: Optional[str] = None,
domain: Optional[str] = None,
category: Optional[str] = None,
) -> Callable:
def decorator(func):
return func

Expand Down
29 changes: 25 additions & 4 deletions verl/utils/profiler/nvtx_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
from .profile import DistProfiler, ProfilerConfig


def mark_start_range(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> None:
def mark_start_range(
message: Optional[str] = None,
color: Optional[str] = None,
domain: Optional[str] = None,
category: Optional[str] = None,
) -> None:
"""Start a mark range in the profiler.

Args:
Expand All @@ -49,7 +54,12 @@ def mark_end_range(range_id: str) -> None:
return nvtx.end_range(range_id)


def mark_annotate(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> Callable:
def mark_annotate(
message: Optional[str] = None,
color: Optional[str] = None,
domain: Optional[str] = None,
category: Optional[str] = None,
) -> Callable:
"""Decorate a function to annotate a mark range along with the function life cycle.

Args:
Expand All @@ -71,7 +81,13 @@ def decorator(func):


@contextmanager
def marked_timer(name: str, timing_raw: Dict[str, float], color: str = None, domain: Optional[str] = None, category: Optional[str] = None):
def marked_timer(
name: str,
timing_raw: Dict[str, float],
color: str = None,
domain: Optional[str] = None,
category: Optional[str] = None,
):
"""Context manager for timing with NVTX markers.

This utility function measures the execution time of code within its context,
Expand Down Expand Up @@ -128,7 +144,12 @@ def stop(self):
torch.cuda.profiler.stop()

@staticmethod
def annotate(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> Callable:
def annotate(
message: Optional[str] = None,
color: Optional[str] = None,
domain: Optional[str] = None,
category: Optional[str] = None,
) -> Callable:
"""Decorate a Worker member function to profile the current rank in the current training step.

Requires the target function to be a member function of a Worker, which has a member field `profiler` with NightSystemsProfiler type.
Expand Down
8 changes: 7 additions & 1 deletion verl/utils/profiler/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ def simple_timer(name: str, timing_raw: Dict[str, float]):


@contextmanager
def marked_timer(name: str, timing_raw: Dict[str, float], color: str = None, domain: Optional[str] = None, category: Optional[str] = None):
def marked_timer(
name: str,
timing_raw: Dict[str, float],
color: str = None,
domain: Optional[str] = None,
category: Optional[str] = None,
):
"""Context manager for timing with platform markers.

This utility function measures the execution time of code within its context,
Expand Down
25 changes: 21 additions & 4 deletions verl/utils/profiler/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def _validate(self):
self.config.profile_ranks = [0]
assert self.config.step_start >= 0, "[ERROR] Profile step start must be greater than 0"
assert self.config.step_end >= 0, "[ERROR] Profile step end must be greater than 0"
assert self.config.step_start < self.config.step_end, "[ERROR] Profile step start must be less than step end"
assert self.config.step_start < self.config.step_end, (
"[ERROR] Profile step start must be less than step end"
)

def check(self):
return self.prof is not None and not self.skip_prof
Expand Down Expand Up @@ -112,7 +114,12 @@ def stop_trace(self):
self.skip_prof = True


def mark_start_range(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> None:
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:
Expand All @@ -133,7 +140,12 @@ def mark_end_range(range_id: str) -> None:
pass


def mark_annotate(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> Callable:
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:
Expand Down Expand Up @@ -174,7 +186,12 @@ def stop(self):
pass

@staticmethod
def annotate(message: Optional[str] = None, color: Optional[str] = None, domain: Optional[str] = None, category: Optional[str] = None) -> Callable:
def annotate(
message: Optional[str] = None,
color: Optional[str] = None,
domain: Optional[str] = None,
category: Optional[str] = None,
) -> Callable:
def decorator(func):
return func

Expand Down