Fill opset gap for RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike CUDA ops#27759
Draft
Fill opset gap for RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike CUDA ops#27759
Conversation
…domUniformLike CUDA ops Cap existing kernels at opset 1-21 (VERSIONED) and add new non-versioned kernels at opset 22 to match the latest ONNX spec, following the same pattern as EyeLike (PR #27757). Changes: - random.cc: Split each operator into versioned (1-21) and non-versioned (22+) - cuda_execution_provider.cc: Update forward declarations and registrations - docs/OperatorKernels.md: Update version ranges for CUDA random operators 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:23
View session
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.
Summary
Fills the opset gap for RandomNormal, RandomNormalLike, RandomUniform, and RandomUniformLike operators in the CUDA execution provider, extending coverage from opset 1 to opset 22.
Related issue: #27729
Motivation
These operators were registered only at opset 1 using
ONNX_OPERATOR_KERNEL_EX(non-versioned), which per the kernel matching logic inkernel_registry.cconly matches nodes withSinceVersion == 1(exact match). Models exported with newer opset versions (e.g., opset 22) would fail to find matching CUDA kernels for these operators.Changes
Following the same pattern as EyeLike (PR #27757):
onnxruntime/core/providers/cuda/generator/random.ccONNX_OPERATOR_KERNEL_EXtoONNX_OPERATOR_VERSIONED_KERNEL_EXwith version range 1-21ONNX_OPERATOR_KERNEL_EXregistrations at opset 22onnxruntime/core/providers/cuda/cuda_execution_provider.ccONNX_OPERATOR_KERNEL_CLASS_NAME→ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME(1, 21)BuildKernelCreateInfoentries to use versioned macros (1, 21)BuildKernelCreateInfoentriesdocs/OperatorKernels.md[1, 21]and22+ranges