Profiling¶
DataLoader profiling tools for diagnosing data pipeline bottlenecks.
DataProfiler ¶
Records per-batch data loading and training step timings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stall_threshold
|
float
|
seconds above which a data wait counts as a stall |
0.005
|
Source code in tsfast/training/profiling.py
data_wait_fraction
property
¶
Fraction of total time spent waiting for data.
summary ¶
Formatted profiling summary with actionable diagnostics.
Source code in tsfast/training/profiling.py
profile
classmethod
¶
Instrument a Learner's training loop to measure data vs step time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
learner
|
the Learner to instrument |
required | |
stall_threshold
|
float
|
seconds above which a data wait counts as a stall |
0.005
|
Source code in tsfast/training/profiling.py
benchmark_dataloaders ¶
benchmark_dataloaders(dls_factory: Callable, num_workers_list: list[int] | None = None, n_batches: int = 100, **factory_kwargs) -> dict[int, dict[str, float]]
Benchmark data loading speed across different num_workers values.
Creates DataLoaders with each num_workers setting, iterates n_batches,
and reports throughput.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dls_factory
|
Callable
|
callable that returns a DataLoaders (e.g. |
required |
num_workers_list
|
list[int] | None
|
values to test (default |
None
|
n_batches
|
int
|
batches to iterate per setting |
100
|
**factory_kwargs
|
forwarded to dls_factory |
{}
|