-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add custom builder to reduce op allowing type inference #1965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Consider adding some kind of test for this builder.
f7ff7b3
to
99eafa2
Compare
@sdasgup3 Gently checking-in on this, and appreciate your help here. Unfortunately cherry-picking from your fork doesn't play well with the git submodule setup in torch-mlir which expects a commit on
|
99eafa2
to
d9aeca6
Compare
The PR implements the a custom
reduce
op builder similar to what we have for mhlo code.Background
#1869 allows the block arguments of reduce op to have different element types than that of the input arguments of reduce op and the output element type of the reduce op has to equal to those block arguments. As a consequence the output type of reduce op can no longer be inferred from the operand types. The auto-generated builders creates a reduce op with empty block and, as a result, does not allow inferring the type.
The proposed solution is to create a custom builder which takes the element-type of the block arguments as arguments allowing result type inference.