torchcell.profiling

A timing decorator for profiling. time_method() records the wall time of each call of the decorated function in a module-level store when the environment variable TORCHCELL_DEBUG_TIMING is 1 (otherwise it calls the function directly), and get_timings(), get_timing_summary() and print_timing_summary() read it back.

Functions

time_method

Time a function/method execution when profiling is enabled.

print_timing_summary

Print formatted timing summary with standard deviations.

reset_timings

Clear all timing data.

get_timings

Get raw timing data as a dictionary.

get_timing_summary

Get timing summary statistics as a dictionary.