You don't have to use raw torch.profiler at all. There is a whole page in Lightning Docs dedicated to Profiling ..
.. and its as easy as passing a trainer flag called profiler like
# other profilers are "simple", "advanced" etc
trainer = pl.Trainer(profiler="pytorch")
Also, set TensorBoardLogger as your preferred logger as you normally do
trainer = pl.Trainer(profiler="pytorch", logger=TensorBoardLogger(..))
Answer from ayandas on Stack OverflowPyTorch
docs.pytorch.org › ecosystem › pytorch profiler with tensorboard
PyTorch Profiler With TensorBoard — PyTorch Tutorials 2.12.0+cu130 documentation
July 20, 2022 - This tutorial demonstrates how to use TensorBoard plugin with PyTorch Profiler to detect performance bottlenecks of the model.
Videos
10:16
PyTorch Lightning #9 - Profiler - YouTube
07:26
PyTorch Lightning #8 - Logging with TensorBoard - YouTube
12:08
PROFILING AND OPTIMIZING PYTORCH APPLICATIONS WITH THE PYTORCH ...
01:19:48
PyTorch Profiler and Designing Evolutionary Data Systems - YouTube
Five ways to increase your model performance with PyTorch ...
PyTorch
docs.pytorch.org › ecosystem › pytorch profiler with tensorboard
PyTorch Profiler With TensorBoard — PyTorch Tutorials 2.10.0+cu128 documentation
July 20, 2022 - This tutorial demonstrates how to use TensorBoard plugin with PyTorch Profiler to detect performance bottlenecks of the model.
DeepSpeed
deepspeed.ai › home › tutorials
Using PyTorch Profiler with DeepSpeed for performance debugging - DeepSpeed
1 week ago - PyTorch Profiler is an open-source tool that enables accurate and efficient performance analysis and troubleshooting for large-scale deep learning models. The profiling results can be outputted as a .json trace file and viewed in Google’s Perfetto trace viewer (https://ui.perfetto.dev).
PyTorch
pytorch.org › blog › introducing-pytorch-profiler-the-new-and-improved-performance-tool
Introducing PyTorch Profiler – the new and improved performance tool – PyTorch
March 25, 2021 - This new profiler collects both GPU hardware and PyTorch related information, correlates them, performs automatic detection of bottlenecks in the model, and generates recommendations on how to resolve these bottlenecks. All of this information from the profiler is visualized for the user in ...
Habana
docs.habana.ai › en › latest › Profiling › Profiling_with_PyTorch.html
Profiling with PyTorch — Gaudi Documentation 1.23.0 documentation
Additionally, it provides guidelines on how to use TensorBoard to view Intel® Gaudi® AI accelerator specific information for performance profiling. These capabilities are enabled using the torch-tb-profiler TensorBoard plugin which is included in the Intel Gaudi PyTorch package.
PyTorch
docs.pytorch.org › reference api › torch.profiler
torch.profiler — PyTorch main documentation
Outputs tracing files to directory of dir_name, then that directory can be directly delivered to tensorboard as logdir. worker_name should be unique for each worker in distributed scenario, it will be set to ‘[hostname]_[pid]’ by default. ...
PyPI
pypi.org › project › torch-tb-profiler
torch-tb-profiler · PyPI
PyTorch Profiler TensorBoard Plugin : https://github.com/pytorch/kineto/tree/main/tb_plugin · These details have been verified by PyPI · aaronenyeshi chauhang seemethere TorchTBProfiler · These details have not been verified by PyPI · Homepage · License: BSD License (BSD-3) Author: PyTorch Team ·
» pip install torch-tb-profiler
PyTorch
docs.pytorch.org › ecosystem › pytorch profiler with tensorboard
PyTorch Profiler With TensorBoard — PyTorch Tutorials 2.9.0+cu128 documentation
July 20, 2022 - This tutorial demonstrates how to use TensorBoard plugin with PyTorch Profiler to detect performance bottlenecks of the model.
PyTorch
docs.pytorch.org › ecosystem › pytorch profiler with tensorboard
PyTorch Profiler With TensorBoard — PyTorch Tutorials 2.7.0+cu126 documentation
July 20, 2022 - This tutorial demonstrates how to use TensorBoard plugin with PyTorch Profiler to detect performance bottlenecks of the model.
Pytorch-cn
pytorch-cn.com › tutorials › intermediate › tensorboard_profiler_tutorial.html
PyTorch Profiler With TensorBoard — PyTorch Tutorials 2.5.0+cu124 documentation
This tutorial demonstrates how to use TensorBoard plugin with PyTorch Profiler to detect performance bottlenecks of the model.
APXML
apxml.com › courses › pytorch-for-tensorflow-developers › chapter-6-advanced-pytorch-features-tf-users › profiling-pytorch-code
PyTorch Profiler | Performance Optimization Guide
# ... (model and inputs setup) from torch.profiler import profile, schedule, ProfilerActivity, tensorboard_trace_handler # Ensure the log directory exists log_dir = "tb_logs/my_model_profile" import os os.makedirs(log_dir, exist_ok=True) # Using a schedule for targeted profiling my_schedule = schedule(wait=1, warmup=1, active=2, repeat=1) with profile( activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA], schedule=my_schedule, on_trace_ready=tensorboard_trace_handler(log_dir), record_shapes=True, with_stack=True ) as prof_tb: for step in range(10): # Simulating training steps model(inputs) prof_tb.step() # Important: Signal the profiler that a step is complete # After running, launch TensorBoard: tensorboard --logdir tb_logs · Then, launch TensorBoard (tensorboard --logdir tb_logs) and navigate to the "PyTorch Profiler" tab.
Google Cloud
cloud.google.com › cloud tpu › profile pytorch xla workloads
Profile PyTorch XLA workloads | Cloud TPU | Google Cloud Documentation
View the Profile. Open the URL provided by TensorBoard in your web browser (usually http://localhost:6006). Navigate to the PyTorch XLA - Profile tab to view the interactive trace.
Windows
torchtutorialstaging.z5.web.core.windows.net › intermediate › tensorboard_profiler_tutorial.html
PyTorch Profiler With TensorBoard — PyTorch Tutorials 1.8.1+cu102 documentation
This tutorial demonstrates how to use TensorBoard plugin with PyTorch Profiler to detect performance bottlenecks of the model.
PyTorch
docs.pytorch.org › tutorials › _downloads › 67e47b6d6793c700666471b688068f72 › tensorboard_profiler_tutorial.py
tensorboard_profiler_tutorial.py
Learn to use TensorBoard to visualize data and model training.