[Bugfix] Add verbose error if scipy is missing for blocksparse attention (#5695)
This commit is contained in:
parent
f1e15da6fe
commit
e58294ddf2
@ -6,7 +6,14 @@ from functools import lru_cache
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
import triton
|
import triton
|
||||||
from scipy import sparse
|
|
||||||
|
try:
|
||||||
|
from scipy import sparse
|
||||||
|
except ImportError as err:
|
||||||
|
raise ImportError("Please install scipy via "
|
||||||
|
"`pip install scipy` to use "
|
||||||
|
"BlockSparseAttention in "
|
||||||
|
"models such as Phi-3.") from err
|
||||||
|
|
||||||
|
|
||||||
def dense_to_crow_col(x: torch.Tensor):
|
def dense_to_crow_col(x: torch.Tensor):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user