[Attention][DSA] Enable W4A16 DSA (#51724)
Signed-off-by: Shiyang Chen <shiychen@nvidia.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user