Fill CUDA opset gap for ReduceMax and ReduceMin (18 → 20)#27755
Draft
Fill CUDA opset gap for ReduceMax and ReduceMin (18 → 20)#27755
Conversation
… 18 to opset 20 Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tianleiwu
March 19, 2026 00:05
View session
Comment on lines
+39
to
+46
| #define REGISTER_KERNEL_VERSIONED_RANGE_AXES_INPUT_TYPED(name, T, begin, end) \ | ||
| ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_EX( \ | ||
| name, \ | ||
| kOnnxDomain, \ | ||
| begin, end, \ | ||
| T, \ | ||
| kCudaExecutionProvider, \ | ||
| (*KernelDefBuilder::Create()).TypeConstraint("T", DataTypeImpl::GetTensorType<T>()).InputMemoryType(OrtMemTypeCPUInput, 1), \ |
Contributor
There was a problem hiding this comment.
Suggested change
| #define REGISTER_KERNEL_VERSIONED_RANGE_AXES_INPUT_TYPED(name, T, begin, end) \ | |
| ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_EX( \ | |
| name, \ | |
| kOnnxDomain, \ | |
| begin, end, \ | |
| T, \ | |
| kCudaExecutionProvider, \ | |
| (*KernelDefBuilder::Create()).TypeConstraint("T", DataTypeImpl::GetTensorType<T>()).InputMemoryType(OrtMemTypeCPUInput, 1), \ | |
| #define REGISTER_KERNEL_VERSIONED_RANGE_AXES_INPUT_TYPED(name, T, begin, end) \ | |
| ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_EX( \ | |
| name, \ | |
| kOnnxDomain, \ | |
| begin, end, \ | |
| T, \ | |
| kCudaExecutionProvider, \ | |
| (*KernelDefBuilder::Create()).TypeConstraint("T", DataTypeImpl::GetTensorType<T>()).InputMemoryType(OrtMemTypeCPUInput, 1), \ |
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
Extends CUDA ReduceMax and ReduceMin kernel registrations from opset 18 to opset 20.
reduction_ops.cc: AddedREGISTER_KERNEL_VERSIONED_RANGE_AXES_INPUT_TYPEDmacro for versioned ranges requiringInputMemoryType(OrtMemTypeCPUInput, 1). Split both operators from 2-way (1–17, 18+) to 3-way (1–17, 18–19, 20+).cuda_execution_provider.cc: Capped opset 18 forward declarations andBuildKernelCreateInfoentries to versioned 18–19. Added opset 20 non-versioned entries for both operators.Type coverage maintained as-is: ReduceMax (float, double, MLFloat16, int32_t, int64_t), ReduceMin adds int8_t, uint8_t.
Motivation and Context
ReduceMax and ReduceMin CUDA registrations stopped at opset 18; ONNX latest is opset 20. Models exported with opset 19–20 could fail to find a matching CUDA kernel for these ops.
Follows the same pattern used in #27735 (TopK) and other opset gap PRs tracked in #27729.