2024-06-13 11:18:08 -04:00
|
|
|
from vllm.model_executor.layers.quantization import QUANTIZATION_METHODS
|
2024-07-02 20:12:22 -07:00
|
|
|
from vllm.platforms import current_platform
|
2024-06-13 11:18:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
def is_quant_method_supported(quant_method: str) -> bool:
|
|
|
|
# Currently, all quantization methods require Nvidia or AMD GPUs
|
2024-09-13 02:20:14 -07:00
|
|
|
if not (current_platform.is_cuda() or current_platform.is_rocm()):
|
2024-06-13 11:18:08 -04:00
|
|
|
return False
|
|
|
|
|
2024-07-02 20:12:22 -07:00
|
|
|
capability = current_platform.get_device_capability()
|
2024-09-18 18:38:11 +08:00
|
|
|
assert capability is not None
|
|
|
|
|
|
|
|
min_capability = QUANTIZATION_METHODS[quant_method].get_min_capability()
|
|
|
|
|
|
|
|
return capability.to_int() >= min_capability
|