-
Notifications
You must be signed in to change notification settings - Fork 507
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
[Torch Dialect] Emit torch.aten.mul.float_int
, add folder and conversion to Arith.
#3750
base: main
Are you sure you want to change the base?
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.
Thanks! Similar comments as on the other PR.
// CHECK-SAME: %[[RHS:.*]]: !torch.int) -> !torch.float { | ||
// CHECK-DAG: %[[LHS_F64:.*]] = torch_c.to_f64 %[[LHS]] | ||
// CHECK-DAG: %[[RHS_I64:.*]] = torch_c.to_i64 %[[RHS]] | ||
// CHECK: %[[MUL:.*]] = arith.mulf %[[LHS_F64:.*]], [[RHS_I64:.*]] : f64 |
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.
Similar to the other PR, I'm certain there is an additional arith.sitofp
op, and the arguments for arith.mulf
shouldn't be assignments of variables.
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.
Correcting here as well.
return nullptr; | ||
} | ||
return atenBinaryFloatOperatorFoldHelper( | ||
adaptor.getOperands(), [](double a, double b) { return a * b; }); |
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.
Similar to my comment in your other PR, one of the two arguments should be an int64_t
, and it would be beneficial to have additional folding options for whenever one of the two operands is 1
or 0
.
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.
See other PR.
Folder is required to simplify the shape calculation of
torch.aten.__interpolate.size_list_scale_list
:torch-mlir/lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp
Lines 6900 to 6907 in 5eab669
(I've re-run
build_tools/update_abstract_interp_lib.sh
)