torch.compile (inductor)
PyTorch · python · MIT
Kernel source · 31 lines ↓holds 2 records
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 31 lines, MIT.
23_Softmax.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l1-23-softmax-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.
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:369e0243d060f0432641a13b50dcffa13f49a7dc522066adab0867e0e0fba45f
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
23_Softmax.py31 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Simple model that performs a Softmax activation.
"""
def __init__(self):
super(Model, self).__init__()
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""
Applies Softmax activation to the input tensor.
Args:
x (torch.Tensor): Input tensor of shape (batch_size, num_features).
Returns:
torch.Tensor: Output tensor with Softmax applied, same shape as input.
"""
return torch.softmax(x, dim=1)
batch_size = 4096
dim = 393216
def get_inputs():
x = torch.rand(batch_size, dim)
return [x]
def get_init_inputs():
return [] # No special initialization inputs neededscrolls · 31 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