Skip to content

Commit 7b4e50f

Browse files
authored
Limit ITREX version for WOQ (#729)
* remove latest ITREX release compatibility * update workflow
1 parent e22b2fd commit 7b4e50f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/test_inc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
pip install py-cpuinfo
3535
pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cpu
3636
pip install .[neural-compressor,diffusers,tests]
37-
pip install intel-extension-for-transformers
37+
pip install intel-extension-for-transformers==1.4.1
3838
pip install peft
3939
4040
- name: Test with Pytest

optimum/intel/neural_compressor/quantization.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@
7979
)
8080

8181

82+
_ITREX_EXCLUDED_VERSION = "1.4.2"
83+
8284
if is_itrex_available():
8385
if is_itrex_version("<", ITREX_MINIMUM_VERSION):
8486
raise ImportError(
8587
f"Found an incompatible version of `intel-extension-for-transformers`. Found version {_itrex_version}, "
8688
f"but only version {ITREX_MINIMUM_VERSION} or higher is supported."
8789
)
90+
8891
from intel_extension_for_transformers.transformers.llm.quantization.utils import convert_to_quantized_model
8992
from intel_extension_for_transformers.transformers.modeling.modeling_auto import save_low_bit
9093
from intel_extension_for_transformers.transformers.utils.config import (
@@ -226,6 +229,12 @@ def quantize(
226229

227230
# ITREX Weight Only Quantization
228231
if not isinstance(quantization_config, PostTrainingQuantConfig):
232+
if is_itrex_version("==", _ITREX_EXCLUDED_VERSION):
233+
raise ImportError(
234+
f"Found an incompatible version of `intel-extension-for-transformers`. Found version {_itrex_version}, "
235+
f"but {_ITREX_EXCLUDED_VERSION} is not compatible."
236+
)
237+
229238
# check neural-compressor version
230239
if is_neural_compressor_version("<", NEURAL_COMPRESSOR_WEIGHT_ONLY_MINIMUM_VERSION):
231240
raise ImportError(

0 commit comments

Comments
 (0)