[Attention][DSA] Enable W4A16 DSA (#51724)

Signed-off-by: Shiyang Chen <shiychen@nvidia.com>
This commit is contained in:
sychen52
2026-09-01 12:37:47 +08:00
committed by GitHub
parent ce2e343be1
commit 7c5dc571cb
17 changed files with 824 additions and 22 deletions
+6
View File
@@ -54,6 +54,7 @@ class KVQuantMode(IntEnum):
TURBOQUANT_4BIT_NC = 7
TURBOQUANT_K3V4_NC = 8
TURBOQUANT_3BIT_NC = 9
NVFP4_DS_MLA = 10 # opaque-bytes NVFP4 DS-MLA layouts (FlashMLA sparse)
@property
def is_per_token_head(self) -> bool:
@@ -88,6 +89,11 @@ def get_kv_quant_mode(kv_cache_dtype: str) -> KVQuantMode:
return KVQuantMode.INT8_PER_TOKEN_HEAD
if kv_cache_dtype == "fp8_per_token_head":
return KVQuantMode.FP8_PER_TOKEN_HEAD
# Must precede the ``nvfp4`` prefix test below, which would otherwise match.
if kv_cache_dtype == "nvfp4_ds_mla":
# Page size is keyed on cache_dtype_str in the MLA specs, not
# nvfp4_kv_cache_full_dim.
return KVQuantMode.NVFP4_DS_MLA
if kv_cache_dtype.startswith("nvfp4"):
return KVQuantMode.NVFP4
if isinstance(kv_cache_dtype, str) and kv_cache_dtype.startswith("turboquant_"):