Skip to content

Partitioner: run backend-contributed edge transform passes - #24566

Draft
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:stack2/pr01-partitioner-transforms
Draft

psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:stack2/pr01-partitioner-transforms

Conversation

@psiddh

@psiddh psiddh commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Partitioner: backend-contributed edge transform passes

Backend edge passes were tied to backend-specific lowering entry points. QNN needs those passes before partitioning, because node support is checked on the transformed graph. This adds Partitioner.transform_passes(exported_program) to the standard lowering path and moves QNN's existing pass groups onto the hook.

Review order: the default no-op hook in exir/backend/partitioner.py, pass collection / ordering in exir/program/_program.py, QNN's hook implementation and wrapper, then the generic and QNN regression tests. Caller-supplied transforms run first; partitioner transforms follow in partitioner order. A PassManager combined with contributed passes is rejected rather than silently reordered.

This is PR 1 of the Stack 2 series and bases on local main 5f72739cf26ed53df21a746fb5b022fb8e4266d9. GitHub main fetch returned proxy 403, so the reachable local base was used. No #23563 cherry-pick is included.

Test Plan

On this PR's branch:

python -m pytest -q exir/tests/test_partitioner_transform_passes.py
5 passed in 5.68s

python -m pytest -q backends/qualcomm/tests/test_passes.py -k 'partitioner_carries or partitioner_runs'
2 passed, 38 deselected in 4.59s

The same generic regression file against unmodified main gives 4 failed / 1 passed. The contributed passes are not called, ordering assertions fail, and the mixed PassManager guard does not raise.

The tests use the existing venvC PyTorch build and source imports from the exact branch. Device QNN inference was not rerun.

Stack (review in order)

  1. Partitioner: run backend-contributed edge transform passes #24566 Partitioner: run backend-contributed edge transform passes
  2. Export: avoid reused lifted-constant names #24567 Export: avoid reused lifted-constant names
  3. LLM runner: select I/O contracts and accept custom buffer allocators #24568 LLM runner: select I/O contracts and accept custom buffer allocators
  4. QNN: construct partitioners from options and allocate LLM I/O in rpcmem #24569 QNN: construct partitioners from options and allocate LLM I/O in rpcmem
  5. QNN: bind delegate outputs in exported program order #24570 QNN: bind delegate outputs in exported program order
  6. Export hf_static float-cache programs and register their Python runner #24571 Export hf_static float-cache programs and register their Python runner
  7. LLM runner: validate and drive hf_static float-cache programs #24572 LLM runner: validate and drive hf_static float-cache programs
  8. Document the version-1 hf_static I/O contract #24573 Document the version-1 hf_static I/O contract

Each PR includes the commits of the ones above it; review only its own top commits.

Run each partitioner’s edge transforms after caller-supplied passes so backends can use the standard lowering entry point. QNN contributes its existing transforms through the new hook.
@pytorch-bot

pytorch-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24566

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 1b88bb9 with merge base 5f72739 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant