Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TORCH_LOGS parser for PT2

License

NotificationsYou must be signed in to change notification settings

meta-pytorch/tlparse

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:

pubstructMyCustomParser;implStructuredLogParserforMyCustomParser{fnname(&self) ->&'staticstr{"my_custom_parser"}fnget_metadata<'e>(&self,e:&'eEnvelope) ->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        ....}fnparse<'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

About

TORCH_LOGS parser for PT2

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors17

Languages


[8]ページ先頭

©2009-2025 Movatter.jp