torch.compile (inductor)
PyTorch · python · MIT
Kernel source · 34 lines ↓holds 2 records
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 34 lines, MIT.
48_Conv3d_Scaling_Tanh_Multiply_Sigmoid.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-48-conv3d-scaling-tanh-multiply-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
Conv3d Scaling Tanh Multiply Sigmoidfp32 · [128, 3, 16, 64, 64]
NVIDIA H100
1.96ms±0.01
#1 of 2
2026-03-05
Conv3d Scaling Tanh Multiply Sigmoidfp32 · [128, 3, 16, 64, 64]
NVIDIA H100
3.84ms±0.00
#1 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:49dba1cc8890d9cc5835db7824995d13b6c94cb84740e4809ff7f971b04f911b
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
48_Conv3d_Scaling_Tanh_Multiply_Sigmoid.py34 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Model that performs a 3D convolution, scales the output, applies tanh, multiplies by a scaling factor, and applies sigmoid.
"""
def __init__(self, in_channels, out_channels, kernel_size, scaling_factor, bias_shape):
super(Model, self).__init__()
self.conv = nn.Conv3d(in_channels, out_channels, kernel_size)
self.scaling_factor = nn.Parameter(torch.randn(bias_shape))
self.bias = nn.Parameter(torch.randn(bias_shape))
def forward(self, x):
x = self.conv(x)
x = x * self.scaling_factor
x = torch.tanh(x)
x = x * self.bias
x = torch.sigmoid(x)
return x
batch_size = 128
in_channels = 3
out_channels = 16
depth, height, width = 16, 64, 64
kernel_size = 3
scaling_factor = 2
bias_shape = (out_channels, 1, 1, 1)
def get_inputs():
return [torch.rand(batch_size, in_channels, depth, height, width)]
def get_init_inputs():
return [in_channels, out_channels, kernel_size, scaling_factor, bias_shape]scrolls · 34 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