Skip to content

Drop QDQ around MaxPool for opset 22 and stabilize ASAN build_x64#28783

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-qdq-maxpool-optimization
Open

Drop QDQ around MaxPool for opset 22 and stabilize ASAN build_x64#28783
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-qdq-maxpool-optimization

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

Description

Extend MaxPool QDQ-drop handling to opset 22 and add corresponding optimizer test coverage.

Based on CI feedback from build_x64 ASAN, reduce the newly added MaxPool QDQ test footprint so the change remains validated for opset 22 without triggering AddressSanitizer out-of-memory failures in onnxruntime_test_all.

Motivation and Context

The original fix adds opset 22 support for dropping Q/DQ around MaxPool.
Follow-up feedback showed the ASAN job (build_x64, job 79519089498) failing due to memory exhaustion during the expanded test workload, not due to incorrect optimizer behavior.

This update keeps the intended functionality change (opset 22 support) while narrowing added test cases to preserve CI stability in ASAN-constrained environments.

Copilot AI changed the title [WIP] Fix QDQ MaxPool optimization for opset >= 22 Drop QDQ around MaxPool for opset 22 Jun 4, 2026
Copilot AI requested a review from xadupre June 4, 2026 08:01
@xadupre xadupre marked this pull request as ready for review June 4, 2026 08:54
@xadupre xadupre requested a review from Copilot June 4, 2026 08:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression in the QDQ DropQDQ selector logic for MaxPool when models use newer ONNX opsets. Specifically, it extends MaxPool matching from only SinceVersion == 12 to also include SinceVersion == 22, restoring the ability to collapse DequantizeLinear -> MaxPool -> QuantizeLinear sequences for opset 22+ models.

Changes:

  • Extend MaxPool supported versions to {12, 22} in the shared misc op versions map used by QDQ selector infrastructure.
  • Update DropQDQNodesRules registration to allow MaxPool version 22 to match the positive-scale/no-int16 DropQDQ rule.
  • Add a regression test verifying DropQDQ works for MaxPool in opsets 12 and 22 for both int8 and uint8.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
onnxruntime/test/optimizer/qdq_transformer_test.cc Adds regression coverage to ensure QDQ is dropped around MaxPool for opsets 12 and 22 with int8/uint8.
onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc Updates misc selector op-version map so MaxPool selections can match both version 12 and 22.
onnxruntime/core/optimizer/qdq_transformer/selectors_actions/qdq_selector_action_transformer.cc Updates DropQDQ selector/action registration so the MaxPool drop rule applies to both version 12 and 22.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI changed the title Drop QDQ around MaxPool for opset 22 Drop QDQ around MaxPool for opset 22 and stabilize ASAN build_x64 Jun 4, 2026
Copilot AI requested a review from xadupre June 4, 2026 14:38
@xadupre
Copy link
Copy Markdown
Member

xadupre commented Jun 5, 2026

@copilot the issue is AddressSanitizer: Out of memory

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 5, 2026

@copilot the issue is AddressSanitizer: Out of memory

Confirmed. I checked the failing build_x64 logs and the failure is AddressSanitizer: Out of memory in onnxruntime_test_all (8GB ASAN allocator exhaustion), not a MaxPool QDQ correctness failure. The test-footprint reduction for this PR is in commit a264401.

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.

[Performance] DropQDQ optimization no longer drops QDQ around MaxPool for opset >= 22

3 participants