Skip to content

[hipdnn] Warn when conv wgrad/dgrad infers output dims assuming groups=1#7263

Merged
BrianHarrisonAMD merged 4 commits into
ROCm:developfrom
1wos:hipdnn-warn-groups-inference
May 12, 2026
Merged

[hipdnn] Warn when conv wgrad/dgrad infers output dims assuming groups=1#7263
BrianHarrisonAMD merged 4 commits into
ROCm:developfrom
1wos:hipdnn-warn-groups-inference

Conversation

@1wos
Copy link
Copy Markdown

@1wos 1wos commented May 11, 2026

Closes #5259.

The two infer_properties_node() implementations silently assume groups = 1 when computing dw[1] / dx[1], which gives the wrong channel count for grouped convolutions unless the caller passes dw / dx shapes explicitly.

This PR makes the assumption visible. Each infer_properties_node() now emits a HIPDNN_FE_LOG_WARN describing what was assumed and how to override it, and the inline comments are rewritten to match. The same caveat is added as a @note on conv_dgrad and conv_wgrad in Graph.hpp so the limitation shows up in the public docs.

No behavior change for non-grouped convolutions or for callers that pass explicit dw / dx dimensions. Grouped convolutions that previously relied on inference now log a warning; the inferred channel count itself is unchanged by this PR, since fixing it would require a separate API discussion.

@1wos 1wos requested a review from a team as a code owner May 11, 2026 05:08
@assistant-librarian assistant-librarian Bot added the external contribution Code contribution from users community.. label May 11, 2026
@BrianHarrisonAMD
Copy link
Copy Markdown
Contributor

Thanks for the contribution @1wos!

Heads up, I have updated to latest develop, and enabled the CI run.

Comment thread projects/hipdnn/frontend/include/hipdnn_frontend/Graph.hpp Outdated
Comment thread projects/hipdnn/frontend/include/hipdnn_frontend/Graph.hpp Outdated
Copy link
Copy Markdown
Contributor

@BrianHarrisonAMD BrianHarrisonAMD left a comment

Choose a reason for hiding this comment

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

Looking good to me!

Minor nit phrasing that would be nice to get in, but not a huge deal.

@1wos
Copy link
Copy Markdown
Author

1wos commented May 11, 2026

Thanks for the suggestion! Updated both notes.

@BrianHarrisonAMD
Copy link
Copy Markdown
Contributor

Kicking off CI run, and will merge once it passes.

Thanks for the contribution!

@BrianHarrisonAMD BrianHarrisonAMD enabled auto-merge (squash) May 12, 2026 14:10
@BrianHarrisonAMD BrianHarrisonAMD merged commit 4e76a3f into ROCm:develop May 12, 2026
25 checks passed
amontoison pushed a commit to amontoison/rocm-libraries that referenced this pull request May 13, 2026
…s=1 (ROCm#7263)

Closes ROCm#5259.

The two `infer_properties_node()` implementations silently assume
`groups = 1` when computing `dw[1]` / `dx[1]`, which gives the wrong
channel count for grouped convolutions unless the caller passes `dw` /
`dx` shapes explicitly.

This PR makes the assumption visible. Each `infer_properties_node()` now
emits a `HIPDNN_FE_LOG_WARN` describing what was assumed and how to
override it, and the inline comments are rewritten to match. The same
caveat is added as a `@note` on `conv_dgrad` and `conv_wgrad` in
`Graph.hpp` so the limitation shows up in the public docs.

No behavior change for non-grouped convolutions or for callers that pass
explicit `dw` / `dx` dimensions. Grouped convolutions that previously
relied on inference now log a warning; the inferred channel count itself
is unchanged by this PR, since fixing it would require a separate API
discussion.

---------

Co-authored-by: BrianHarrisonAMD <169072757+BrianHarrisonAMD@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external contribution Code contribution from users community.. project: hipdnn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[hipDNN] Add warning when conv wgrad/dgrad infers output tensor with groups=1 assumption

2 participants