Add assertion when loading cpu and cuda kernel fails

This commit is contained in:
songxxzp 2023-04-14 20:00:41 +08:00
parent bcc35f08b4
commit 630d0efd8b
1 changed files with 1 additions and 1 deletions

View File

@ -443,7 +443,7 @@ def quantize(model, weight_bit_width, use_quantization_cache=False, empty_init=F
except:
if kernels is None: # CUDA kernels 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.")
current_device = model.device