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)
    }
}

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.27.tar.gz (146.8 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 Windows x86

tlparse-0.3.27-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.27-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.27-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.27-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.27-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.27-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.27-py3-none-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

tlparse-0.3.27-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.27.tar.gz.

File metadata

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

File hashes

Hashes for tlparse-0.3.27.tar.gz
Algorithm Hash digest
SHA256 865b43aceece9239f594f982153a2038baf73815255a0f20d00a2205b3879a56
MD5 84d8bc04e7ba8e8e6eb0bd9f66ef9da1
BLAKE2b-256 0845b273c62107cd9da1309285906de30dfb2185a84062d2cce383563fc71550

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 32dcdbca2e27cd9371a9aed0e21b488cdfbcd3a9baa27ca1cf994e748daaa5db
MD5 4ea33244e6d225637f9a838047dedec0
BLAKE2b-256 b3cad57bda0b3d7aa26abb6f4438649b81951d96f2c029f2f03bc642e37a66f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tlparse-0.3.27-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.27-py3-none-win32.whl
Algorithm Hash digest
SHA256 1df51295c4735d7a91ccd6ca0d53d85dcf7a122c73e18961bd4ca883a70be463
MD5 1945cd941b4db022596c5c50794365ec
BLAKE2b-256 f84739cfdc0d1023ec9aa6d7978b32cffa8b194c89ab72e24f9bf111cadbb990

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e85124dfe5465729b94186fb65873a725b14223eee2add5d55f2be308fccfadc
MD5 da22413c8bda3b169c0744f42dc49e68
BLAKE2b-256 8dbdc23f316759def110c6061ea93df02b024ef6f2e7a37408ac26285b59f9e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f1bc7bfd6791752bff4ed4b18c429ee129e02bfb2eca1906602d48ed1df16c8e
MD5 87e45b6c67a5ef9e3af81123399a6312
BLAKE2b-256 bd13679d6e18369fb2076b4482dba2b5cb7e8a85019b0d27ebed5d4020475e23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ec60a98b57943deb62074a6800f01ecf27048400239a55bb613e631eff992f13
MD5 669f213073f7b91286ce7e2a2f251e52
BLAKE2b-256 1922269f4491b58d8ab0a1d3483a895e0da48252814bf8524620788c6893f8ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 acc6987622533edbb47666641e3a7d223521dcdcbb3dae5de65032a5d1633dc9
MD5 0d32ab3f7f10eb4ad26eb23dac306996
BLAKE2b-256 12a7a24f049e293994aee93bf434eda0fa882b659727a19d4683c1b5aac88a33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 ac2241a41a1206ced8f4befd0b083457c7f8d6b1bf460d542176a5a4b2a6ab1a
MD5 1a56aa02055c2bd7c39e9b786ce2ab98
BLAKE2b-256 7bb2b76bb3b468472e3e7c34c9a562a12adc85ce344451fd42f43ddd6910a92c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 07ac243e2ffa871a34349864e873bd69505c14a6585be9a5936afbe31dddc9a1
MD5 ba12ac8d8b190d25881ba4b69f9ce5c1
BLAKE2b-256 b4ca289d1eca6e326fe97982b0b52ee728816f3424deb382fa4cda6a9dd20a57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 113feb0d3ed3f39cb65386f37b99fe61e7fcbf7759bb93b2540799da7fab3096
MD5 88313b29779747d0bfd83a2ea0e028bb
BLAKE2b-256 9b95c8b11fd0832c85af1ef69537dd7a240b8e4e8d207b2ae41c535b1c03bff9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tlparse-0.3.27-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7fada8994c6575e52afc475c448d99cc7570d9d864916c7ad34a3b3042761ece
MD5 c155d87d82e255e0c4f3fec949acef8c
BLAKE2b-256 622135bec763c80ccc95973a1f378c4ff939a5c6e0b73d95dbfa2daa60bae142

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