Skip to main content

Parse TORCH_LOG logs produced by PyTorch torch.compile

Project description

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

Feed input into tlparse:

tlparse /tmp/my_traced_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tlparse-0.3.29.tar.gz (147.7 kB view details)

Uploaded Source

Built Distributions

tlparse-0.3.29-py3-none-win_amd64.whl (1.8 MB view details)

Uploaded Python 3 Windows x86-64

tlparse-0.3.29-py3-none-win32.whl (1.7 MB view details)

Uploaded Python 3 Windows x86

tlparse-0.3.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

tlparse-0.3.29-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ s390x

tlparse-0.3.29-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.3 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ppc64le

tlparse-0.3.29-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ i686

tlparse-0.3.29-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARMv7l

tlparse-0.3.29-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

tlparse-0.3.29-py3-none-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

tlparse-0.3.29-py3-none-macosx_10_12_x86_64.whl (2.1 MB view details)

Uploaded Python 3 macOS 10.12+ x86-64

File details

Details for the file tlparse-0.3.29.tar.gz.

File metadata

  • Download URL: tlparse-0.3.29.tar.gz
  • Upload date:
  • Size: 147.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for tlparse-0.3.29.tar.gz
Algorithm Hash digest
SHA256 7f6d0ef3def10708b3a6df401f61aba0a7bd28dbbe6a87b86ebdeb0641810b79
MD5 fe10864910b8b0c110ec6bec7d6a9aa1
BLAKE2b-256 9cc244611d7793b0c87f594c5ec631b5b5cdb40fd5f6a0f987a7b115887b36a9

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9f23a74033e51dcb330c897bf30c83a2acf4fd4bedaee785549a4859a6b4a8d7
MD5 6b3de5fd8f104efd1b3bc794cf2b7d58
BLAKE2b-256 5905a3d57b72762907c33b213870e062b900c8300fc15ae884d4a4a45406963c

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-win32.whl.

File metadata

  • Download URL: tlparse-0.3.29-py3-none-win32.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for tlparse-0.3.29-py3-none-win32.whl
Algorithm Hash digest
SHA256 820a515d2384fbd6b81bcfca908ae5c5ca28f283ceefbe683724a6c085744fa3
MD5 b9432bee9f04b5ba6bf1303036d70c84
BLAKE2b-256 c150c4c8e64d9562ca9b8e300bbc5e73453c451f364111ef0fa7e82cf5397b99

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cbce816c24ca5bcef2e620ae7deb95281417563d8380b3601fef926449e059d8
MD5 a073deceb77872c2a2525b5dce987b6c
BLAKE2b-256 ecdf2101dd29d66440ff4b0fea236ae04668345b03c9208e050a96ac75115621

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 68deecdd5ba5e6f74b8fd77e65983aa8a4855a49a2b25aa2cd83e274437bc2b0
MD5 4a017ccbb02183e77f5e31143da09f80
BLAKE2b-256 6e25d3467b0b940463afca5535d557f2c015b9eb2099150895ad8c1078e53338

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 b06cc1a354b4d3381f858c9a7a41bc8fb45d2a278fe21532acbdd81fedfc5682
MD5 6b3c0c31c2a5311cb564b516e69d4d9a
BLAKE2b-256 62ce8424406cba0ddb2d9b822db9537038fffae4a89c7f16a525e42e596018a0

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4d36644e5ca67ce3a9117b2651a4933f3efdc7316bd27392bfbcbcdbea8af785
MD5 59aebdfccd0064da48d07b1cd1d43316
BLAKE2b-256 aec0d2dda60dab5751b166d98fe21b110a5b9d97d4015ed1b90868933572efb1

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e3d5994d787584952db6f4e198390f1b4d832681d2f9a76830363357d40f5281
MD5 085d330ea01722d9ea210df4e519ac0e
BLAKE2b-256 d229c468fce455d60f34fda141fe23428c2dcdc4185714fa573cb8e356cb849b

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7f31fe6fbc7f4d829f3c06a06d27b57a141b7419879c4a353107fa6d33ba4b9c
MD5 c4a7c97e9a5d16c8451cff77d473414a
BLAKE2b-256 9c7bd56dfa12fd9b7ea3961a48a5c1c360d8f2d1c4d0c615d0b33f9d1a94f633

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5910cd568825c3f73d85db07f5545a15ef7c43dc2296291f705e50696e2b4cb6
MD5 baae35fa40a4aff483f38923ad594178
BLAKE2b-256 6182fcdd2dbfb8eaedbba7246635f126de015e6e4bc38c8ac07b88817e7d5277

See more details on using hashes here.

File details

Details for the file tlparse-0.3.29-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tlparse-0.3.29-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6e9eaf27d451f0ce64597e621a1b3a70b9129075e9f658c857388c50566a477c
MD5 91c84928fc3d3cf49389515f02d396c0
BLAKE2b-256 5457baadc5ad226fc1cca0031e3fb3ce86a4c75513cfca84fad6f6fd74afa91d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page