curobo.profiling module

Profiling utilities for cuRobo.

Lightweight timing helpers for measuring GPU work. Timer behavior is gated by curobo.runtime.cuda_event_timers; when disabled, timers are no-ops and return 0.0 with minimal overhead.

Example

from curobo.profiling import CudaEventTimer

timer = CudaEventTimer().start()
# ... GPU work ...
elapsed_seconds = timer.stop()
class CudaEventTimer

Bases: object

Lightweight CUDA event-based timer for accurate GPU timing.

Uses CUDA events instead of CPU time + synchronize for more accurate GPU timing without blocking the entire device.

Example

>>> timer = CudaEventTimer().start()
>>> # ... GPU work ...
>>> elapsed_seconds = timer.stop()

The timer respects runtime.cuda_event_timers. When disabled, stop() returns 0.0 with minimal overhead.

Initialize the timer.

__init__()

Initialize the timer.

start()

Start the timer by recording a CUDA event.

Return type:

CudaEventTimer

Returns:

Self for method chaining.

stop()

Stop the timer and return elapsed time in seconds.

This synchronizes only on the end event, not the entire device.

Return type:

float

Returns:

Elapsed time in seconds, or 0.0 if timing is disabled.