Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: yan ma <[email protected]>
  • Loading branch information
yma11 committed Nov 15, 2024
1 parent 855b506 commit 0c2ece4
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions vllm/model_executor/layers/quantization/ipex_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from vllm.model_executor.layers.quantization.gptq import GPTQLinearMethod
from vllm.platforms import current_platform

MIN_IPEX_VERSION = "2.5.0"


class IPEXConfig(QuantizationConfig):
"""INT8 quantization config class using IPEX for the CPU/XPU backend,
Expand Down Expand Up @@ -128,15 +130,16 @@ def process_weights_after_loading(self, layer: torch.nn.Module) -> None:

try:
import intel_extension_for_pytorch as ipex
if ipex.__version__ < "2.5.0":
raise ImportError("intel_extension_for_pytorch version is "
"wrong. Please install "
"intel_extension_for_pytorch>=2.5.0.")
if ipex.__version__ < MIN_IPEX_VERSION:
raise ImportError(
"intel_extension_for_pytorch version is "
"wrong. Please install "
f"intel_extension_for_pytorch>={MIN_IPEX_VERSION}.")
except ImportError as err:
raise ImportError(
"Please install "
"intel_extension_for_pytorch>=2.5.0 via "
"`pip install intel_extension_for_pytorch>=2.5.0`"
f"intel_extension_for_pytorch>={MIN_IPEX_VERSION} via "
f"`pip install intel_extension_for_pytorch>={MIN_IPEX_VERSION}`"
" to use IPEX-AWQ linear method.") from err
# Using the compute dtype (lowp_mode) as INT8 to leverage instructions
# with better performance.
Expand Down Expand Up @@ -193,15 +196,16 @@ def process_weights_after_loading(self, layer: torch.nn.Module) -> None:

try:
import intel_extension_for_pytorch as ipex
if ipex.__version__ < "2.5.0":
raise ImportError("intel_extension_for_pytorch version is "
"wrong. Please install "
"intel_extension_for_pytorch>=2.5.0.")
if ipex.__version__ < MIN_IPEX_VERSION:
raise ImportError(
"intel_extension_for_pytorch version is "
"wrong. Please install "
f"intel_extension_for_pytorch>={MIN_IPEX_VERSION}.")
except ImportError as err:
raise ImportError(
"Please install "
"intel_extension_for_pytorch>=2.5.0 via "
"`pip install intel_extension_for_pytorch>=2.5.0`"
f"intel_extension_for_pytorch>={MIN_IPEX_VERSION} via "
f"`pip install intel_extension_for_pytorch>={MIN_IPEX_VERSION}`"
" to use IPEX-AWQ linear method.") from err

# Using the compute dtype (lowp_mode) as INT8 to leverage instructions
Expand Down

0 comments on commit 0c2ece4

Please sign in to comment.