__init__.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. from typing import Type
  2. from aphrodite.quantization.aqlm import AQLMConfig
  3. from aphrodite.quantization.awq import AWQConfig
  4. from aphrodite.quantization.awq_marlin import AWQMarlinConfig
  5. from aphrodite.quantization.base_config import QuantizationConfig
  6. from aphrodite.quantization.bitsandbytes import BitsAndBytesConfig
  7. from aphrodite.quantization.compressed_tensors.compressed_tensors import (
  8. CompressedTensorsConfig)
  9. from aphrodite.quantization.deepspeedfp import DeepSpeedFPConfig
  10. from aphrodite.quantization.eetq import EETQConfig
  11. from aphrodite.quantization.fbgemm_fp8 import FBGEMMFp8Config
  12. from aphrodite.quantization.fp8 import Fp8Config
  13. from aphrodite.quantization.gguf import GGUFConfig
  14. from aphrodite.quantization.gptq import GPTQConfig
  15. from aphrodite.quantization.gptq_marlin import GPTQMarlinConfig
  16. from aphrodite.quantization.gptq_marlin_24 import GPTQMarlin24Config
  17. from aphrodite.quantization.marlin import MarlinConfig
  18. from aphrodite.quantization.qqq import QQQConfig
  19. from aphrodite.quantization.quip import QuipConfig
  20. from aphrodite.quantization.squeezellm import SqueezeLLMConfig
  21. from aphrodite.quantization.tpu_int8 import Int8TpuConfig
  22. QUANTIZATION_METHODS = {
  23. "aqlm": AQLMConfig,
  24. "awq": AWQConfig,
  25. "deepspeedfp": DeepSpeedFPConfig,
  26. "tpu_int8": Int8TpuConfig,
  27. "eetq": EETQConfig,
  28. "fp8": Fp8Config,
  29. "fbgemm_fp8": FBGEMMFp8Config,
  30. "gguf": GGUFConfig,
  31. # The order of gptq methods is important for config.py iteration over
  32. # override_quantization_method(..)
  33. "marlin": MarlinConfig,
  34. "gptq_marlin_24": GPTQMarlin24Config,
  35. "gptq_marlin": GPTQMarlinConfig,
  36. "awq_marlin": AWQMarlinConfig,
  37. "gptq": GPTQConfig,
  38. "quip": QuipConfig,
  39. "squeezellm": SqueezeLLMConfig,
  40. "compressed-tensors": CompressedTensorsConfig,
  41. "bitsandbytes": BitsAndBytesConfig,
  42. "qqq": QQQConfig,
  43. }
  44. def get_quantization_config(quantization: str) -> Type[QuantizationConfig]:
  45. if quantization not in QUANTIZATION_METHODS:
  46. raise ValueError(f"Invalid quantization method: {quantization}")
  47. return QUANTIZATION_METHODS[quantization]
  48. __all__ = [
  49. "QuantizationConfig",
  50. "get_quantization_config",
  51. "QUANTIZATION_METHODS",
  52. ]