TIL: torchdbg

· January 2, 2025

https://github.com/ezyang/torchdbg

Step by step debugging through a PyTorch program and see the underlying operators and shapes. Helpful for getting a view of the graph and shapes – just annotate the code with with torchdbg.LoggingMode(): and add TORCH_TRACE=./log to dump the logging file. Comes with a handy viewer.