跳转到主要内容

解析由PyTorch torch.compile生成的TORCH_LOG日志

项目描述

tlparse: 解析结构化PT2日志

tlparse 解析结构化torch trace日志并输出分析数据的HTML文件。

快速开始: 设置TORCH_TRACE环境变量后运行PT2

TORCH_TRACE=/tmp/my_traced_log example.py

将输入数据馈送到tlparse

tlparse /tmp/my_traced_log -o tl_out/

添加自定义解析器

您可以通过自定义解析器扩展tlparse,这些解析器接受现有的结构化日志数据并输出任何文件。为此,首先实现带有您自己的特质的StructuredLogParser

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

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪一个,请了解有关安装包的更多信息。

源分布

tlparse-0.3.25.tar.gz (49.6 kB 查看哈希值)

上传时间:

构建分布

tlparse-0.3.25-py3-none-win_amd64.whl (1.8 MB 查看哈希值)

上传时间: Python 3 Windows x86-64

tlparse-0.3.25-py3-none-win32.whl (1.7 MB 查看哈希值)

上传时间: Python 3 Windows x86

tlparse-0.3.25-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB 查看哈希值)

上传时间: Python 3 manylinux: glibc 2.17+ x86-64

tlparse-0.3.25-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.4 MB 查看哈希值)

上传时间: Python 3 manylinux: glibc 2.17+ s390x

tlparse-0.3.25-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.3 MB 查看哈希值)

上传时间: Python 3 manylinux: glibc 2.17+ ppc64le

tlparse-0.3.25-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (2.2 MB 查看哈希值)

上传时间: Python 3 manylinux: glibc 2.17+ i686

tlparse-0.3.25-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB 查看哈希值)

上传时间: Python 3 manylinux: glibc 2.17+ ARMv7l

tlparse-0.3.25-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB 查看哈希值)

上传时间: Python 3 manylinux: glibc 2.17+ ARM64

tlparse-0.3.25-py3-none-macosx_11_0_arm64.whl (2.0 MB 查看哈希值)

上传时间: Python 3 macOS 11.0+ ARM64

tlparse-0.3.25-py3-none-macosx_10_12_x86_64.whl (2.0 MB 查看哈希值)

上传时间 Python 3 macOS 10.12+ x86-64

支持