Skip to content

Commit 1c84442

Browse files
authored
bump to 2.6 torch (#556)
* bump to 2.6 * update ci * add check for compile * new dockerfile * add comment * add comment
1 parent 5859c68 commit 1c84442

File tree

12 files changed

+375
-141
lines changed

12 files changed

+375
-141
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run:
2828
working-directory: ${{ inputs.working-directory }}
2929
strategy:
30-
# fail-fast: true
30+
fail-fast: false
3131
matrix:
3232
os: [ubuntu-latest, windows-latest] # macos-latest
3333
python-version:

libs/client_infinity/infinity_client/poetry.lock

Lines changed: 190 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/infinity_emb/Docker.template.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,42 @@
33
# 1. Guide: pip install jinja2 jinja2-cli
44
nvidia:
55
# 2 .command: jinja2 Dockerfile.jinja2 Docker.template.yaml --format=yaml -s nvidia > Dockerfile.nvidia_auto
6-
base_image: 'nvidia/cuda:12.1.1-base-ubuntu22.04'
7-
main_install: "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
6+
base_image: "nvidia/cuda:12.4.1-base-ubuntu22.04"
7+
main_install: 'RUN poetry install --no-interaction --no-ansi --no-root --extras "${EXTRAS}" --without lint,test && poetry cache clear pypi --all'
8+
python_version: python3.10
9+
extra_installs_main: |
10+
# nvcc is not installed -> the following might break if the torch version or python version changes.
11+
RUN poetry run $PYTHON -m pip install --no-cache-dir https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
812
cpu:
913
# 2. command: jinja2 Dockerfile.jinja2 Docker.template.yaml --format=yaml -s cpu > Dockerfile.cpu_auto
10-
base_image: 'ubuntu:22.04'
14+
base_image: "ubuntu:22.04"
1115
# pyproject_sed: |
12-
# RUN sed -i 's|torch = "2.4.1"|torch = "2.5.0"|' pyproject.toml
16+
# RUN sed -i 's|torch = "2.4.1"|torch = "2.5.0"|' pyproject.toml
1317
# RUN sed -i 's|"pypi"|"pytorch_cpu"|' pyproject.toml
1418
# RUN poetry lock --no-update
1519
poetry_extras: "all"
1620
main_install: |
1721
# "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
1822
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
1923
RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/cpu"
20-
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino
24+
RUN poetry run python -m pip install --no-cache-dir onnxruntime-openvino
2125
extra_env_variables: |
2226
# Sets default to onnx
2327
ENV INFINITY_ENGINE="optimum"
2428
2529
amd:
2630
# 2 . command: jinja2 Dockerfile.jinja2 Docker.template.yaml --format=yaml -s amd > Dockerfile.amd_auto
27-
base_image: 'rocm/pytorch:rocm6.2.3_ubuntu22.04_py3.10_pytorch_release_2.3.0'
31+
base_image: "rocm/pytorch:rocm6.2.3_ubuntu22.04_py3.10_pytorch_release_2.3.0"
2832
# pyproject_sed: |
29-
# RUN sed -i 's|"pypi"|"pytorch_rocm"|' pyproject.toml
30-
# RUN sed -i 's|torch = "2.4.1"|torch = "2.4.1"|' pyproject.toml
31-
# RUN sed -i 's|torchvision = {version = "\*"|torchvision = {version = "0.19.1"|' pyproject.toml
33+
# RUN sed -i 's|"pypi"|"pytorch_rocm"|' pyproject.toml
34+
# RUN sed -i 's|torch = "2.4.1"|torch = "2.4.1"|' pyproject.toml
35+
# RUN sed -i 's|torchvision = {version = "\*"|torchvision = {version = "0.19.1"|' pyproject.toml
3236
# RUN poetry lock --no-update
3337
main_install: |
3438
# "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
3539
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
3640
RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/rocm6.2"
37-
extra_installs_main: |
41+
extra_installs_main: |
3842
ARG GPU_ARCH
3943
ENV GPU_ARCH=${GPU_ARCH}
4044
# GPU architecture specific installations
@@ -77,9 +81,9 @@ amd:
7781
ENV INFINITY_BETTERTRANSFORMER="0"
7882
7983
trt:
80-
base_image: nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04
84+
base_image: nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
8185
poetry_extras: "all onnxruntime-gpu"
82-
extra_installs_main: |
86+
extra_installs_main: |
8387
# Install utils for tensorrt
8488
RUN apt-get install -y --no-install-recommends openmpi-bin libopenmpi-dev git git-lfs python3-pip
8589
RUN poetry run $PYTHON -m pip install --no-cache-dir flash-attn --no-build-isolation
@@ -89,4 +93,4 @@ trt:
8993
ENV LD_LIBRARY_PATH=/app/.venv/lib/${PYTHON}/site-packages/tensorrt:/usr/lib/x86_64-linux-gnu:/app/.venv/lib/${PYTHON}/site-packages/tensorrt_libs:${LD_LIBRARY_PATH}
9094
ENV PATH=/app/.venv/lib/${PYTHON}/site-packages/tensorrt/bin:${PATH}
9195
python_version: python3.10
92-
main_install: "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
96+
main_install: 'RUN poetry install --no-interaction --no-ansi --no-root --extras "${EXTRAS}" --without lint,test && poetry cache clear pypi --all'

libs/infinity_emb/Dockerfile.amd_auto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ ENV PYTHONUNBUFFERED=1 \
1818
HF_HUB_ENABLE_HF_TRANSFER=1 \
1919
# extras
2020
EXTRAS="all" \
21-
PYTHON="python3.10"
22-
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl
21+
PYTHON="python3"
22+
# "python3.10"
23+
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON-pip $PYTHON curl
2324
# RUN conda init --reverse --all
2425
# RUN rm -rf /opt/conda && rm -rf /var/lib/jenkins
2526
# Bettertransformer is not supported on AMD

libs/infinity_emb/Dockerfile.cpu_auto

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ ENV PYTHONUNBUFFERED=1 \
1818
HF_HUB_ENABLE_HF_TRANSFER=1 \
1919
# extras
2020
EXTRAS="all" \
21-
PYTHON="python3.11"
22-
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl
21+
PYTHON="python3"
22+
# "python3"
23+
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON-pip $PYTHON curl
2324
# Sets default to onnx
2425
ENV INFINITY_ENGINE="optimum"
2526

@@ -43,14 +44,14 @@ COPY poetry.lock poetry.toml pyproject.toml README.md /app/
4344
# "RUN poetry install --no-interaction --no-ansi --no-root --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
4445
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
4546
RUN ./requirements_install_from_poetry.sh --no-root --without lint,test "https://download.pytorch.org/whl/cpu"
46-
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino
47+
RUN poetry run python -m pip install --no-cache-dir onnxruntime-openvino
4748

4849
COPY infinity_emb infinity_emb
4950
# Install dependency with infinity_emb package
5051
# "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --without lint,test && poetry cache clear pypi --all"
5152
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
5253
RUN ./requirements_install_from_poetry.sh --without lint,test "https://download.pytorch.org/whl/cpu"
53-
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino
54+
RUN poetry run python -m pip install --no-cache-dir onnxruntime-openvino
5455

5556
#
5657
# TODO: remove this line
@@ -61,7 +62,7 @@ FROM builder AS testing
6162
# "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --with lint,test && poetry cache clear pypi --all"
6263
COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh
6364
RUN ./requirements_install_from_poetry.sh --with lint,test "https://download.pytorch.org/whl/cpu"
64-
RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino
65+
RUN poetry run python -m pip install --no-cache-dir onnxruntime-openvino
6566

6667
# lint
6768
RUN poetry run ruff check .

libs/infinity_emb/Dockerfile.jinja2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ ENV PYTHONUNBUFFERED=1 \
1818
HF_HUB_ENABLE_HF_TRANSFER=1 \
1919
# extras
2020
EXTRAS="{{poetry_extras | default('all')}}" \
21-
PYTHON="{{python_version | default('python3.11')}}"
22-
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl
21+
PYTHON="python3"
22+
# "{{python_version | default('python3')}}"
23+
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON-pip $PYTHON curl
2324
{{extra_env_variables | default('')}}
2425
WORKDIR /app
2526

libs/infinity_emb/Dockerfile.nvidia_auto

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is generated from Dockerfile.jinja2. Do not edit the Dockerfile.cuda|cpu|amd file directly.
33
# Only contribute to the Dockerfile.jinja2 and dockerfile_template.yaml and regenerate the Dockerfile.cuda|cpu|amd
44

5-
FROM nvidia/cuda:12.1.1-base-ubuntu22.04 AS base
5+
FROM nvidia/cuda:12.4.1-base-ubuntu22.04 AS base
66

77
ENV PYTHONUNBUFFERED=1 \
88
# pip
@@ -18,8 +18,9 @@ ENV PYTHONUNBUFFERED=1 \
1818
HF_HUB_ENABLE_HF_TRANSFER=1 \
1919
# extras
2020
EXTRAS="all" \
21-
PYTHON="python3.11"
22-
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl
21+
PYTHON="python3"
22+
# "python3.10"
23+
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON-pip $PYTHON curl
2324

2425
WORKDIR /app
2526

@@ -42,7 +43,9 @@ RUN poetry install --no-interaction --no-ansi --no-root --extras "${EXTRAS}" --w
4243
COPY infinity_emb infinity_emb
4344
# Install dependency with infinity_emb package
4445
RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --without lint,test && poetry cache clear pypi --all
45-
#
46+
# nvcc is not installed -> the following might break if the torch version or python version changes.
47+
RUN poetry run $PYTHON -m pip install --no-cache-dir https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
48+
4649
# TODO: remove this line
4750
RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@7547f55e5d93245c0a013b50df976924f2d9e8b0 && rm -rf ~/.cache/ /tmp/*
4851

libs/infinity_emb/Dockerfile.trt_onnx_auto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is generated from Dockerfile.jinja2. Do not edit the Dockerfile.cuda|cpu|amd file directly.
33
# Only contribute to the Dockerfile.jinja2 and dockerfile_template.yaml and regenerate the Dockerfile.cuda|cpu|amd
44

5-
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04 AS base
5+
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 AS base
66

77
ENV PYTHONUNBUFFERED=1 \
88
# pip
@@ -18,8 +18,9 @@ ENV PYTHONUNBUFFERED=1 \
1818
HF_HUB_ENABLE_HF_TRANSFER=1 \
1919
# extras
2020
EXTRAS="all onnxruntime-gpu" \
21-
PYTHON="python3.10"
22-
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON curl
21+
PYTHON="python3"
22+
# "python3.10"
23+
RUN apt-get update && apt-get install --no-install-recommends -y build-essential python3-dev libsndfile1 $PYTHON-venv $PYTHON-pip $PYTHON curl
2324
# Set default to tensorrt
2425
ENV LD_LIBRARY_PATH=/app/.venv/lib/${PYTHON}/site-packages/tensorrt:/usr/lib/x86_64-linux-gnu:/app/.venv/lib/${PYTHON}/site-packages/tensorrt_libs:${LD_LIBRARY_PATH}
2526
ENV PATH=/app/.venv/lib/${PYTHON}/site-packages/tensorrt/bin:${PATH}

0 commit comments

Comments
 (0)