[Bugfix] Use int8 workspace for FlashInfer MLA decode (#48046)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Hill
2026-07-08 23:39:40 +00:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 56da398dac
commit 95d6d6f4bb
3 changed files with 93 additions and 47 deletions
@@ -42,7 +42,9 @@ def _get_workspace_buffer(return_lse: bool) -> torch.Tensor:
else FLASHINFER_MLA_WORKSPACE_BUFFER_SIZE
)
if _fi_workspace is None or _fi_workspace.numel() < buffer_size:
_fi_workspace = torch.zeros(buffer_size, dtype=torch.uint8, device="cuda")
# FlashInfer's CuteDSL MLA-decode tactic requires an int8 workspace;
# the trtllm-gen path views it as uint8, so int8 is safe for all backends.
_fi_workspace = torch.zeros(buffer_size, dtype=torch.int8, device="cuda")
return _fi_workspace
@@ -355,9 +355,11 @@ _fi_sparse_workspace: torch.Tensor | None = None
def _get_workspace_buffer(device: torch.device) -> torch.Tensor:
global _fi_sparse_workspace
if _fi_sparse_workspace is None:
# FlashInfer's CuteDSL MLA-decode tactic requires an int8 workspace;
# the trtllm-gen path views it as uint8, so int8 is safe for all backends.
_fi_sparse_workspace = torch.zeros(
envs.VLLM_FLASHINFER_WORKSPACE_BUFFER_SIZE,
dtype=torch.uint8,
dtype=torch.int8,
device=device,
)
return _fi_sparse_workspace