Skip to content

Commit 010b5bc

Browse files
authored
Merge pull request vllm-project#9 from ri938/organise
dont error if user doesnt have kernels installed
2 parents 2617c55 + 5fcc1c4 commit 010b5bc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

vllm/model_executor/layers/quant.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55

66

77
try:
8-
import awq_inference_engine # with CUDA kernels
8+
import awq_inference_engine
9+
KERNELS_INSTALLED = True
910
except ImportError as ex:
10-
raise ImportError(
11-
"Unable to import awq_inference_engine: run setup.py"
12-
" to install AWQ CUDA kernels")
11+
KERNELS_INSTALLED = False
1312

1413

1514
class ScaledActivation(nn.Module):
@@ -34,6 +33,11 @@ def __init__(
3433
):
3534
super().__init__()
3635

36+
if not KERNELS_INSTALLED:
37+
raise ImportError(
38+
"Unable to import awq_ext: run setup.py"
39+
" to install AWQ CUDA kernels")
40+
3741
if w_bit not in [4]:
3842
raise NotImplementedError("Only 4-bit are supported for now.")
3943

0 commit comments

Comments
 (0)