tritonparse 0.2.4.dev20251006071528__py3-none-any.whl → 0.2.4.dev20251007071533__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tritonparse might be problematic. Click here for more details.
- tritonparse/__main__.py +1 -1
- tritonparse/cli.py +83 -0
- {tritonparse-0.2.4.dev20251006071528.dist-info → tritonparse-0.2.4.dev20251007071533.dist-info}/METADATA +1 -1
- {tritonparse-0.2.4.dev20251006071528.dist-info → tritonparse-0.2.4.dev20251007071533.dist-info}/RECORD +8 -7
- tritonparse-0.2.4.dev20251007071533.dist-info/entry_points.txt +2 -0
- tritonparse-0.2.4.dev20251006071528.dist-info/entry_points.txt +0 -2
- {tritonparse-0.2.4.dev20251006071528.dist-info → tritonparse-0.2.4.dev20251007071533.dist-info}/WHEEL +0 -0
- {tritonparse-0.2.4.dev20251006071528.dist-info → tritonparse-0.2.4.dev20251007071533.dist-info}/licenses/LICENSE +0 -0
- {tritonparse-0.2.4.dev20251006071528.dist-info → tritonparse-0.2.4.dev20251007071533.dist-info}/top_level.txt +0 -0
tritonparse/__main__.py
CHANGED
tritonparse/cli.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
import argparse
|
|
4
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
5
|
+
|
|
6
|
+
from .common import is_fbcode
|
|
7
|
+
from .reproducer.cli import _add_reproducer_args
|
|
8
|
+
from .reproducer.orchestrator import reproduce
|
|
9
|
+
from .utils import _add_parse_args, unified_parse
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_package_version() -> str:
|
|
13
|
+
try:
|
|
14
|
+
return version("tritonparse")
|
|
15
|
+
except PackageNotFoundError:
|
|
16
|
+
return "0+unknown"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def main():
|
|
20
|
+
pkg_version = _get_package_version()
|
|
21
|
+
|
|
22
|
+
# Use different command name for fbcode vs OSS
|
|
23
|
+
prog_name = "tritonparse" if is_fbcode() else "tritonparseoss"
|
|
24
|
+
|
|
25
|
+
parser = argparse.ArgumentParser(
|
|
26
|
+
prog=prog_name,
|
|
27
|
+
description=(
|
|
28
|
+
"TritonParse: parse structured logs and generate minimal reproducers"
|
|
29
|
+
),
|
|
30
|
+
epilog=(
|
|
31
|
+
"Examples:\n"
|
|
32
|
+
f" {prog_name} parse /path/to/logs --out parsed_output\n"
|
|
33
|
+
f" {prog_name} reproduce /path/to/trace.ndjson --line 2 --out-dir repro_output\n"
|
|
34
|
+
),
|
|
35
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
36
|
+
)
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"--version",
|
|
39
|
+
action="version",
|
|
40
|
+
version=f"%(prog)s {pkg_version}",
|
|
41
|
+
help="Show program's version number and exit",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
45
|
+
|
|
46
|
+
# parse subcommand
|
|
47
|
+
parse_parser = subparsers.add_parser(
|
|
48
|
+
"parse",
|
|
49
|
+
help="Parse triton structured logs",
|
|
50
|
+
conflict_handler="resolve",
|
|
51
|
+
)
|
|
52
|
+
_add_parse_args(parse_parser)
|
|
53
|
+
parse_parser.set_defaults(func="parse")
|
|
54
|
+
|
|
55
|
+
# reproduce subcommand
|
|
56
|
+
repro_parser = subparsers.add_parser(
|
|
57
|
+
"reproduce",
|
|
58
|
+
help="Build reproducer from trace file",
|
|
59
|
+
)
|
|
60
|
+
_add_reproducer_args(repro_parser)
|
|
61
|
+
repro_parser.set_defaults(func="reproduce")
|
|
62
|
+
|
|
63
|
+
args = parser.parse_args()
|
|
64
|
+
|
|
65
|
+
if args.func == "parse":
|
|
66
|
+
parse_args = {
|
|
67
|
+
k: v for k, v in vars(args).items() if k not in ["command", "func"]
|
|
68
|
+
}
|
|
69
|
+
unified_parse(**parse_args)
|
|
70
|
+
elif args.func == "reproduce":
|
|
71
|
+
reproduce(
|
|
72
|
+
input_path=args.input,
|
|
73
|
+
line_index=args.line,
|
|
74
|
+
out_dir=args.out_dir,
|
|
75
|
+
template=args.template,
|
|
76
|
+
)
|
|
77
|
+
else:
|
|
78
|
+
raise RuntimeError(f"Unknown command: {args.func}")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if __name__ == "__main__":
|
|
82
|
+
# Do not add code here, it won't be run. Add them to the function called below.
|
|
83
|
+
main() # pragma: no cover
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tritonparse
|
|
3
|
-
Version: 0.2.4.
|
|
3
|
+
Version: 0.2.4.dev20251007071533
|
|
4
4
|
Summary: TritonParse: A Compiler Tracer, Visualizer, and mini-Reproducer Generator for Triton Kernels
|
|
5
5
|
Author-email: Yueming Hao <yhao@meta.com>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
tritonparse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
tritonparse/__main__.py,sha256=
|
|
2
|
+
tritonparse/__main__.py,sha256=wu5N2wk8mvBgyvr2ghmQf4prezAe0_i-p123VVreyYc,62
|
|
3
|
+
tritonparse/cli.py,sha256=ODfLvbMrrRm5JX6-3XDCu9f59gkJ00sg0R_uzNoVNgw,2471
|
|
3
4
|
tritonparse/common.py,sha256=9coQbzpyHWAAdv6lx2YQTualiIH49ULJuZTA7VB_V7A,13946
|
|
4
5
|
tritonparse/context_manager.py,sha256=M-zRZX8PX8onqBdDeIJ37VGVXmKZ_dFMC6eeZQchyNw,1583
|
|
5
6
|
tritonparse/event_diff.py,sha256=yOD6uNxLJroatfx2nEGr-erw24ObOrHU9P6V5pzr8do,4907
|
|
@@ -29,9 +30,9 @@ tritonparse/tools/format_fix.py,sha256=Ol0Sjui8D7OzHwbamAfGnq8V5Y63uwNaFTKSORN5H
|
|
|
29
30
|
tritonparse/tools/load_tensor.py,sha256=tfdmNVd9gsZqO6msQBhbXIhOvUzgc83yF64k2GDWPNk,2122
|
|
30
31
|
tritonparse/tools/prettify_ndjson.py,sha256=r2YlHwFDTHgML7KljRmMsHaDg29q8gOQAgyDKWJhxRM,11062
|
|
31
32
|
tritonparse/tools/readme.md,sha256=w6PWYfYnRgoPArLjxG9rVrpcLUkoVMGuRlbpF-o0IQM,110
|
|
32
|
-
tritonparse-0.2.4.
|
|
33
|
-
tritonparse-0.2.4.
|
|
34
|
-
tritonparse-0.2.4.
|
|
35
|
-
tritonparse-0.2.4.
|
|
36
|
-
tritonparse-0.2.4.
|
|
37
|
-
tritonparse-0.2.4.
|
|
33
|
+
tritonparse-0.2.4.dev20251007071533.dist-info/licenses/LICENSE,sha256=4ZciugpyN7wcM4L-9pyDh_etvMUeIfBhDTyH1zeZlQM,1515
|
|
34
|
+
tritonparse-0.2.4.dev20251007071533.dist-info/METADATA,sha256=WR3AE9g_zAEMhY_vBgU9yNvqv3GhYNHlwh-9tjUpP94,6580
|
|
35
|
+
tritonparse-0.2.4.dev20251007071533.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
tritonparse-0.2.4.dev20251007071533.dist-info/entry_points.txt,sha256=wEXdaieDoRRCCdhEv2p_C68iytnaXU_2pwt5CqjfbWY,56
|
|
37
|
+
tritonparse-0.2.4.dev20251007071533.dist-info/top_level.txt,sha256=ITcTKgp3vf_bXV9vixuQU9IrZa3L1EfDSZwvRzRaoJU,12
|
|
38
|
+
tritonparse-0.2.4.dev20251007071533.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|