Skip to content

Skip adjacency partitioning when the graph is fully supported - #4530

Merged
micwill755 merged 2 commits into
mainfrom
partition-short-circuit
Sep 16, 2026
Merged

micwill755 merged 2 commits into
mainfrom
partition-short-circuit

Conversation

@micwill755

Copy link
Copy Markdown
Collaborator

Summary

  • Skip adjacency partitioning when require_full_compilation already has full converter coverage, wrapping the graph as a single TRT block instead of repeating AccNodesFinder, fusion, and split.

PR 1 of 3 in a compile-startup stack.

Test plan

  • Compile a fully supported model with require_full_compilation=True and confirm one _run_on_acc_* submodule
  • Compile a mixed-support graph and confirm adjacency partitioning still runs
  • Flux / VLA compile still succeeds with this path enabled

@narendasan narendasan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we enter partitioning at all if the graph is fully supported, global or adjacency?

@cehongwang

Copy link
Copy Markdown
Collaborator

Previously, we needed the partitioner to tag and name the subgraphs, so we still need to enter the partitioner and it will output only one subgraph. But I didn't realize that can cause any overhead.

Why do we enter partitioning at all if the graph is fully supported, global or adjacency?

@cehongwang cehongwang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Before merging, can you share the benchmark result of speed improvement?

@micwill755

Copy link
Copy Markdown
Collaborator Author

Why do we enter partitioning at all if the graph is fully supported, global or adjacency?

On Flux, partition went from 0.354s to 0.170s (0.18s saved); on VLA vision, 0.296s to 0.047s (0.25s saved); on VLA diffusion, 0.179s to 0.081s (0.10s saved).

@github-actions github-actions Bot added component: tests Issues re: Tests component: lowering Issues re: The lowering / preprocessing passes labels Sep 1, 2026
@micwill755

Copy link
Copy Markdown
Collaborator Author

Why do we enter partitioning at all if the graph is fully supported, global or adjacency?

@narendasan I added a full skip of partitioning so a fully supported graph goes straight to conversion. Total partition time is now Flux 0.123s (0.23s saved), VLA vision 0.022s (0.27s saved), VLA diffusion 0.060s (0.12s saved).

When require_full_compilation already has full converter coverage, wrap the graph as one TRT block instead of repeating AccNodesFinder, fusion, and adjacency split.
@micwill755
micwill755 force-pushed the partition-short-circuit branch from efaed52 to 5ecbe18 Compare September 16, 2026 23:22
@micwill755
micwill755 merged commit cad94b0 into main Sep 16, 2026
35 checks passed
micwill755 added a commit that referenced this pull request Nov 10, 2026
…lation

The whole-graph path from #4530 built engine inputs from every
placeholder, so a non-tensor input such as Flux's return_dict raised in
construct_submodule_inputs. Route those graphs through the partitioner,
which still skips support discovery when every op is supported and keeps
the non-tensor input outside the engine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants