torch.compile (inductor)
PyTorch · python · MIT
Kernel source · 37 lines ↓holds 2 records
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 37 lines, MIT.
91_ConvTranspose2d_Softmax_BiasAdd_Scaling_Sigmoid.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-91-convtranspose2d-softmax-biasadd-scaling-sigmoid-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
ConvTranspose2d Softmax BiasAdd Scaling Sigmoidfp32 · [128, 64, 64, 64]
NVIDIA H100
3.11ms±0.00
#1 of 2
2026-03-05
ConvTranspose2d Softmax BiasAdd Scaling Sigmoidfp32 · [128, 64, 64, 64]
NVIDIA H100
3.81ms±0.02
#1 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:9d782a4890b0464770a8391533eb5f94ea63bdc9e854ad0b7d6168769d50d459
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
91_ConvTranspose2d_Softmax_BiasAdd_Scaling_Sigmoid.py37 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model that performs a transposed convolution, applies softmax, adds a bias term, scales the result, and applies sigmoid.
"""
def __init__(self, in_channels, out_channels, kernel_size, stride, padding, output_padding, bias_shape, scaling_factor):
super(Model, self).__init__()
self.conv_transpose = nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=stride, padding=padding, output_padding=output_padding)
self.bias = nn.Parameter(torch.randn(bias_shape))
self.scaling_factor = scaling_factor
def forward(self, x):
x = self.conv_transpose(x)
x = torch.softmax(x, dim=1)
x = x + self.bias
x = x * self.scaling_factor
x = torch.sigmoid(x)
return x
batch_size = 128
in_channels = 64
out_channels = 128
height, width = 64, 64
kernel_size = 4
stride = 2
padding = 1
output_padding = 1
bias_shape = (out_channels, 1, 1)
scaling_factor = 2.0
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, scaling_factor]scrolls · 37 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