std :: ml::gpu_cudnn
Struct std::CudaHalfConv2D
struct CudaHalfConv2D {
struct CudaHalfBuf weight;
struct CudaHalfBuf bias;
unsigned long inChannels;
unsigned long outChannels;
unsigned long kH;
unsigned long kW;
unsigned long stride;
unsigned long padding;
}The same convolution on 16-bit NCHW tensors (gpu_cuda.h's CudaHalfBuf): cuDNN's half / bfloat16 convolutions (fp32 compute, tensor cores where cuDNN picks them), rounding once per output; the bias add and ReLU are one fused 16-bit kernel (cuda_half_bias). Weights are rounded from a Conv2D's fp32 ones on upload. x, y and the layer must share one dtype.
Fields
Methods
§
int forward(
struct CudaHalfBuf x,
struct CudaHalfBuf y,
unsigned long batch,
unsigned long height,
unsigned long width,
) constsource · definition§
int forward_relu(
struct CudaHalfBuf x,
struct CudaHalfBuf y,
unsigned long batch,
unsigned long height,
unsigned long width,
) constsource · definitionCUDA_FP16 / CUDA_BF16