torch.compile (inductor)
PyTorch · python · MIT
Kernel source · 32 lines ↓holds 1 record
Use it
Vendorable · source mirrored · MITView source →
No package. Vendor the mirrored source: 32 lines, MIT.
24_LogSoftmax.py
curl "https://kernelindex.com/api/v1/implementations/kernelbench-l1-24-logsoftmax-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
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:d83b53354940499f5ec4636775215c69f2313742cb3762fcb7d06662e2d57e38
license declaredMIT
license concludedMIT
imported2026-08-26
Kernel source
24_LogSoftmax.py32 lines
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Simple model that performs a LogSoftmax activation.
"""
def __init__(self, dim: int = 1):
super(Model, self).__init__()
self.dim = dim
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""
Applies LogSoftmax activation to the input tensor.
Args:
x (torch.Tensor): Input tensor of shape (batch_size, dim).
Returns:
torch.Tensor: Output tensor with LogSoftmax applied, same shape as input.
"""
return torch.log_softmax(x, dim=self.dim)
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 · 32 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