[QNN EP] Add MaxRoiPool support via StridedSlice/ReduceMax/Concat decomposition - #542
Merged
Merged
Conversation
qti-niscmami
marked this pull request as ready for review
June 17, 2026 22:59
qti-niscmami
requested review from
qti-ashwshan,
qti-chuteng,
qti-jkilpatrick,
qti-kromero,
qti-yuduo,
tirupath-qti and
yath1
as code owners
June 17, 2026 22:59
qti-chuteng
approved these changes
Jun 25, 2026
…oipool-implementation # Conflicts: # onnxruntime/core/providers/qnn/builder/opbuilder/qdq_constant_folding.cc
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
Adds QNN EP support for the ONNX
MaxRoiPooloperator. Because QNN has noMaxRoiPool/RoiPoolingkernel that runs on the NPU, the op is decomposed into primitives that are supported on all backends (CPU, HTP, GPU):StridedSlice+ReduceMaxper pooled bin, assembled withConcat/Reshape.What it does
For each ROI, the adaptive bin geometry is computed at build time from the (constant)
roistensor, following the ONNX spec (hstart = y1 + floor(i·roi_h/ph),hend = y1 + ceil((i+1)·roi_h/ph), and likewise for width). Each bin becomes:StridedSliceof the exact bin region from the NHWC feature map →ReduceMaxover H,W (keepdims) →[1,1,1,C]Per ROI the bin results are concatenated and reshaped to
[1, ph, pw, C]; the per-ROI tiles are concatenated along the batch axis to form the[num_rois, ph, pw, C]output. The decomposition is exact for any constant ROI (handles overlapping / non-uniform bins andspatial_scale).Constraints
roismust be a constant initializer (bin geometry is resolved at build time); a non-constantroisis rejected inIsOpSupportedand falls back to the CPU EP.num_rois · pooled_h · pooled_w ≤ 4096) bounds graph size; larger configs fall back to the CPU EP.