48 releases

0.4.8 Mar 12, 2026
0.4.6 Jan 30, 2026
0.4.4 Dec 30, 2025
0.4.3 Sep 12, 2025
0.3.11 Mar 26, 2024

#188 in Machine learning

Download history 430/week @ 2026-03-17 385/week @ 2026-03-24 422/week @ 2026-03-31 419/week @ 2026-04-07 499/week @ 2026-04-14 414/week @ 2026-04-21 399/week @ 2026-04-28 309/week @ 2026-05-05 530/week @ 2026-05-12 510/week @ 2026-05-19 719/week @ 2026-05-26 391/week @ 2026-06-02 499/week @ 2026-06-09 340/week @ 2026-06-16 145/week @ 2026-06-23 575/week @ 2026-06-30

1,670 downloads per month

BSD-3-Clause

6MB
6K SLoC

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 python example.py

Feed input into tlparse (this will process the latest log file in the directory):

tlparse /tmp/my_traced_log_dir -o tl_out/ --latest

You can also specify a log filename:

tlparse /tmp/my_traced_log_dir/dedicated_log_torch_trace_ro2i1hvn.log -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:

pub struct MyCustomParser;
impl StructuredLogParser for MyCustomParser {
    fn name(&self) -> &'static str {
        "my_custom_parser"
    }
    fn get_metadata<'e>(&self, e: &'e Envelope) -> Option<Metadata<'e>> {
        // 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<u32>,
        compile_id: &Option<CompileId>,
        payload: &str
    ) -> anyhow::Result<ParserResult> {
       // 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

Dependencies

~10–22MB
~251K SLoC