fix: replace deprecated openvino-dev with openvino>=2023.3.0 for Python 3.12+ compat#3678
Open
Aiudadadadf wants to merge 2 commits intoggml-org:masterfrom
Open
fix: replace deprecated openvino-dev with openvino>=2023.3.0 for Python 3.12+ compat#3678Aiudadadadf wants to merge 2 commits intoggml-org:masterfrom
Aiudadadadf wants to merge 2 commits intoggml-org:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pip install step for OpenVINO support has been broken on Python 3.12 and later because
openvino-dev[pytorch,onnx]- as shipped in the requirements file - resolves to versions that constrain numpy to<1.26.0. Building numpy 1.25.x fails on Python 3.12+ becausepkgutil.ImpImporterwas removed in that release and older numpy relied on it, producing theAttributeError: module 'pkgutil' has no attribute 'ImpImporter'error seen in the issue.The right fix is to stop depending on
openvino-deventirely. Intel deprecated that package with the 2023.x cycle and will discontinue it with the 2025.0 release - their own release notes describeopenvino-devas a legacy compatibility shim and recommend migrating to the baseopenvinopackage. Starting from OpenVINO 2023.x, model conversion tools and all supported frontends (including ONNX and PyTorch) are bundled in the baseopenvinopackage. Pinning toopenvino>=2023.3.0allows any numpy >= 1.16.6 with no upper-bound conflict, which means Python 3.12 and 3.13 can satisfy the constraint from their package repositories without building numpy from source.The
[pytorch,onnx]extras that were passed toopenvino-devare not needed with the baseopenvinopackage - those extras existed only to pull in optional model-conversion dependencies that are now built-in.While looking at
convert-whisper-to-openvino.py, there is also a stalefrom openvino.tools import moimport. Themoname is never referenced anywhere in the script - the encoder conversion usesFrontEndManagerandserializedirectly. Leaving that import would cause anImportErrorwithopenvino>=2023.xbecauseopenvino.tools.molives inopenvino-dev, not in the base package. Removing the unused import is the correct fix; nothing in the script needsmo.Tested with:
On Python 3.12 this previously failed at the
pip installstage. Withopenvino>=2023.3.0the install completes and the runtime imports resolve correctly.Fixes #3669