utils.py 513 B

123456789101112131415
  1. import torch
  2. from aphrodite.platforms import current_platform
  3. from aphrodite.quantization import QUANTIZATION_METHODS
  4. def is_quant_method_supported(quant_method: str) -> bool:
  5. # Currently, all quantization methods require Nvidia or AMD GPUs
  6. if not torch.cuda.is_available():
  7. return False
  8. capability = current_platform.get_device_capability()
  9. capability = capability[0] * 10 + capability[1]
  10. return (capability >=
  11. QUANTIZATION_METHODS[quant_method].get_min_capability())