tlparse is a command-line utility for parsing structured `TORCH_LOG` logs generated by PyTorch's `torch.compile`. It analyzes these logs and outputs rich HTML reports, aiding in understanding the compilation process, identifying graph breaks, recompilations, and debugging dynamic shape issues. The current version is 0.4.3, and it is actively maintained within the PyTorch ecosystem.
pip install tlparseNo compatibility data collected yet for this library.
To use `tlparse`, first run your PyTorch script with the `TORCH_TRACE` environment variable set to a desired log directory. Then, execute the `tlparse` command-line tool on that directory to generate an HTML report. This example demonstrates how to set up log generation and provides the subsequent `tlparse` command.
Update custom Rust parsers to match the new `parse_path` signature.
Review log contents before sharing, especially in public forums or bug reports. Consider anonymizing sensitive code sections if necessary.
Always share the complete output directory (e.g., a zip of `tl_out/`) or the original `TORCH_TRACE` log directory.
Simplify code, reduce data-dependent operations, or adopt compiler-friendly patterns in your PyTorch model to minimize graph breaks and recompilations. Consult PyTorch `torch.compile` documentation for best practices.
Ensure `pip install tlparse` completed successfully and verify that your shell's PATH environment variable includes the directory where pip installs scripts (e.g., `~/.local/bin` on Linux/macOS or `C:\PythonXX\Scripts` on Windows).
Rerun your PyTorch script with `TORCH_TRACE="/tmp/my_traced_log_dir" python your_script.py`. Double-check that the specified directory exists and contains log files before running `tlparse` on it.
Manually navigate to the output directory (default is `tl_out/` relative to where `tlparse` was run) and open the `index.html` file in your preferred web browser.
No dependency data recorded yet.