perf
Utility functions for performance measurement.
Classes
A Timer that can be used as a decorator as well. |
Functions
Clear the CUDA cache. |
|
Get memory usage of specified GPU in Bytes. |
|
Simple GPU memory report. |
- class Timer
Bases:
ContextDecorator
A Timer that can be used as a decorator as well.
- __init__(name='')
Initialize Timer.
- start()
Start the timer.
- stop()
End the timer.
- Return type:
float
- clear_cuda_cache()
Clear the CUDA cache.
- get_cuda_memory_stats(device=None)
Get memory usage of specified GPU in Bytes.
- report_memory(name='', rank=0, device=None)
Simple GPU memory report.