Skip to content

Fill GlobalAveragePool and GlobalMaxPool opset gap in CUDA provider (1→22) - #27733

Merged
Tianlei Wu (tianleiwu) merged 3 commits into
mainfrom
copilot/update-globalaveragepool-opset
Mar 20, 2026
Merged

Tianlei Wu (tianleiwu) merged 3 commits into
mainfrom
copilot/update-globalaveragepool-opset

Conversation

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Description

Extends CUDA kernel registrations for GlobalAveragePool and GlobalMaxPool from opset 1 only to the full opset 1–22 range. Follows the same pattern used for MaxPool in #27715.

  • core/providers/cuda/nn/pool.cc — Split single opset-1 registrations into versioned 1–21 + opset 22 for both NCHW and NHWC variants
  • core/providers/cuda/cuda_execution_provider.cc — Updated class declarations and BuildKernelCreateInfo entries (versioned 1–21, added opset 22)
  • core/providers/cuda/cuda_nhwc_kernels.cc — Same for NHWC kernel registrations
  • test/providers/cpu/nn/pool_op_test.cc — Added GlobalAveragePool_22_CUDA test
  • docs/OperatorKernels.md — Updated GlobalAveragePool and GlobalMaxPool entries from 1+ to 22+ / [1, 21] in both the ai.onnx and com.microsoft.internal.nhwc domains under CUDAExecutionProvider

No functional changes to the kernel implementations—opsets 1 through 22 are spec-compatible for these ops.

Motivation and Context

GlobalAveragePool and GlobalMaxPool were registered at opset 1 only in the CUDA provider, creating a 21-version gap to the latest ONNX opset 22. Models exported at higher opsets would fail to find a matching CUDA kernel. Identified as P1 gaps in #27729.

Limitations

BF16 support for GlobalAveragePool-22 and GlobalMaxPool-22 is not added in this PR.

…1→22)

Update kernel registrations for GlobalAveragePool and GlobalMaxPool in the
CUDA execution provider from opset 1 (only) to versioned 1-21 plus opset 22.

Changes:
- onnxruntime/core/providers/cuda/nn/pool.cc: versioned 1-21 + opset 22 kernels
- onnxruntime/core/providers/cuda/cuda_execution_provider.cc: class decls + BuildKernelCreateInfo
- onnxruntime/core/providers/cuda/cuda_nhwc_kernels.cc: NHWC class decls + BuildKernelCreateInfo
- onnxruntime/test/providers/cpu/nn/pool_op_test.cc: add GlobalAveragePool_22_CUDA test

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
@tianleiwu

Copy link
Copy Markdown
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@tianleiwu

Copy link
Copy Markdown
Contributor

…l opset gap fill

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor Author

Copilot, Please update docs/OperatorKernels.md. You can download it from https://aiinfra.visualstudio.com/_apis/resources/Containers/34055151/ContribOperators.md?itemPath=ContribOperators.md%2FContri...

Updated docs/OperatorKernels.md in commit 38422e5 — changed GlobalAveragePool and GlobalMaxPool entries from 1+ to 22+ / [1, 21] in both the ai.onnx and com.microsoft.internal.nhwc domains under CUDAExecutionProvider.

@tianleiwu

Copy link
Copy Markdown
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@tianleiwu
Tianlei Wu (tianleiwu) marked this pull request as ready for review March 18, 2026 23:42
@tianleiwu
Tianlei Wu (tianleiwu) merged commit f546db8 into main Mar 20, 2026
91 checks passed
@tianleiwu
Tianlei Wu (tianleiwu) deleted the copilot/update-globalaveragepool-opset branch March 20, 2026 09:28
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {});
}

TEST(PoolTest, GlobalAveragePool_22_CUDA) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering should this be 21?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is for 22, which is the new opset for the op.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants