Add int32_t as required type to some operators #7192
Merged
skottmckay merged 3 commits intomasterfrom Apr 1, 2021
Merged
Conversation
…testing of Android package build config with a minimal build. If an operator can be used for shape manipulation (int64) it is frequently used for indices manipulation (int32), so we enable both types for that set of ops. - e.g. BERT models take indices as input - Scatter/Gather ops utilize indices Misc. fix to python bindings to exclude call that fails in a minimal build.
edgchen1
reviewed
Mar 31, 2021
| ORT_SPECIFY_OP_KERNEL_ARG_REQUIRED_TYPES_ALL_OPSETS( | ||
| kCpuExecutionProvider, kOnnxDomain, Gather, Input, 1, int64_t); | ||
| } | ||
| kCpuExecutionProvider, kOnnxDomain, Gather, Input, 1, int32_t, int64_t); |
Contributor
There was a problem hiding this comment.
int32_t, int64_t [](start = 58, length = 16)
if the default and required types are the same, there's not really a reason to have the type reduction here at all. but it's fine to clean that up later too
Contributor
There was a problem hiding this comment.
edgchen1
reviewed
Mar 31, 2021
| OrtPybindThrowIfError(sess->FilterEnabledOptimizers(disabled_optimizer_names)); | ||
| } | ||
| #else | ||
| ORT_UNUSED_PARAMETER(disabled_optimizer_names); |
Contributor
There was a problem hiding this comment.
would it be useful to print a warning that disabled optimizer names will be ignored if any are provided?
…AsRequiredTypeToSomeOps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Updates to some operators to always support int32 and int64 based on testing of Android package build config with a minimal build using global type reduction.
If an operator can be used for shape manipulation (int64) it is frequently used for indices manipulation (int32 or int64), so we enable both types for that set of ops.
This allows us to avoid having to specify int32 and int64 in the global list of types, which would mean they're unnecessarily enabled for all operators.
DequantizeLinear also needs to special casing of int32. In that case just make all three types required for simplicity.
Misc. fix to python bindings to exclude call that fails in a minimal build.
Motivation and Context
Avoid having to support int32_t and int64_t for all ops when using global type reduction