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-06-13 11:18:08 -04:00
|
|
|
capability = capability[0] * 10 + capability[1]
|
2024-06-16 10:07:34 -04:00
|
|
|
return (capability >=
|
2024-06-13 11:18:08 -04:00
|
|
|
QUANTIZATION_METHODS[quant_method].get_min_capability())
|