torch.compile (inductor)
PyTorch · python · MIT
Kernel source · 35 lines ↓holds 2 records
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 35 lines, MIT.
36_ConvTranspose2d_Min_Sum_GELU_Add.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-36-convtranspose2d-min-sum-gelu-add-torch-compile-inductor?include=source"interfacepython · torch_compile_inductor
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:34b77fc4969ed3914d68fc028929511cbcc526eb1a701486c3c831e4ce353e01
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
36_ConvTranspose2d_Min_Sum_GELU_Add.py35 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
A model that performs a convolution transpose, minimum operation, sum operation, GELU activation and addition.
"""
def __init__(self, in_channels, out_channels, kernel_size, stride, padding, output_padding, bias_shape):
super(Model, self).__init__()
self.conv_transpose = nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride, padding, output_padding)
self.bias = nn.Parameter(torch.randn(bias_shape))
def forward(self, x):
x = self.conv_transpose(x)
x = torch.min(x, dim=1, keepdim=True)[0] # Minimum operation along channel dimension
x = torch.sum(x, dim=2, keepdim=True) # Sum operation along height dimension
x = torch.nn.functional.gelu(x) # GELU activation
x = x + self.bias
return x
batch_size = 16
in_channels = 64
out_channels = 128
height, width = 128, 128
kernel_size = 3
stride = 2
padding = 1
output_padding = 1
bias_shape = (1, 1, 1)
def get_inputs():
return [torch.rand(batch_size, in_channels, height, width)]
def get_init_inputs():
return [in_channels, out_channels, kernel_size, stride, padding, output_padding, bias_shape]scrolls · 35 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