Skip to content

Commit 08b7293

Browse files
authored
Remove deprecated IPEX pipelines (#2429)
Remove deprecated IPEX
1 parent 153ba0d commit 08b7293

2 files changed

Lines changed: 11 additions & 18 deletions

File tree

docs/source/_redirects.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ intel/openvino/models: /docs/optimum-intel/openvino/models
6666
intel/openvino/reference: /docs/optimum-intel/openvino/reference
6767
intel/openvino/tutorials/notebooks: /docs/optimum-intel/openvino/tutorials/notebooks
6868
intel/openvino/tutorials/diffusers: /docs/optimum-intel/openvino/tutorials/diffusers
69-
intel/ipex/inference: /docs/optimum-intel/ipex/inference
70-
intel/ipex/models: /docs/optimum-intel/ipex/models
71-
intel/ipex/tutorials/notebooks: /docs/optimum-intel/ipex/tutorials/notebooks
7269

7370
# Optimum Neuron
7471
docs/optimum-neuron/index: /docs/optimum-neuron/index

optimum/pipelines/__init__.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import torch
2020

2121
from optimum.utils.import_utils import (
22-
is_ipex_available,
2322
is_onnxruntime_available,
2423
is_openvino_available,
2524
is_optimum_intel_available,
@@ -190,8 +189,8 @@ def pipeline(
190189
Can be used to force using a custom pipeline class. If not provided, the default pipeline class for the
191190
specified task will be used.
192191
accelerator (`str`, *optional*):
193-
The accelerator to use, either `"ort"` for ONNX Runtime, `"ov"` for OpenVINO, or `"ipex"` for Intel
194-
Extension for PyTorch. If no accelerator is specified, will default to the one currently installed/available.
192+
The accelerator to use, either `"ort"` for ONNX Runtime or `"ov"` for OpenVINO.
193+
If no accelerator is specified, will default to the one currently installed/available.
195194
kwargs (`dict[str, Any]`, *optional*):
196195
Additional keyword arguments passed along to the specific pipeline init (see the documentation for the
197196
corresponding pipeline class for possible values).
@@ -202,9 +201,9 @@ def pipeline(
202201
>>> from optimum.pipelines import pipeline
203202
>>> # Sentiment analysis pipeline with default model, using OpenVINO
204203
>>> analyzer = pipeline("sentiment-analysis", accelerator="ov")
205-
>>> # Question answering pipeline, specifying the checkpoint identifier, with IPEX
204+
>>> # Question answering pipeline, specifying the checkpoint identifier, with OpenVINO
206205
>>> oracle = pipeline(
207-
... "question-answering", model="distilbert/distilbert-base-cased-distilled-squad", tokenizer="google-bert/bert-base-cased", accelerator="ipex"
206+
... "question-answering", model="distilbert/distilbert-base-cased-distilled-squad", tokenizer="google-bert/bert-base-cased", accelerator="ov"
208207
... )
209208
>>> # Named entity recognition pipeline, passing in a specific model and tokenizer, with ONNX Runtime
210209
>>> model = ORTModelForTokenClassification.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")
@@ -225,18 +224,11 @@ def pipeline(
225224
"`accelerator` not specified. Using ONNX Runtime (`ort`) as the accelerator since `optimum-onnx[onnxruntime]` is installed."
226225
)
227226
accelerator = "ort"
228-
elif is_optimum_intel_available() and is_ipex_available():
229-
logger.info(
230-
"`accelerator` not specified. Using IPEX (`ipex`) as the accelerator since `optimum-intel[ipex]` is installed."
231-
)
232-
accelerator = "ipex"
233227
else:
234228
raise ImportError(
235229
"You need to install either `optimum-onnx[onnxruntime]` to use ONNX Runtime as an accelerator, "
236-
"or `optimum-intel[openvino]` to use OpenVINO as an accelerator, "
237-
"or `optimum-intel[ipex]` to use IPEX as an accelerator."
230+
"or `optimum-intel[openvino]` to use OpenVINO as an accelerator."
238231
)
239-
240232
if accelerator == "ort":
241233
from optimum.onnxruntime import pipeline as ort_pipeline # type: ignore
242234

@@ -260,7 +252,7 @@ def pipeline(
260252
pipeline_class=pipeline_class,
261253
**kwargs,
262254
)
263-
elif accelerator in ["ov", "ipex"]:
255+
elif accelerator == "ov":
264256
from optimum.intel import pipeline as intel_pipeline # type: ignore
265257

266258
return intel_pipeline(
@@ -284,5 +276,9 @@ def pipeline(
284276
accelerator=accelerator,
285277
**kwargs,
286278
)
279+
elif accelerator == "ipex":
280+
raise ValueError(
281+
"The `ipex` accelerator is deprecated and no longer supported. Please use `ov` (OpenVINO) instead."
282+
)
287283
else:
288-
raise ValueError(f"Accelerator {accelerator} not recognized. Please use 'ort', 'ov' or 'ipex'.")
284+
raise ValueError(f"Accelerator {accelerator} not recognized. Please use 'ort' or 'ov'.")

0 commit comments

Comments
 (0)