[CUDA] Extend Pad support through opset 25 with wrap mode#27774
Draft
[CUDA] Extend Pad support through opset 25 with wrap mode#27774
Conversation
…wrap impl, CUDA-only tests 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 19:44
View session
This was referenced Mar 19, 2026
Contributor
|
Thanks! |
Contributor
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Contributor
|
/azp run Windows GPU Doc Gen CI Pipeline, Python format |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
This PR consolidates PRs #27416 and #27708 to extend CUDA Pad kernel support through opset 25, including wrap mode implementation.
Motivation and Context
The CUDA execution provider previously only registered the Pad kernel up to opset 18 and did not implement wrap mode. When an ONNX model exported with opset 19+ was run on the CUDA executor, the Pad operation was forced to fall back to CPU, resulting in significant performance degradation. This PR aligns CUDA Pad registration with the ONNX Pad schema evolution through opset 25 and provides a correct wrap mode implementation.
Related issues: #26393
Related PRs: #27416, #27708
Summary of Changes
Kernel registration and opset coverage
onnxruntime/core/providers/cuda/tensor/pad.cconnxruntime/core/providers/cuda/cuda_execution_provider.ccCUDA Pad implementation
onnxruntime/core/providers/cuda/tensor/pad_impl.honnxruntime/core/providers/cuda/tensor/pad_impl.cuWrapCoordinatedevice helper withif constexprcompile-time specialization. Removes dead wrap code from the NCHW-specialized kernel path.onnxruntime/core/providers/cuda/tensor/pad.ccDocumentation
docs/OperatorKernels.mdTest coverage
onnxruntime/test/providers/cpu/tensor/pad_test.ccedgeacross opsets 18-25 andwrapacross opsets 19-25. Updates existing wrap test comment.Checklist
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.