Have convolution_backwards error on indivisible groups and reference operator accumulate in double - #5248
Open
CharlieL7 wants to merge 5 commits into
Open
Have convolution_backwards error on indivisible groups and reference operator accumulate in double#5248CharlieL7 wants to merge 5 commits into
CharlieL7 wants to merge 5 commits into
Conversation
double for reference version.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Remaining feedback is limited to minor comment clarifications.
Pull request overview
Fixes convolution_backwards validation and improves reference accumulation precision.
Changes:
- Validates invalid groups and zero strides.
- Uses higher-precision accumulators.
- Adds regression tests and changelog coverage.
File summaries
| File | Summary | Review notes |
|---|---|---|
test/ref/convolution_backwards.cpp |
Numerical and grouped-convolution regression tests | No issues |
test/op_shape_test.cpp |
Invalid stride and group tests | Nit: clarify the out-of-range group mapping |
src/include/migraphx/op/convolution_backwards.hpp |
Accumulation and validation fixes | Nit: clarify the invalid-group failure rationale |
CHANGELOG.md |
Documents the resolved issue | No issues |
Review details
Suppressed comments (2)
src/include/migraphx/op/convolution_backwards.hpp:102
- The rationale here describes the failure as leaving channels unread, but
compute()usesgroup_id = w / (wei_n / group): with a non-divisible channel count, the trailingwvalues map togroup_id >= group, soidx_outgoes past the output channel dimension and can write/read out of bounds. Update the comment to document the actual invalid-group failure this check prevents.
// compute() walks a group's input channels as one contiguous block of
// weights_channels / group, so an inexact division leaves part of every group unread.
test/op_shape_test.cpp:1005
- This test comment has the same incorrect failure description: integer division does not simply leave part of each group unread; the trailing input channel is assigned to an invalid group and makes
idx_outexceed the output channel bounds. Please describe the out-of-range group mapping instead.
// compute() splits the input channels into equal per-group blocks, so a group that does not
// divide them would leave part of every group unread.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
eddieliao
approved these changes
Sep 14, 2026
eddieliao
left a comment
Contributor
There was a problem hiding this comment.
Overall LGTM; minor nitpick with changelog entry.
kahmed10
approved these changes
Sep 17, 2026
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.
Motivation
convolution_backwardswas hitting accuracy errors with allclose due to reference accumulator inaccuracy. It was accumulating in the low precision types on the reference side.convolution_backwardsfor invalidgroupssettings.Technical Details
convolution_backwards.Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.