Skip to content
KernelIndex
Search⌘K

torch.compile (inductor)

PyTorch · python · MIT

Use it

Vendorable · source mirrored · MITView source →

No package. Vendor the mirrored source: 35 lines, MIT.

100_ConvTranspose3d_Clamp_Min_Divide.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-100-convtranspose3d-clamp-min-divide-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
ConvTranspose3d Clamp Min Dividefp32 · [16, 64, 24, 48, 48]
NVIDIA H100
8.29ms±0.04
#1 of 2
2026-03-05
ConvTranspose3d Clamp Min Dividefp32 · [16, 64, 24, 48, 48]
NVIDIA H100
12.8ms±0.01
#1 of 2
2026-03-05

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:69d8510f3d7dfe8101ca0aff5144fd9eacec11c0f5ceb3a7bac04ad9ecd8ab96
license declaredMIT
license concludedMIT
imported2026-08-26

Kernel source

100_ConvTranspose3d_Clamp_Min_Divide.py35 lines
import torch
import torch.nn as nn

class Model(nn.Module):
    """
    A model that performs a transposed 3D convolution, clamps the output to a minimum value, 
    and then divides the result by a constant.
    """
    def __init__(self, in_channels, out_channels, kernel_size, stride, padding, min_value, divisor):
        super(Model, self).__init__()
        self.conv_transpose = nn.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=stride, padding=padding)
        self.min_value = min_value
        self.divisor = divisor

    def forward(self, x):
        x = self.conv_transpose(x)
        x = torch.clamp(x, min=self.min_value)
        x = x / self.divisor
        return x

batch_size = 16
in_channels = 64
out_channels = 128
depth, height, width = 24, 48, 48
kernel_size = 3
stride = 2
padding = 1
min_value = -1.0
divisor = 2.0

def get_inputs():
    return [torch.rand(batch_size, in_channels, depth, height, width)]

def get_init_inputs():
    return [in_channels, out_channels, kernel_size, stride, padding, min_value, divisor]
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