PyTorch eager
PyTorch · python · MIT
Kernel source · 36 lines ↓holds 1 record
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 36 lines, MIT.
83_Conv3d_GroupNorm_Min_Clamp_Dropout.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-83-conv3d-groupnorm-min-clamp-dropout-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
Conv3d GroupNorm Min Clamp Dropoutfp32 · [128, 3, 16, 64, 64]
NVIDIA H100
3.68ms±0.00
#1 of 2
2026-03-05
Conv3d GroupNorm Min Clamp Dropoutfp32 · [128, 3, 16, 64, 64]
NVIDIA H100
6.39ms±0.00
#2 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:73351fbec2c985498ad3a22c6b6c762970f779940f4087fc3a97a872fc984402
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
83_Conv3d_GroupNorm_Min_Clamp_Dropout.py36 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model that performs a 3D convolution, applies Group Normalization, minimum, clamp, and dropout.
"""
def __init__(self, in_channels, out_channels, kernel_size, groups, min_value, max_value, dropout_p):
super(Model, self).__init__()
self.conv = nn.Conv3d(in_channels, out_channels, kernel_size)
self.norm = nn.GroupNorm(groups, out_channels)
self.dropout = nn.Dropout(dropout_p)
def forward(self, x):
x = self.conv(x)
x = self.norm(x)
x = torch.min(x, torch.tensor(min_value, device=x.device))
x = torch.clamp(x, min=min_value, max=max_value)
x = self.dropout(x)
return x
batch_size = 128
in_channels = 3
out_channels = 16
depth, height, width = 16, 64, 64
kernel_size = 3
groups = 8
min_value = 0.0
max_value = 1.0
dropout_p = 0.2
def get_inputs():
return [torch.rand(batch_size, in_channels, depth, height, width)]
def get_init_inputs():
return [in_channels, out_channels, kernel_size, groups, min_value, max_value, dropout_p]scrolls · 36 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