mipcandy.profiler#

Module Contents#

Classes#

API#

class mipcandy.profiler.ProfilerFrame[source]#

Bases: object

stack: str = None#
cpu: float = None#
mem: float = None#
gpu: list[float] | None = None#
gpu_mem: list[float] | None = None#
__str__() str[source]#
export(duration: float) str[source]#
class mipcandy.profiler._LineBreak(message: str)[source]#

Bases: object

Initialization

__str__() str[source]#
export(duration: float) str[source]#
class mipcandy.profiler.Profiler(title: str, save_as: str | os.PathLike[str], *, gpus: Sequence[mipcandy.types.Device] = ())[source]#

Bases: object

Initialization

static get_cpu_usage() float[source]#
get_mem_usage() float[source]#
static get_total_mem() float[source]#
static get_gpu_usage(device: mipcandy.types.Device) float[source]#
get_gpu_mem_usage(device: mipcandy.types.Device) float[source]#
static get_total_gpu_mem(device: mipcandy.types.Device) float[source]#
_save(obj: mipcandy.profiler.ProfilerFrame | mipcandy.profiler._LineBreak | str) None[source]#
record_allocated_tensors(*, limit: int = 10) str[source]#
record(*, stack_trace_offset: int = 1) mipcandy.profiler.ProfilerFrame[source]#
line_break(message: str) mipcandy.profiler._LineBreak[source]#