PyTorch eager
PyTorch · python · MIT
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 45 lines, MIT.
89_ConvTranspose3d_MaxPool_Softmax_Subtract_Swish_Max.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l2-89-convtranspose3d-maxpool-softmax-subtract-swish-max-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
ConvTranspose3d MaxPool Softmax Subtract Swish Maxfp32 · [128, 3, 16, 32, 32]
NVIDIA H100
5.68ms±0.01
#2 of 2
2026-03-05
ConvTranspose3d MaxPool Softmax Subtract Swish Maxfp32 · [128, 3, 16, 32, 32]
NVIDIA H100
7.68ms±0.02
#2 of 2
2026-03-05
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:02da96bb167c5134f4c72f0ec53f639d090e09c87c2f2d1f7eef6ca4f3afaa12
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
89_ConvTranspose3d_MaxPool_Softmax_Subtract_Swish_Max.py45 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
A model that performs a sequence of operations:
- ConvTranspose3d
- MaxPool3d
- Softmax
- Subtract
- Swish
- Max
"""
def __init__(self, in_channels, out_channels, kernel_size, stride, padding, output_padding, pool_kernel_size, pool_stride, pool_padding):
super(Model, self).__init__()
self.conv_transpose = nn.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=stride, padding=padding, output_padding=output_padding)
self.max_pool = nn.MaxPool3d(kernel_size=pool_kernel_size, stride=pool_stride, padding=pool_padding)
self.subtract = nn.Parameter(torch.randn(out_channels)) # Assuming subtraction is element-wise across channels
def forward(self, x):
x = self.conv_transpose(x)
x = self.max_pool(x)
x = torch.softmax(x, dim=1) # Apply softmax across channels (dim=1)
x = x - self.subtract.view(1, -1, 1, 1, 1) # Subtract across channels
x = torch.sigmoid(x) * x # Swish activation
x = torch.max(x, dim=1)[0] # Max pooling across channels
return x
batch_size = 128
in_channels = 3
out_channels = 16
depth, height, width = 16, 32, 32
kernel_size = 3
stride = 2
padding = 1
output_padding = 1
pool_kernel_size = 2
pool_stride = 2
pool_padding = 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, output_padding, pool_kernel_size, pool_stride, pool_padding]scrolls · 45 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