diff --git a/libs/infinity_emb/Docker.template.yaml b/libs/infinity_emb/Docker.template.yaml index 9c19c40d..95757c7d 100644 --- a/libs/infinity_emb/Docker.template.yaml +++ b/libs/infinity_emb/Docker.template.yaml @@ -12,11 +12,12 @@ cpu: # RUN sed -i 's|torch = "2.4.1"|torch = "2.5.0"|' pyproject.toml # RUN sed -i 's|"pypi"|"pytorch_cpu"|' pyproject.toml # RUN poetry lock --no-update - poetry_extras: "all openvino" + poetry_extras: "all" main_install: | # "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all" COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/cpu" + RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino extra_env_variables: | # Sets default to onnx ENV INFINITY_ENGINE="optimum" diff --git a/libs/infinity_emb/Dockerfile.cpu_auto b/libs/infinity_emb/Dockerfile.cpu_auto index f63c4109..f35bcd1c 100644 --- a/libs/infinity_emb/Dockerfile.cpu_auto +++ b/libs/infinity_emb/Dockerfile.cpu_auto @@ -17,7 +17,7 @@ ENV PYTHONUNBUFFERED=1 \ POETRY_VIRTUALENVS_IN_PROJECT="true" \ # do not ask any interactive question POETRY_NO_INTERACTION=1 \ - EXTRAS="all openvino" \ + EXTRAS="all" \ PYTHON="python3.11" RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl # Sets default to onnx @@ -43,12 +43,14 @@ COPY poetry.lock poetry.toml pyproject.toml README.md /app/ # "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all" COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/cpu" +RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino COPY infinity_emb infinity_emb # Install dependency with infinity_emb package # "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all" COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh RUN ./requirements_install_from_poetry.sh --without lint,test "https://download.pytorch.org/whl/cpu" +RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino # @@ -58,6 +60,7 @@ FROM builder as testing # "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --with lint,test && poetry cache clear pypi --all" COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh RUN ./requirements_install_from_poetry.sh --with lint,test "https://download.pytorch.org/whl/cpu" +RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino # lint RUN poetry run ruff check . diff --git a/libs/infinity_emb/Makefile b/libs/infinity_emb/Makefile index a91c6be4..f1a0b6e7 100644 --- a/libs/infinity_emb/Makefile +++ b/libs/infinity_emb/Makefile @@ -54,6 +54,9 @@ build-amd: build-trt: docker buildx build -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push . +build-cpu: + docker buildx build -t michaelf34/infinity:$(VERSION)-cpu -f Dockerfile.cpu_auto --push . + # Combined target to build both build-all-docker: docker buildx build -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push . & \ diff --git a/libs/infinity_emb/poetry.lock b/libs/infinity_emb/poetry.lock index 333f017d..5364d966 100644 --- a/libs/infinity_emb/poetry.lock +++ b/libs/infinity_emb/poetry.lock @@ -2367,28 +2367,6 @@ packaging = "*" protobuf = "*" sympy = "*" -[[package]] -name = "onnxruntime-openvino" -version = "1.19.0" -description = "ONNX Runtime is a runtime accelerator for Machine Learning models" -optional = true -python-versions = "*" -files = [ - {file = "onnxruntime_openvino-1.19.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:8c5658da819b26d9f35f95204e1bdfb74a100a7533e74edab3af6316c1e316e8"}, - {file = "onnxruntime_openvino-1.19.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb8de2a60cf78db6e201b0a489479995d166938e9c53b01ff342dc7f5f8251ff"}, - {file = "onnxruntime_openvino-1.19.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:f3a0b954026286421b3a769c746c403e8f141f3887d1dd601beb7c4dbf77488a"}, - {file = "onnxruntime_openvino-1.19.0-cp311-cp311-win_amd64.whl", hash = "sha256:12330922ecdb694ea28dbdcf08c172e47a5a84fee603040691341336ee3e42bc"}, - {file = "onnxruntime_openvino-1.19.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:be00502b1a46ba1891cbe49049033745f71c0b99df6d24b979f5b4084b9567d0"}, -] - -[package.dependencies] -coloredlogs = "*" -flatbuffers = "*" -numpy = ">=1.21.6" -packaging = "*" -protobuf = "*" -sympy = "*" - [[package]] name = "openai" version = "1.52.0" @@ -2413,81 +2391,6 @@ typing-extensions = ">=4.11,<5" [package.extras] datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] -[[package]] -name = "openvino" -version = "2024.4.0" -description = "OpenVINO(TM) Runtime" -optional = true -python-versions = "*" -files = [ - {file = "openvino-2024.4.0-16579-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:8f19d4200ea04ab315a02f8279268851362f434beaa1a70b4f35d2eea1efa402"}, - {file = "openvino-2024.4.0-16579-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4a1da4c8db12559bf2760c8a7c8455e0b4373a20364eaee2c9832a6bb23c88a9"}, - {file = "openvino-2024.4.0-16579-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:98325dec5ca8bd79f19ea10fd45ad4631a33d9ab50e30659a91a6239ae02d8f4"}, - {file = "openvino-2024.4.0-16579-cp310-cp310-manylinux_2_31_aarch64.whl", hash = "sha256:61f68366017262603be0d876e2e9b7015789ee6b319da8f1792da28b733193f8"}, - {file = "openvino-2024.4.0-16579-cp310-cp310-win_amd64.whl", hash = "sha256:a5499d6daa91c358803441561b8792231dd964c5432e838df653c1e5df8de945"}, - {file = "openvino-2024.4.0-16579-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:e333a5f8155ae357f74e54b664d52d85fa4036a5ccea5da49a7df7f78826c1ce"}, - {file = "openvino-2024.4.0-16579-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b59fb073da74c7ab6d89f2559e3024044f340750b3e519e25975426beb154942"}, - {file = "openvino-2024.4.0-16579-cp311-cp311-manylinux2014_x86_64.whl", hash = "sha256:4bd3e21a70eff12166bae3b5ea824787b8c766f975f39e3f2d93729b47b74cb6"}, - {file = "openvino-2024.4.0-16579-cp311-cp311-manylinux_2_31_aarch64.whl", hash = "sha256:49b578c4d7325e4a519eb66ee5655871a2b7cd5be9d2de0d5109df23301d10a9"}, - {file = "openvino-2024.4.0-16579-cp311-cp311-win_amd64.whl", hash = "sha256:ab42204c185a4f0df5600a0adb4a4a0c97cebdf630696f94f9d06732714385bc"}, - {file = "openvino-2024.4.0-16579-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:d67d30f830fa3147eb37f31f53c9eaee424a4e93f33eed00d8288f304ef0250a"}, - {file = "openvino-2024.4.0-16579-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:50e05d59a90f7950c205d95bb1559e9a8a7d655fe843449d3d426c579fe665f1"}, - {file = "openvino-2024.4.0-16579-cp312-cp312-manylinux2014_x86_64.whl", hash = "sha256:d4cf229fb240b8af44d14686b5bdd94f9eabc70120b9808fc804252fac9ef615"}, - {file = "openvino-2024.4.0-16579-cp312-cp312-manylinux_2_31_aarch64.whl", hash = "sha256:5c8ceeb537019280f69dbe86049c3136e648e94fa9f3da9ef0433975e479ad09"}, - {file = "openvino-2024.4.0-16579-cp312-cp312-win_amd64.whl", hash = "sha256:83af7df6f9b7e2a96dfc5d63a774e6ca3f87d64c7372d14f7ae339387474fc5c"}, - {file = "openvino-2024.4.0-16579-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:b23fd5114bf42f04773f293b16965a541d58e46e6847053f1417cd6e47acddf5"}, - {file = "openvino-2024.4.0-16579-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:fa6e9fffd31c095e052f6cecb9ac3ff95e0c122418b81b9926b7687465475742"}, - {file = "openvino-2024.4.0-16579-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:24b28379bd8d43963829b0b4df957d659269fa647f4f842bd0b3d2f8db76782b"}, - {file = "openvino-2024.4.0-16579-cp38-cp38-manylinux_2_31_aarch64.whl", hash = "sha256:4ed049ab7a2ffb624690e6cf38366383630cd58736320953cc62c78e8b31eae5"}, - {file = "openvino-2024.4.0-16579-cp38-cp38-win_amd64.whl", hash = "sha256:0cccaa53a61629b44408fe0c7537db637be913697b0f3c54c78756e95dfc4498"}, - {file = "openvino-2024.4.0-16579-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:3b0834492ff5bc129debb506a705d26b640bca99a10e641af8f710bd081c9af0"}, - {file = "openvino-2024.4.0-16579-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0e01c22a9989470ebcbb7b05fd07e4297bf6c5ecdca202b05f5dc9d2b3186f39"}, - {file = "openvino-2024.4.0-16579-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:fb4781dd9691dc4cfbc6b69f56f724286699e309d4ddc7894fed3ee77b683e2f"}, - {file = "openvino-2024.4.0-16579-cp39-cp39-manylinux_2_31_aarch64.whl", hash = "sha256:74094f8ad81c2ae8500d3361ac087455316a6583016f693d7e1dd1500217ceec"}, - {file = "openvino-2024.4.0-16579-cp39-cp39-win_amd64.whl", hash = "sha256:be834d95405fe3724f104b54f3836e7053646d952c4f8a5dad2267665f55d88f"}, -] - -[package.dependencies] -numpy = ">=1.16.6,<2.1.0" -openvino-telemetry = ">=2023.2.1" -packaging = "*" - -[[package]] -name = "openvino-telemetry" -version = "2024.1.0" -description = "OpenVINO™ Telemetry package for sending statistics with user's consent, used in combination with other OpenVINO™ packages." -optional = true -python-versions = "*" -files = [ - {file = "openvino-telemetry-2024.1.0.tar.gz", hash = "sha256:6df9a8f499e75d893d0bece3c272e798109f0bd40d1eb2488adca6a0da1d9b9f"}, - {file = "openvino_telemetry-2024.1.0-py3-none-any.whl", hash = "sha256:73ec3402a1bfb9050ee8885c7618dcb91456d6489dfa84cda7eed6cfa16a6c88"}, -] - -[[package]] -name = "openvino-tokenizers" -version = "2024.4.0.0" -description = "Convert tokenizers into OpenVINO models" -optional = true -python-versions = ">=3.8" -files = [ - {file = "openvino_tokenizers-2024.4.0.0-py3-none-macosx_10_15_x86_64.whl", hash = "sha256:0b9fe78b01e796e9124a04d21cf3074c98cf1a719136f7b14fbab933ac5b85dd"}, - {file = "openvino_tokenizers-2024.4.0.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a9649be7949be9c72fea02577ea61f320173f43d6ba47d735d1dc9c1901e97c8"}, - {file = "openvino_tokenizers-2024.4.0.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:0ec426329d951c2e13c843da42a0d01926b2f40f7f2844e51207dbb5073f1662"}, - {file = "openvino_tokenizers-2024.4.0.0-py3-none-manylinux_2_31_aarch64.whl", hash = "sha256:e43c9ef643ebccf713d551186efb68edc394834a19f894822e0366413079bfc2"}, - {file = "openvino_tokenizers-2024.4.0.0-py3-none-win_amd64.whl", hash = "sha256:ee9f99f6e230a364f0708d0625273295e4f60dee54d915f8dc6d015bc0921015"}, -] - -[package.dependencies] -openvino = "==2024.4.*" - -[package.extras] -all = ["openvino_tokenizers[dev,transformers]"] -benchmark = ["openvino_tokenizers[transformers]", "pandas", "seaborn", "tqdm"] -dev = ["bandit", "openvino_tokenizers[torch,transformers]", "pandas", "pytest", "pytest_harvest", "ruff"] -fuzzing = ["atheris", "openvino_tokenizers[transformers]"] -torch = ["torch"] -transformers = ["tiktoken", "transformers[sentencepiece] (>=4.36.0)"] - [[package]] name = "optimum" version = "1.23.3" @@ -3837,6 +3740,11 @@ files = [ {file = "scikit_learn-1.5.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f60021ec1574e56632be2a36b946f8143bf4e5e6af4a06d85281adc22938e0dd"}, {file = "scikit_learn-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:394397841449853c2290a32050382edaec3da89e35b3e03d6cc966aebc6a8ae6"}, {file = "scikit_learn-1.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:57cc1786cfd6bd118220a92ede80270132aa353647684efa385a74244a41e3b1"}, + {file = "scikit_learn-1.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9a702e2de732bbb20d3bad29ebd77fc05a6b427dc49964300340e4c9328b3f5"}, + {file = "scikit_learn-1.5.2-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:b0768ad641981f5d3a198430a1d31c3e044ed2e8a6f22166b4d546a5116d7908"}, + {file = "scikit_learn-1.5.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:178ddd0a5cb0044464fc1bfc4cca5b1833bfc7bb022d70b05db8530da4bb3dd3"}, + {file = "scikit_learn-1.5.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7284ade780084d94505632241bf78c44ab3b6f1e8ccab3d2af58e0e950f9c12"}, + {file = "scikit_learn-1.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:b7b0f9a0b1040830d38c39b91b3a44e1b643f4b36e36567b80b7c6bd2202a27f"}, {file = "scikit_learn-1.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:757c7d514ddb00ae249832fe87100d9c73c6ea91423802872d9e74970a0e40b9"}, {file = "scikit_learn-1.5.2-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:52788f48b5d8bca5c0736c175fa6bdaab2ef00a8f536cda698db61bd89c551c1"}, {file = "scikit_learn-1.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:643964678f4b5fbdc95cbf8aec638acc7aa70f5f79ee2cdad1eec3df4ba6ead8"}, @@ -5290,7 +5198,6 @@ ct2 = ["ctranslate2", "sentence-transformers", "torch", "transformers"] einops = ["einops"] logging = ["rich"] onnxruntime-gpu = ["onnxruntime-gpu"] -openvino = ["onnxruntime-openvino", "openvino", "openvino-tokenizers"] optimum = ["optimum"] server = ["fastapi", "orjson", "posthog", "prometheus-fastapi-instrumentator", "pydantic", "rich", "typer", "uvicorn"] tensorrt = ["tensorrt"] @@ -5300,4 +5207,4 @@ vision = ["colpali-engine", "pillow", "timm", "torchvision"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4" -content-hash = "23feae6cd9a95ff4a6ed50da692d28ba9b514d3067adc9bcc8e4860a70a13942" +content-hash = "7d3ee9f0dbde4965c672639f86264c05689b8753c266e23400e5fd72b78dfed2" diff --git a/libs/infinity_emb/pyproject.toml b/libs/infinity_emb/pyproject.toml index 0d7c8ade..a140ffad 100644 --- a/libs/infinity_emb/pyproject.toml +++ b/libs/infinity_emb/pyproject.toml @@ -41,9 +41,9 @@ timm = {version = "*", optional=true} colpali-engine = {version="^0.3.1", optional=true} # openvino # optimum-intel = {version=">=1.20.0", optional=true, extras=["openvino"]} -onnxruntime-openvino = {version=">=1.19.0", optional=true} -openvino = {version="2024.4.0", optional=true} -openvino-tokenizers = {version="2024.4.0.0", optional=true} +# onnxruntime-openvino = {version=">=1.19.0", optional=true} +# openvino = {version="2024.4.0", optional=true} +# openvino-tokenizers = {version="2024.4.0.0", optional=true} # pin torchvision to a specific source, but default to pypi. use sed to overwrite. @@ -106,7 +106,7 @@ einops=["einops"] logging=["rich"] cache=["diskcache"] vision=["colpali-engine","pillow","timm","torchvision"] -openvino=["onnxruntime-openvino","openvino","openvino-tokenizers"] +# openvino=["onnxruntime-openvino","openvino","openvino-tokenizers"] audio=["soundfile"] server=[ "fastapi",