-
Notifications
You must be signed in to change notification settings - Fork 21
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
[Operator] Type promotion for pointwise Ops #79
Conversation
Bowen12992
commented
Jun 21, 2024
•
edited
Loading
edited
- Add Type promotion for pointwise Ops
- Add trunc & floor mode for divOp
- Move Type promotion into pointwise JIT
- Support different condition of whereOp
- Add UTs of type promotion for pointwise Ops
- Fix related docs
import torch._prims_common as utils | ||
|
||
|
||
def type_promotion(*args, type_promotion: utils.ELEMENTWISE_TYPE_PROMOTION_KIND): |
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.
Maybe we can use a simpler implementation for type promotion rules.(e.g. use torch.promote_types
or torch.result_type
for ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT
, and write our own implementation for other cases).
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.
Yeah, we can simplify the logic! but I have two concerns. 1. Will Gems support dynamic-shape with maybe sympy
in the feature?2. I‘m going to figure out if there are differences among torch.promote_types
torch.result_type
and ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT
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.
We may not support symbolic shape since flaggems is basically designed for processing real tensors, with concrete shapes.
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