kd.inspect.Profiler

kd.inspect.Profiler#

class kauldron.inspect.Profiler(
*,
_fake_refs: type[_FakeRefsUnset] | dict[str,
_FakeRootCfg] = <class 'kauldron.utils.config_util._FakeRefsUnset'>,
num_profile_steps: int = 5,
profile_duration_ms: int = 3000,
all_host: bool = False,
first_profile: int | None = 10,
every_steps: int | None = None,
every_secs: float | None = 3600.0,
on_colab: bool = False,
workdir: epath.Path = _FakeRootCfg('cfg.workdir'),
)[source]

Bases: kauldron.utils.config_util.UpdateFromRootCfg

kd.inspect.Profiler.

num_profile_steps

NOTE: No effect on multi-host

Type:

int

profile_duration_ms

Duration of the profiling

Type:

int

first_profile

Trigger profiling at step x

Type:

int | None

all_host

Whether to profile all hosts. This make the profiling slower to load in xprof UI. all_host only works with profile_duration_ms.

Type:

bool

every_steps

Trigger profiling every x steps

Type:

int | None

every_secs

Trigger profiling every x secs

Type:

float | None

on_colab

Whether to profile on Colab

Type:

bool

workdir

Automatically set

Type:

etils.epath.abstract_path.Path

num_profile_steps: int = 5
profile_duration_ms: int = 3000
all_host: bool = False
first_profile: int | None = 10
every_steps: int | None = None
every_secs: float | None = 3600.0
on_colab: bool = False
workdir: epath.Path = _FakeRootCfg('cfg.workdir')