songxxzp
commited on
Commit
·
630d0ef
1
Parent(s):
bcc35f0
Add assertion when loading cpu and cuda kernel fails
Browse files- quantization.py +1 -1
quantization.py
CHANGED
@@ -443,7 +443,7 @@ def quantize(model, weight_bit_width, use_quantization_cache=False, empty_init=F
|
|
443 |
except:
|
444 |
if kernels is None: # CUDA kernels failed
|
445 |
print("Cannot load cpu or cuda kernel, quantization failed:")
|
446 |
-
assert kernels is None
|
447 |
print("Cannot load cpu kernel, don't use quantized model on cpu.")
|
448 |
|
449 |
current_device = model.device
|
|
|
443 |
except:
|
444 |
if kernels is None: # CUDA kernels failed
|
445 |
print("Cannot load cpu or cuda kernel, quantization failed:")
|
446 |
+
assert kernels is not None
|
447 |
print("Cannot load cpu kernel, don't use quantized model on cpu.")
|
448 |
|
449 |
current_device = model.device
|