diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b5587825..53c99dc38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,7 +61,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install '.[train, onnx, openvino, dev]' + python -m pip install '.[train, onnx, openvino, ipex, dev]' - name: Install model2vec run: python -m pip install model2vec diff --git a/docs/installation.md b/docs/installation.md index 334b8cbd8..143ba17a7 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -4,6 +4,7 @@ We recommend **Python 3.9+**, **[PyTorch 1.11.0+](https://pytorch.org/get-starte * **Default:** This allows for loading, saving, and inference (i.e., getting embeddings) of models. * **ONNX:** This allows for loading, saving, inference, optimizing, and quantizing of models using the ONNX backend. * **OpenVINO:** This allows for loading, saving, and inference of models using the OpenVINO backend. +* **IPEX:** This allows for loading, saving, and inference of models using the IPEX backend. * **Default and Training**: Like **Default**, plus training. * **Development**: All of the above plus some dependencies for developing Sentence Transformers, see [Editable Install](#editable-install). @@ -37,6 +38,12 @@ Note that you can mix and match the various extras, e.g. ``pip install -U "sente pip install -U "sentence-transformers[openvino]" +.. tab:: IPEX + + :: + + pip install -U "sentence-transformers[ipex]" + .. tab:: Default and Training :: @@ -87,6 +94,12 @@ Note that you can mix and match the various extras, e.g. ``pip install -U "sente pip install -U "sentence-transformers[openvino]" +.. tab:: IPEX + + :: + + pip install -U "sentence-transformers[ipex]" + .. tab:: Default and Training :: @@ -139,6 +152,12 @@ You can install ``sentence-transformers`` directly from source to take advantage pip install -U "sentence-transformers[openvino] @ git+https://github.com/UKPLab/sentence-transformers.git" +.. tab:: IPEX + + :: + + pip install -U "sentence-transformers[ipex] @ git+https://github.com/UKPLab/sentence-transformers.git" + .. tab:: Default and Training :: diff --git a/pyproject.toml b/pyproject.toml index f6e2cf867..09d8eae88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ train = ["datasets", "accelerate>=0.20.3"] onnx = ["optimum[onnxruntime]>=1.23.1"] onnx-gpu = ["optimum[onnxruntime-gpu]>=1.23.1"] openvino = ["optimum-intel[openvino]>=1.20.0"] +ipex = ["optimum-intel[ipex]>=1.20.0"] dev = ["datasets", "accelerate>=0.20.3", "pre-commit", "pytest", "pytest-cov", "peft"] [build-system] diff --git a/tests/test_backends.py b/tests/test_backends.py index 887de96e1..5983807bb 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -15,6 +15,11 @@ except ImportError: pytest.skip("OpenVINO and ONNX backends are not available", allow_module_level=True) +try: + from optimum.intel import IPEXModel +except ImportError: + pytest.skip("IPEX backend is not available", allow_module_level=True) + from sentence_transformers import SentenceTransformer @@ -24,6 +29,7 @@ [ ("onnx", ORTModelForFeatureExtraction), ("openvino", OVModelForFeatureExtraction), + ("ipex", IPEXModel) ], ) @pytest.mark.parametrize(