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_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

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.4.3.tar.gz (5.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tlparse-0.4.3-py3-none-win_amd64.whl (2.0 MB view details)

Uploaded Python 3Windows x86-64

tlparse-0.4.3-py3-none-win32.whl (1.9 MB view details)

Uploaded Python 3Windows x86

tlparse-0.4.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tlparse-0.4.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

tlparse-0.4.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

tlparse-0.4.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

tlparse-0.4.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

tlparse-0.4.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

tlparse-0.4.3-py3-none-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

tlparse-0.4.3-py3-none-macosx_10_12_x86_64.whl (2.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: tlparse-0.4.3.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for tlparse-0.4.3.tar.gz
Algorithm Hash digest
SHA256 5fc8208a465e532e8dbbad62fefdc712cda9d7a0a28ab4f170c18193f83aba9d
MD5 0c7df0e6302fbe741a91547ae34b9797
BLAKE2b-256 83791ca1d6023f6a79430958e7f547b19344b9620a39b69e4f5dbb71700e86f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tlparse-0.4.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for tlparse-0.4.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cb5cbc670aca4034736e1b2f001cb99c8ff52edcec6126ec7418f69641248077
MD5 2c9aabe10ba965af21fe14292b170e3a
BLAKE2b-256 1f8724cf14b52adc1a0884d1fa345424ac4c5da670abec558b3eb85e83f56a95

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tlparse-0.4.3-py3-none-win32.whl
Algorithm Hash digest
SHA256 b3f19ee15262c0f16c1d37255638dd47fc8165e870a7c5ca5bc932885504c746
MD5 f57421de782d3ea3c65ab1348e8e9880
BLAKE2b-256 86aaca33edc91ddf3c745f7ed5e40a436dca57744d3a2d1065866f905d776b50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf0b613cf91ddc74b8e20b23f09d70fa5f1426a2019dce7e4139ae28a2b9053c
MD5 34638bb7d54dabb67be24d44d0476cac
BLAKE2b-256 72bfd261cdbc338ca497ffe27cdd7b49cd1c9de756e95e1429b8aa8c29b7cc9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 3f2a15aaff8dbdf1adac407033534be71695bbc50248686d6cabed5bd88523c5
MD5 df08158c2595f126ae10a2300eaa61e5
BLAKE2b-256 fac49b74543fc4a54de19c5a250f8b76a8a36a630ed2007392e6ea845852a33f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 6deb673b0287252e9bd7608ba16839e0f7d39eb28953b38c04311f8b436b146b
MD5 a769c256de363de7f48ed2388a6db189
BLAKE2b-256 0705f13a7eabb5f279ad4b9143ffadb1e9cf4ff1aebabc2346a2db6fc317bfbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 60cc97be1ad54d7e43241d94271760070375a8a815af9f0d037948f042268774
MD5 05a9916ecdf7a0fe34afe77c5bae42a7
BLAKE2b-256 f58ca8408e222744bb65a21731d003de0a2f512a54c82191b2e186a93fc14d69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 9649b60e3efb57e6bed1dc1c79dc940492e8d3aa3a8663a2f2a83e8aaa5b86db
MD5 70991f8fe3a16b2754e1151e5c1d82a2
BLAKE2b-256 3b36842c1a9cdfd97d5d69843f08d013bdfca015b4826d62c5c9cf6d60d6ca6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 284aba9623fb4fa4282d36ae50d9e7f2cbef66f4bcb65c621a203f5cb3086e2e
MD5 4ef01f9436b4359e4c81611d40f6c227
BLAKE2b-256 d2cc8934441d69254e6a5ab6da73e5ea3044bf1081045cfc3c9b537beeaaa9ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e114130439f019a67f9856bcd5ef9eaf267994dc565e5d973906e5b79d6329dd
MD5 d2d5685368b29b17456fe40192b6217e
BLAKE2b-256 b7b73b66de797619e8f8ee26c78e11661b2b3e67adcfdbb0ca15891ca416b375

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.4.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bf87bbf8286463ae34e6b3cbbd467438c081e5be7860399522ecca646319b14e
MD5 d22978866f78e0a142fbdf9da2dd0942
BLAKE2b-256 b9ee28816a19d6a34bc0e33d1aa35eacbe934182bca4ce7f2905a99117d0632e

See more details on using hashes here.

Supported by

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