MCPcopy Index your code
hub / github.com/NVIDIA-NeMo/RL / start

Method start

nemo_rl/utils/timer.py:79–83  ·  view source on GitHub ↗

Start timing for the given label.

(self, label: str)

Source from the content-addressed store, hash-verified

77 self._start_times: dict[str, float] = {}
78
79 def start(self, label: str) -> None:
80 """Start timing for the given label."""
81 if label in self._start_times:
82 raise ValueError(f"Timer '{label}' is already running")
83 self._start_times[label] = time.perf_counter()
84
85 def stop(self, label: str) -> float:
86 """Stop timing for the given label and return the elapsed time.

Callers 15

run_rolloutsMethod · 0.95
timeMethod · 0.95
__init__Method · 0.45
start_gpu_profilingMethod · 0.45
start_gpu_profilingMethod · 0.45
_setup_vllm_serverMethod · 0.45
start_gpu_profilingMethod · 0.45
apply_fp8_patchesFunction · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by 8

test_start_stopMethod · 0.36
test_get_elapsedMethod · 0.36
test_reset_allMethod · 0.36
test_precise_timingMethod · 0.36