Skip to content

Add support for choosing decomposition rules in decompose-lowering#2973

Open
kipawaa wants to merge 10 commits into
mainfrom
dl-driver-restructure
Open

Add support for choosing decomposition rules in decompose-lowering#2973
kipawaa wants to merge 10 commits into
mainfrom
dl-driver-restructure

Conversation

@kipawaa

@kipawaa kipawaa commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Context:
decompose-lowering always applies all (applicable) decomposition rules in the IR, and removes all decomposition rules on cleanup.

Description of the Change:
Introduces a target-rules option to apply only a subset of the rules available in the IR. Rules are now applied by aligning the target_op's operands with the decomposition functions body and cloning the function body inline, to avoid the inconsistencies/heuristics of the built-in inliner. Rules are no longer removed after the decompose-lowering pass to allow use throughout the pipeline in graph-decomposition passes. Decomposition functions will be removed by the symbol-dce pass at the end of the default pipeline.

Benefits:
Provides a more versatile decompose-lowering pass, and will support a more efficient graph-decomposition pass.

Possible Drawbacks:

Related GitHub Issues:

[sc-122013]

@kipawaa kipawaa marked this pull request as ready for review June 23, 2026 19:13
@github-actions

Copy link
Copy Markdown
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@kipawaa kipawaa marked this pull request as draft June 23, 2026 19:20
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.97%. Comparing base (b65dd49) to head (291727b).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2973   +/-   ##
=======================================
  Coverage   96.97%   96.97%           
=======================================
  Files         166      166           
  Lines       19209    19209           
  Branches     1788     1788           
=======================================
  Hits        18628    18628           
  Misses        429      429           
  Partials      152      152           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

#include <string>
#include <utility>

// When we read the decomposition rules module from file,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved to the stablehlo include where this is relevant

@kipawaa kipawaa marked this pull request as ready for review June 25, 2026 13:47
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.

1 participant