[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
+25
View File
@@ -3082,6 +3082,31 @@ def cp_gather_and_upconvert_fp8_kv_cache(
)
def cp_gather_and_upconvert_nvfp4_kv_cache(
src_cache: torch.Tensor,
dst: torch.Tensor,
block_table: torch.Tensor,
workspace_starts: torch.Tensor,
batch_size: int,
) -> None:
"""Gather and upconvert an nvfp4_ds_mla KV cache to a BF16 workspace.
Args:
src_cache: NVFP4 KV cache [num_blocks, block_size, 352] (uint8)
dst: BF16 output workspace [total_tokens, 576]
block_table: Block indices [num_reqs, max_blocks]
workspace_starts: Workspace start offsets [num_reqs]
batch_size: Number of requests
"""
torch.ops._C_cache_ops.cp_gather_and_upconvert_nvfp4_kv_cache(
src_cache,
dst,
block_table,
workspace_starts,
batch_size,
)
def concat_mla_q(
ql_nope: torch.Tensor,
q_pe: torch.Tensor,