Skip to content

vllm.model_executor.kernels.linear.scaled_mm.pytorch

Classes:

BlockWiseTorchFP8ScaledMMLinearKernel

Bases: Fp8BlockScaledMMLinearKernel

FP8 block-scaled linear kernel using torch._scaled_mm.

Implements the block-scaled path of torch._scaled_mm, which dispatches on the shapes of the scale tensors. For A = [M, K] and B = [K, N] (both fp8) the op's block path requires, with float32 scales: * 1x128 activation: scale_a = [M, ceil(K / 128)] * 128x128 weight: scale_b = [ceil(K / 128), ceil(N / 128)]

TorchFP8ScaledMMLinearKernel

Bases: FP8ScaledMMLinearKernel

Base class for FP8 linear kernels using Torch. Each subclass represents a kernel variant for specific device capabilities and torch versions.