[Kernel][DSV4.1] Fuse MXFP8 wo_b GEMM with sequence-parallel reduce-scatter (#57428)
Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg> Signed-off-by: Canlin <canlinguosdu@gmail.com> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
co-authored by
Thien Tran
OpenAI Codex
Claude Fable 5.1
Jee Jee Li
parent
a6c47fbbf4
commit
f92b78f6ef
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from collections.abc import Callable
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
@@ -31,7 +33,7 @@ def deep_gemm_fp8_o_proj(
|
||||
positions: torch.Tensor,
|
||||
cos_sin_cache: torch.Tensor,
|
||||
wo_a: nn.Module,
|
||||
wo_b: nn.Module,
|
||||
wo_b: Callable[[torch.Tensor], torch.Tensor],
|
||||
*,
|
||||
n_groups: int,
|
||||
heads_per_group: int,
|
||||
@@ -44,7 +46,9 @@ def deep_gemm_fp8_o_proj(
|
||||
"""O projection: inverse RoPE + grouped wo_a + wo_b.
|
||||
|
||||
Shared by the FlashMLA and FlashInfer CUDA backends. The attention
|
||||
layer selects the recipe at initialization.
|
||||
layer selects the recipe at initialization. ``wo_b`` is any callable over
|
||||
the flattened ``z``: the projection module itself, or a wrapper that also
|
||||
reduce-scatters its output (DeepSeek-V4.1 GEMM-RS).
|
||||
"""
|
||||
use_fp8 = wo_a.weight.dtype == torch.float8_e4m3fn
|
||||
o_proj_input, o_scale = fused_inv_rope_fp8_quant(
|
||||
|
||||
Reference in New Issue
Block a user