[ROCm] Expose kFp8DynamicTokenSym on AITER PTPC linears (#54248)

Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Rebecca Lee
2026-09-16 11:48:30 -05:00
committed by GitHub
co-authored by Cursor
parent 8c1557a79c
commit 6ca2b23e22
5 changed files with 104 additions and 4 deletions
@@ -16,6 +16,8 @@ from vllm.model_executor.layers.quantization.utils.fp8_utils import (
)
from vllm.model_executor.layers.quantization.utils.quant_utils import (
GroupShape,
QuantKey,
kFp8DynamicTokenSym,
)
from vllm.model_executor.utils import replace_parameter
from vllm.platforms import current_platform
@@ -150,6 +152,12 @@ class AiterPreshuffledPerTokenFp8ScaledMMLinearKernel(FP8ScaledMMLinearKernel):
return False, "requires aiter library to be installed."
return True, None
def input_quant_key(self) -> QuantKey | None:
# Does not call get_output_padding() - torch fallbacks
# resolve padding from compilation_config, which is unset in
# profile_run. This kernel does not pad activations.
return kFp8DynamicTokenSym
@classmethod
def can_implement(cls, c: FP8ScaledMMLinearLayerConfig) -> tuple[bool, str | None]:
is_ptpc = (
@@ -242,6 +250,11 @@ class AiterHipbMMPerTokenFp8ScaledMMLinearKernel(FP8ScaledMMLinearKernel):
return True, None
def input_quant_key(self) -> QuantKey | None:
# Same per-token FP8 consume path as
# AiterPreshuffledPerTokenFp8ScaledMMLinearKernel.
return kFp8DynamicTokenSym
@classmethod
def can_implement(cls, c: FP8ScaledMMLinearLayerConfig) -> tuple[bool, str | None]:
is_ptpc = (
@@ -319,6 +332,9 @@ class AiterPerTokenFp8ScaledMMLinearKernel(FP8ScaledMMLinearKernel):
compute_capability
)
def input_quant_key(self) -> QuantKey | None:
return kFp8DynamicTokenSym
@classmethod
def can_implement(cls, c: FP8ScaledMMLinearLayerConfig) -> tuple[bool, str | None]:
is_ptpc = (