Skip to content

Commit

Permalink
restore fa
Browse files Browse the repository at this point in the history
  • Loading branch information
hliuca committed Nov 20, 2024
1 parent 1348c23 commit e5cf3da
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vllm/attention/backends/rocm_flash_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type

import torch
from flash_attn import flash_attn_varlen_func # noqa: F401

import vllm.envs as envs
from vllm import _custom_ops as ops
Expand Down Expand Up @@ -508,8 +507,12 @@ def __init__(
if not current_platform.has_device_capability(90):
self.use_naive_attn = True
else:
self.attn_func = flash_attn_varlen_func
logger.debug("Using CK FA in ROCmBackend")
try:
from flash_attn import flash_attn_varlen_func # noqa: F401
self.attn_func = flash_attn_varlen_func

Check failure on line 512 in vllm/attention/backends/rocm_flash_attn.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Cannot determine type of "attn_func" [has-type]

Check failure on line 512 in vllm/attention/backends/rocm_flash_attn.py

View workflow job for this annotation

GitHub Actions / mypy (3.10)

Cannot determine type of "attn_func" [has-type]

Check failure on line 512 in vllm/attention/backends/rocm_flash_attn.py

View workflow job for this annotation

GitHub Actions / mypy (3.11)

Cannot determine type of "attn_func" [has-type]

Check failure on line 512 in vllm/attention/backends/rocm_flash_attn.py

View workflow job for this annotation

GitHub Actions / mypy (3.12)

Cannot determine type of "attn_func" [has-type]
logger.debug("Using CK FA in ROCmBackend")
except ModuleNotFoundError:
self.use_naive_attn = True

if self.use_naive_attn:
if logits_soft_cap is not None:
Expand Down

0 comments on commit e5cf3da

Please sign in to comment.