-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Enable type reduction for ConstantOfShape CPU kernel. #6594
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
Enable type reduction for ConstantOfShape CPU kernel. #6594
Conversation
| // type list type containing the given types | ||
| // Note: this is useful for passing TypeLists to macros which don't accept the | ||
| // comma-separated template arguments | ||
| #define ORT_TYPE_LIST(...) ::onnxruntime::TypeList<__VA_ARGS__> |
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.
(... [](start = 21, length = 4)
Is empty typelist OK? #Resolved
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.
| KernelDefBuilder() | ||
| .TypeConstraint("T1", DataTypeImpl::GetTensorType<int64_t>()) | ||
| .TypeConstraint("T2", BuildKernelDefConstraintsFunctorFromTypeList<EnabledOutputTypes>{}()), | ||
| ConstantOfShape); |
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.
Needs update to pass full and enabled types #Resolved
| default: | ||
| ORT_THROW("Unsupported value attribute datatype: ", tensor_type); | ||
| } | ||
| } |
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.
Is it better to use a dispatcher here given otherwise you're defining code for all types even if they're disabled?
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.
tried using a dispatcher but wasn't able to match the binary size of the switch version when all types are enabled
In reply to: 573371802 [](ancestors = 573371802)
…f_shape_type_reduction
This reverts commit c8ad373.
skottmckay
left a comment
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.
![]()
Description
Enable type reduction for ConstantOfShape CPU kernel.
Motivation and Context
Enable potential binary size decrease when limiting enabled types.