38 releases

0.3.44 May 27, 2025
0.3.41 Apr 21, 2025
0.3.39 Mar 27, 2025
0.3.30 Dec 5, 2024
0.3.11 Mar 26, 2024

#142 in Machine learning

Download history 188/week @ 2025-03-02 328/week @ 2025-03-09 405/week @ 2025-03-16 499/week @ 2025-03-23 175/week @ 2025-03-30 152/week @ 2025-04-06 186/week @ 2025-04-13 430/week @ 2025-04-20 278/week @ 2025-04-27 200/week @ 2025-05-04 259/week @ 2025-05-11 523/week @ 2025-05-18 315/week @ 2025-05-25 253/week @ 2025-06-01 175/week @ 2025-06-08 249/week @ 2025-06-15

1,042 downloads per month

BSD-3-Clause

450KB
3.5K SLoC

Rust 3K SLoC // 0.0% comments JavaScript 388 SLoC // 0.2% comments

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:

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–20MB
~261K SLoC