Skip to main content

Module groupnorm

Module groupnorm 

Source
Expand description

GroupNorm Triton kernels.

GroupNorm partitions C channels into G groups and normalises over each group independently, per sample:

y[n,c,l] = (x[n,c,l] - mean[n,g]) / sqrt(var[n,g] + eps) * γ[c] + β[c]

where g = c / (C / G) is the group index.

Input shape: [N, C, L]. Grid: [N * G] — one CTA per (sample, group). Each CTA covers channels [g*(C/G), (g+1)*(C/G)) × all L elements, so the normalised tile has (C/G) * L elements.

BLOCK_NL must be >= (C/G) * L and a power of two.

Structs§

GroupNormBackward
GroupNorm backward pass.
GroupNormForward
GroupNorm training forward — saves per-(n,g) mean and rstd.
GroupNormForwardInference
GroupNorm forward (inference).

Functions§

group_norm_backward
GroupNorm backward pass.
group_norm_forward
GroupNorm training forward — saves per-(n,g) mean and rstd.
group_norm_forward_inference
GroupNorm forward (inference).