# tlparse **Repository Path**: mirrors_pytorch/tlparse ## Basic Information - **Project Name**: tlparse - **Description**: TORCH_LOGS parser for PT2 - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-16 - **Last Updated**: 2025-10-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # tlparse: Parse structured PT2 logs `tlparse` parses structured torch trace logs and outputs HTML files analyzing data. Quick start: Run PT2 with the TORCH_TRACE environment variable set: ``` TORCH_TRACE=/tmp/my_traced_log_dir example.py ``` Feed input into tlparse: ``` tlparse /tmp/my_traced_log_dir -o tl_out/ ``` ## Adding custom parsers You can extend tlparse with custom parsers which take existing structured log data and output any file. To do so, first implement StructuredLogParser with your own trait: ```Rust pub struct MyCustomParser; impl StructuredLogParser for MyCustomParser { fn name(&self) -> &'static str { "my_custom_parser" } fn get_metadata<'e>(&self, e: &'e Envelope) -> Option> { // Get required metadata from the Envelope. // You'll need to update Envelope with your custom Metadata if you need new types here .... } fn parse<'e>(&self, lineno: usize, metadata: Metadata<'e>, _rank: Option, compile_id: &Option, payload: &str ) -> anyhow::Result { // Use the metadata and payload however you'd like // Return either a ParserOutput::File(filename, payload) or ParserOutput::Link(name, url) } } ``` ## How to release 1. Make a release commit by updating Cargo.toml and then running cargo update 2. Push the release commit and a tag for it. This will trigger PyPI release 3. cargo publish