PyTorch eager
PyTorch · python · MIT
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 31 lines, MIT.
75_Gemm_GroupNorm_Min_BiasAdd.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-75-gemm-groupnorm-min-biasadd-torch?include=source"interfacepython · torch_eager
symbolModel.forward
Compatibility
measured onNVIDIA H100
declared hardwaredeclared only
architectures—
dtypes
Benchmark evidence
2 measurements across 1 GPU, fastest first.
Operation / workload
Hardware
Latency
Rank
Observed
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:3d7d151b7851ba187a0ad6935bd297babe841caccd8b78fce85ba11d4dec203a
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
75_Gemm_GroupNorm_Min_BiasAdd.py31 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model that performs a GEMM, Group Normalization, Minimum operation, and Bias addition.
"""
def __init__(self, in_features, out_features, num_groups, bias_shape):
super(Model, self).__init__()
self.gemm = nn.Linear(in_features, out_features)
self.group_norm = nn.GroupNorm(num_groups, out_features)
self.bias = nn.Parameter(torch.randn(bias_shape))
def forward(self, x):
x = self.gemm(x)
x = self.group_norm(x)
x = torch.min(x, dim=1, keepdim=True)[0]
x = x + self.bias
return x
batch_size = 1024
in_features = 8192
out_features = 8192
num_groups = 512
bias_shape = (1, out_features, 1, 1)
def get_inputs():
return [torch.rand(batch_size, in_features)]
def get_init_inputs():
return [in_features, out_features, num_groups, bias_shape]scrolls · 31 lines total
Source code from KernelBench, © 2023 Anne Ouyang, Simon Guo, Azalia Mirhoseini (Scaling Intelligence Lab, Stanford University), MIT License · MIT
Best evidence level for this revision: reported
JSON