Add assertion when loading cpu and cuda kernel fails
This commit is contained in:
parent
bcc35f08b4
commit
630d0efd8b
|
@ -443,7 +443,7 @@ def quantize(model, weight_bit_width, use_quantization_cache=False, empty_init=F
|
||||||
except:
|
except:
|
||||||
if kernels is None: # CUDA kernels failed
|
if kernels is None: # CUDA kernels failed
|
||||||
print("Cannot load cpu or cuda kernel, quantization failed:")
|
print("Cannot load cpu or cuda kernel, quantization failed:")
|
||||||
assert kernels is None
|
assert kernels is not None
|
||||||
print("Cannot load cpu kernel, don't use quantized model on cpu.")
|
print("Cannot load cpu kernel, don't use quantized model on cpu.")
|
||||||
|
|
||||||
current_device = model.device
|
current_device = model.device
|
||||||
|
|
Loading…
Reference in New Issue