Skip to content

Add subgraph name to tlparse for regional inductor#181

Merged
yushangdi merged 1 commit into
mainfrom
subgraph
May 11, 2026
Merged

Add subgraph name to tlparse for regional inductor#181
yushangdi merged 1 commit into
mainfrom
subgraph

Conversation

@yushangdi
Copy link
Copy Markdown
Contributor

@yushangdi yushangdi commented Apr 30, 2026

Summary

  • Add support for the subgraph_name field in PyTorch structured logs (used by regional inductor for repeated subgraphs, partitioned forward/backward subgraphs, etc.)
  • When subgraph_name is present on a log entry, the HTML index renders a "Subgraph Name: ..." group header to visually separate artifacts by subgraph
  • Files remain flat in the compile ID directory (no new subdirectories)

Changes

src/types.rs — Add subgraph_name: Option<String> to Envelope so serde deserializes the new field. Add starts_group and group_name to OutputFile for rendering group separators.

src/lib.rs — Thread the envelope's subgraph_name through add_file_output into each OutputFile. After all parsing, compute group boundaries by detecting when consecutive files have different group_name values and setting starts_group = true.

src/parsers.rs — Copy the two new OutputFile fields in the CompilationMetricsParser output remapping.

src/templates.rs — Render a <li> group header with top margin when starts_group is true.

tests/inputs/subgraph_name.log — Minimal 6-line test log with 3 artifacts: one with no subgraph, one with repeated_subgraph0, one with partitioned_bw_subgraph_1_0.

tests/integration_test.rstest_subgraph_name_grouping: verifies files are flat (no subgraph subdirectories), and the index HTML contains the expected group headers.

Test plan

  • cargo test — all 64 tests pass (63 existing + 1 new)
  • Manual run on a real log with subgraph_name entries confirms group headers appear in index.html

Example output:

For annotation based regional inductor:

Screenshot 2026-04-29 at 5 51 07 PM

For invoke_subgraph based regional inductor:

Screenshot 2026-04-29 at 5 51 45 PM

@meta-cla meta-cla Bot added the cla signed label Apr 30, 2026
@yushangdi yushangdi requested a review from angelayi April 30, 2026 16:47
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request May 1, 2026
Propose to add a "subgraph_name" entry to tlparse. After modifying tlparse like in meta-pytorch/tlparse#181, we will be able to see which subgraph the tlparse artifact is corresponding to.

See meta-pytorch/tlparse#181 for tlparse result screenshots.
Pull Request resolved: #181958
Approved by: https://github.com/anijain2305
ghstack dependencies: #181808, #181809, #181834
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request May 8, 2026
Propose to add a "subgraph_name" entry to tlparse. After modifying tlparse like in meta-pytorch/tlparse#181, we will be able to see which subgraph the tlparse artifact is corresponding to.

See meta-pytorch/tlparse#181 for tlparse result screenshots.
Pull Request resolved: #181958
Approved by: https://github.com/anijain2305
@yushangdi yushangdi merged commit 98b8782 into main May 11, 2026
20 checks passed
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request May 13, 2026
Propose to add a "subgraph_name" entry to tlparse. After modifying tlparse like in meta-pytorch/tlparse#181, we will be able to see which subgraph the tlparse artifact is corresponding to.

See meta-pytorch/tlparse#181 for tlparse result screenshots.
Pull Request resolved: pytorch#181958
Approved by: https://github.com/anijain2305
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
Propose to add a "subgraph_name" entry to tlparse. After modifying tlparse like in meta-pytorch/tlparse#181, we will be able to see which subgraph the tlparse artifact is corresponding to.

See meta-pytorch/tlparse#181 for tlparse result screenshots.
Pull Request resolved: pytorch#181958
Approved by: https://github.com/anijain2305
ghstack dependencies: pytorch#181808, pytorch#181809, pytorch#181834
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
Propose to add a "subgraph_name" entry to tlparse. After modifying tlparse like in meta-pytorch/tlparse#181, we will be able to see which subgraph the tlparse artifact is corresponding to.

See meta-pytorch/tlparse#181 for tlparse result screenshots.
Pull Request resolved: pytorch#181958
Approved by: https://github.com/anijain2305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants