Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MLIR] Mark scatter pass as depending on func dialect #1216

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

erick-xanadu
Copy link
Contributor

Context: All MLIR transformations are required to register dialects if they produce operations or attributes from those dialects. The --scatter-lowering pass produces func.func ops, but does not register the func dialect as a dependency.

Description of the Change: Register the func dialect as a dependency.

Benefits: More correct.

Possible Drawbacks: None

@erick-xanadu erick-xanadu changed the title [MLIR[ Mark scatter pass as depending on func dialect [MLIR] Mark scatter pass as depending on func dialect Oct 18, 2024
@erick-xanadu erick-xanadu marked this pull request as ready for review October 18, 2024 14:57
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.96%. Comparing base (8315657) to head (8ec4ac8).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1216      +/-   ##
==========================================
+ Coverage   97.90%   97.96%   +0.05%     
==========================================
  Files          77       77              
  Lines       10932    11244     +312     
  Branches      967      967              
==========================================
+ Hits        10703    11015     +312     
  Misses        180      180              
  Partials       49       49              

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

Copy link
Contributor

@mehrdad2m mehrdad2m left a comment

Choose a reason for hiding this comment

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

LGTM

@erick-xanadu erick-xanadu merged commit 0bcc64c into main Oct 18, 2024
78 checks passed
@erick-xanadu erick-xanadu deleted the eochoa/2024-10-18/small-fix branch October 18, 2024 16:05
erick-xanadu added a commit that referenced this pull request Oct 22, 2024
)

**Context:** The current scatter lowering makes some assumptions and
only handles a subset of the inputs. However, it is too optimistic and
will attempt to convert inputs that it can't handle. In particular if
there are more than one input update and result tensors, it will
segfault. This condition may never happen but it is valid IR. It may
never happen if another pass runs before that canonicalizes
mhlo.scatter. However, it is good to emit an error in case the
canonicalization was not run before.

**Description of the Change:** Emit error instead of segfaulting

**Benefits:** No segfaults

**Possible Drawbacks:** None

**Related GitHub Issues:**

Depends on #1216
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.

2 participants