Skip to content

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

Merged
tianleiwu merged 3 commits intomainfrom
copilot/update-globalaveragepool-opset
Mar 20, 2026
Merged

Fill GlobalAveragePool and GlobalMaxPool opset gap in CUDA provider (1→22)#27733
tianleiwu merged 3 commits intomainfrom
copilot/update-globalaveragepool-opset

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

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
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tianleiwu
Copy link
Contributor

…l opset gap fill

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

Copilot AI commented Mar 18, 2026

@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.

Copilot AI requested a review from tianleiwu March 18, 2026 21:41
@tianleiwu
Copy link
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tianleiwu tianleiwu marked this pull request as ready for review March 18, 2026 23:42
@tianleiwu tianleiwu enabled auto-merge (squash) March 19, 2026 21:33
@tianleiwu tianleiwu requested a review from titaiwangms March 20, 2026 00:14
@tianleiwu tianleiwu merged commit f546db8 into main Mar 20, 2026
91 checks passed
@tianleiwu 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
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
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