hipDNN operation support#
2026-03-31
4 min read time
hipDNN operations are implemented through plugins. Each plugin provides its own set of supported operations. For detailed information about what operations are available, refer to the plugin-specific documentation.
Plugins#
MIOpen provider operation support: Provides integration with AMD’s MIOpen library for GPU-accelerated deep learning operations.
Convolution operations (Forward, Dgrad, Wgrad)
Batchnorm operations (Training, Backward, Inference)
Fused operation graphs
hipBLASLt provider operation support: Provides integration with AMD’s hipBLASLt library that provides optimized GEMM operations.
Tensor dimensions and layouts#
Tensor dimension ordering in hipDNN is operation-specific, following the same conventions as PyTorch and cuDNN. The memory layout (channel-first vs channel-last) is always controlled by strides and stride order, not by the order of the tensor dimension vector that always holds values as [N,C,H,W] or [N,C,D,H,W].
For example, memory arranged as NCHW corresponds to stride order {3,2,1,0} (W is the most tightly packed), and NDHWC corresponds to stride order {4,0,3,2,1} (C is the most tightly packed).
Use the TensorLayout constants and the generateStrides() utility to compute strides for common layouts.
The following tables outline the specific dimensions and layouts for supported hipDNN operations.
Convolution#
Tensor |
Shape (4D) |
Shape (5D) |
Description |
|---|---|---|---|
Input (x) |
|
|
Batch, channels, spatial dims |
Weights (w) |
|
|
Output channels, input channels per group, kernel spatial dims |
Output (y) |
|
|
Batch, output channels, output spatial dims |
// Convolution example: dims always follow (N, C, spatial...) ordering
auto x = TensorAttributes()
.set_dim({1, 64, 28, 28}) // N=1, C=64, H=28, W=28
.set_stride(generateStrides({1, 64, 28, 28}, TensorLayout::NHWC.strideOrder));
auto w = TensorAttributes()
.set_dim({128, 64, 3, 3}) // K=128, C=64, R=3, S=3
.set_stride(generateStrides({128, 64, 3, 3}, TensorLayout::NHWC.strideOrder));
Batch normalization#
Tensor |
Shape |
Description |
|---|---|---|
Input (x) |
|
Same ordering as convolution |
Scale, Bias, Mean, Variance |
|
Per-channel parameters |
Output (y) |
Same as input |
Shape preserved |
Statistics are computed per-channel over the batch and spatial dimensions.
Layer normalization#
Tensor |
Shape |
Description |
|---|---|---|
Input (x) |
|
Batch first, then feature dims |
Scale, Bias |
|
Batch dim = 1, remaining dims match input feature dims |
Mean, Inv variance |
Stats dims |
Batch dims from input, normalized dims = 1 |
Normalization is performed over the feature dimensions (all dims where scale > 1).
Matrix multiplication#
Tensor |
Shape |
Description |
|---|---|---|
A |
|
Leading batch dims, last two are matrix dims |
B |
|
K must match A’s last dim |
C (output) |
|
Batch dims are broadcast |
Batch dimensions support broadcasting (dims must be equal or divisible).
// Matmul example: A(batch, M, K) @ B(batch, K, N) -> C(batch, M, N)
auto a = TensorAttributes()
.set_dim({4, 128, 64}) // batch=4, M=128, K=64
.set_stride({128*64, 64, 1});
auto b = TensorAttributes()
.set_dim({4, 64, 256}) // batch=4, K=64, N=256
.set_stride({64*256, 256, 1});
Pointwise operations#
Pointwise operations (ReLU, Sigmoid, Add, Mul, and so on) are dimension-agnostic — they accept tensors of any shape. For binary and ternary operations, inputs are broadcast using NumPy-style broadcasting rules (dimensions compared right-to-left; compatible if equal or 1).