Skip to content

[GlobalOptimization] Expose reusable transpose propagation patterns - #24978

Merged
devtbi merged 1 commit into
mainfrom
users/ziereis/qdq-transpose-pattern-refactor
Oct 1, 2026
Merged

devtbi merged 1 commit into
mainfrom
users/ziereis/qdq-transpose-pattern-refactor

Conversation

@ziereis

@ziereis ziereis commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

I ran into multiple scenarios in the past (and now again for #24906) where i had to reimplement some form of transpose propagation. To improve this, this PR refactors the transpose propagation pass into reusable patterns.

This PR should not cause any functional changes and should be a pure refactor.

Assisted by: Claude

@ziereis
ziereis force-pushed the users/ziereis/qdq-transpose-pattern-refactor branch 4 times, most recently from 5f74093 to 8e2cdbf Compare September 30, 2026 15:25
Move the transpose propagation patterns out of PropagateLinalgTranspose
into TransposePropagationPatterns so other passes can reuse them. Each
pattern is exposed through its own populate function, and the pattern
classes stay private to the implementation file. Generic transpose
specialization is exposed both as a function, which the pass keeps
applying with its original walk, and as a pattern for greedy callers.

Patterns no longer depend on Flow. Scope and profitability decisions
come from a ControlTransposePropagationFn. The patterns call it once,
after the structural match, with the use edge that the transpose moves
across. The pass supplies the previous policy: stay outside of
dispatches, keep sunk extract_slice ops mappable to Flow, and restrict
reshape propagation at graph edges. Named-op generalization and
convolution support stay pattern options because they describe what
the rewrite can handle safely.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
@ziereis
ziereis force-pushed the users/ziereis/qdq-transpose-pattern-refactor branch from 8e2cdbf to 6854dae Compare September 30, 2026 15:32
@ziereis
ziereis marked this pull request as ready for review September 30, 2026 16:07
@devtbi
devtbi merged commit 76caa89 into main Oct 1, 2026
60 checks passed
@devtbi
devtbi deleted the users/ziereis/qdq-transpose-pattern-refactor branch October 1, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants