Shortcuts

profiler

torchtune.utils.profiler(enabled: Optional[bool] = False, output_dir: Optional[str] = './torchtune_perf_tracing.json') ContextManager[source]

Utility component that wraps around torch.profiler to profile model’s operators. See https://pytorch.org/docs/stable/profiler.html for more details. The schedule for this profiler is wait 100 steps, warmup 5 steps, trace 5 steps Note: Enabling pytorch profiler may have training speed reduction.

Parameters:
  • enabled (Optional[bool]) – Enable pytorch profiler. Default is False.

  • output_dir (Optional[str]) – Tracing file output path. Default is “./torchtune_perf_tracing.json”.

Returns:

pytorch profiler context manager

Return type:

ContextManager

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources