Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flashinfer/prefill.py
Original file line number Diff line number Diff line change
Expand Up @@ -3821,8 +3821,8 @@ def fmha_v2_prefill_deepseek(
If return_lse is True, the output will be a tuple of two tensors, the first is the output tensor, the second is the lse tensor.
If return_lse is False, the output will be a single tensor.
"""
if not is_sm120a_supported(query.device):
raise ValueError("fmha_v2_prefill_deepseek is only supported on SM120 GPUs.")
if not (is_sm120a_supported(query.device) or is_sm121a_supported(query.device)):
raise ValueError("fmha_v2_prefill_deepseek is only supported on SM12x GPUs.")
assert query.shape[3] == 192 and key.shape[3] == 192 and value.shape[3] == 128, (
"currently only support deepseek r1 192 query and 128 value"
)
Expand Down
9 changes: 6 additions & 3 deletions tests/attention/test_fmha_v2_prefill_deepseek.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from flashinfer.prefill import fmha_v2_prefill_deepseek
from tests.utils_fp8 import to_float8
from flashinfer.utils import is_sm120a_supported
from flashinfer.utils import is_sm120a_supported, is_sm121a_supported


def attention_ref(
Expand Down Expand Up @@ -57,8 +57,11 @@ def attention_ref(
def test_fmha_v2_prefill_deepseek(
batch_size, num_heads, head_dim_qk, head_dim_v, seq_len, qkv_dtype, o_dtype
):
if not is_sm120a_supported(torch.device("cuda")):
pytest.skip("fmha_v2_prefill_deepseek is only supported on SM120 GPUs.")
if not (
is_sm120a_supported(torch.device("cuda"))
or is_sm121a_supported(torch.device("cuda"))
):
pytest.skip("fmha_v2_prefill_deepseek is only supported on SM12x GPUs.")
torch.manual_seed(42)

def initialize_tensors(batch_size, num_heads, head_dim_qk, head_dim_v, seq_len):
Expand Down
Loading