[tmva][sofie] fix for maxpool/avgpool reading wrong pad indices for asym padding#22438
Merged
guitargeek merged 1 commit intoMay 31, 2026
Merged
Conversation
Test Results 22 files 22 suites 3d 7h 25m 2s ⏱️ For more details on these failures, see this check. Results for commit 2c362ed. ♻️ This comment has been updated with latest results. |
Contributor
|
/backport to 6.40 |
|
Preparing to backport PR #22438 to branch 6.40 requested by guitargeek |
|
This PR has been backported to branch 6.40: #22442 |
Contributor
Author
|
thanks for the review and merge |
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.
Changes:
ROperator_Pool::Generate()read the pooling-window end pads at fixed indices (1, 3, 5), assuming an interleaved[begin, end, ...]layout. SOFIE stores pads in ONNX grouped order[begin..., end...],so when padding differs across spatial axesthis swapped, e.g., the height-end pad with the width-begin pad. MaxPool/AveragePool then scanned the wrong windows and produced a wrong-shaped output,silently with no error. However all existing pool tests use zero padding, so it was never exercised; I've verifed the bug as reported in #22436.
Fix: read begins at
0, 1, 2and ends atfDim, fDim+1, fDim+2, matching the indices shape inference already uses. Symmetric padding is unchanged, so existing tests stay as it is.Also added a
MaxPool2d_AsymPadregression test (pads=[0,1,0,1]) that fails before this change and passes after; helps in verifying the path.Checklist:
This PR fixes #22436