Problem
ConvolutionWgradNode::infer_properties_node() and ConvolutionDgradNode::infer_properties_node() silently assume groups = 1 when inferring output tensor dimensions. This produces incorrect results for grouped convolutions.
The group count is normally computed from tensor dimension ratios (e.g., X.C / W.C), but when the output tensor is the unknown being inferred, this creates a circular dependency — the group count cannot be determined without the output dimensions.
Both files already document this with the comment: "Impossible to infer group count without dw/dx dimensions. Therefore, assume groups = 1."
Impact
- Wgrad (
ConvolutionWgradNode.hpp): DW[1] is inferred as C_in instead of C_in/G
- Dgrad (
ConvolutionDgradNode.hpp): DX[1] is inferred as C_in_per_group instead of C_in_per_group * G
For standard (non-grouped) convolutions, the inference is correct. The issue only affects grouped convolutions where the user relies on dimension inference.
Note: ConvolutionFpropNode does not have this issue because output channels are always W[0] regardless of group count.
Requested Changes
- Add
#include "hipdnn_frontend/Logging.hpp" to both ConvolutionWgradNode.hpp and ConvolutionDgradNode.hpp
- Emit a
HIPDNN_FE_LOG_WARN when output dimensions are inferred, warning that groups=1 is assumed and the result may be incorrect for grouped convolutions
- Update documentation in the
graph.hpp public header and the convolution node headers (ConvolutionWgradNode.hpp, ConvolutionDgradNode.hpp) to document this limitation — specifically that output tensor dimension inference assumes non-grouped convolution, and users performing grouped convolutions should provide explicit output tensor dimensions
Files
projects/hipdnn/frontend/include/hipdnn_frontend/node/ConvolutionWgradNode.hpp
projects/hipdnn/frontend/include/hipdnn_frontend/node/ConvolutionDgradNode.hpp
projects/hipdnn/frontend/include/hipdnn_frontend/graph.hpp (documentation update)
Problem
ConvolutionWgradNode::infer_properties_node()andConvolutionDgradNode::infer_properties_node()silently assumegroups = 1when inferring output tensor dimensions. This produces incorrect results for grouped convolutions.The group count is normally computed from tensor dimension ratios (e.g.,
X.C / W.C), but when the output tensor is the unknown being inferred, this creates a circular dependency — the group count cannot be determined without the output dimensions.Both files already document this with the comment: "Impossible to infer group count without dw/dx dimensions. Therefore, assume groups = 1."
Impact
ConvolutionWgradNode.hpp):DW[1]is inferred asC_ininstead ofC_in/GConvolutionDgradNode.hpp):DX[1]is inferred asC_in_per_groupinstead ofC_in_per_group * GFor standard (non-grouped) convolutions, the inference is correct. The issue only affects grouped convolutions where the user relies on dimension inference.
Note:
ConvolutionFpropNodedoes not have this issue because output channels are alwaysW[0]regardless of group count.Requested Changes
#include "hipdnn_frontend/Logging.hpp"to bothConvolutionWgradNode.hppandConvolutionDgradNode.hppHIPDNN_FE_LOG_WARNwhen output dimensions are inferred, warning thatgroups=1is assumed and the result may be incorrect for grouped convolutionsgraph.hpppublic header and the convolution node headers (ConvolutionWgradNode.hpp,ConvolutionDgradNode.hpp) to document this limitation — specifically that output tensor dimension inference assumes non-grouped convolution, and users performing grouped convolutions should provide explicit output tensor dimensionsFiles
projects/hipdnn/frontend/include/hipdnn_frontend/node/ConvolutionWgradNode.hppprojects/hipdnn/frontend/include/hipdnn_frontend/node/ConvolutionDgradNode.hppprojects/hipdnn/frontend/include/hipdnn_frontend/graph.hpp(documentation update)