Skip to content

Commit 4e50b84

Browse files
authored
upgrade xpu docker file to torch 2.8 (#41551)
* upgrade xpu docker file to torch 2.8 Signed-off-by: Yao, Matrix <[email protected]> * Update Dockerfile --------- Signed-off-by: Yao, Matrix <[email protected]>
1 parent 9aab965 commit 4e50b84

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

docker/transformers-pytorch-xpu/Dockerfile

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ LABEL maintainer="Hugging Face"
33

44
SHELL ["/bin/bash", "-c"]
55

6-
ARG PYTHON_VER=3.11
6+
ARG PYTHON_VER=3.12
77
ENV TORCH_DEVICE_BACKEND_AUTOLOAD=0
88
ENV DEBIAN_FRONTEND=noninteractive
99

10-
RUN apt-get remove -y python3.10 && apt-get autoremove -y
1110
RUN apt-get update && \
1211
apt-get install -y software-properties-common && \
1312
add-apt-repository -y ppa:deadsnakes/ppa && \
@@ -23,7 +22,6 @@ RUN apt-get update && \
2322
apt-utils \
2423
build-essential \
2524
ca-certificates \
26-
clinfo \
2725
curl \
2826
git \
2927
git-lfs \
@@ -35,7 +33,6 @@ RUN apt-get update && \
3533
rsync \
3634
sudo \
3735
libnl-genl-3-200 \
38-
xpu-smi \
3936
unzip \
4037
ffmpeg \
4138
tesseract-ocr \
@@ -45,34 +42,47 @@ RUN apt-get update && \
4542
apt-get clean && \
4643
rm -rf /var/lib/apt/lists/*
4744

48-
4945
RUN apt-get update && \
5046
apt-get install -y \
51-
linux-headers-$(uname -r) \
52-
linux-modules-extra-$(uname -r) \
47+
linux-headers-$(uname -r) linux-modules-extra-$(uname -r) \
5348
flex bison \
54-
intel-fw-gpu intel-i915-dkms xpu-smi \
49+
intel-fw-gpu intel-i915-dkms xpu-smi intel-ocloc clinfo\
5550
intel-opencl-icd libze-intel-gpu1 libze1 \
5651
intel-media-va-driver-non-free libmfx-gen1 libvpl2 \
57-
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
52+
libegl-mesa0 libegl1 libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
5853
libglapi-mesa libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
59-
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo intel-ocloc \
54+
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo \
6055
libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev libze-dev && \
6156
apt-get clean && \
6257
rm -rf /var/lib/apt/lists/*
6358

64-
RUN pip install --upgrade pip
65-
RUN pip install triton==3.3.0
59+
# Use virtual env because Ubuntu-24 does not allowed pip on original python
60+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
61+
ENV PATH="/root/.local/bin:$PATH"
62+
ENV VIRTUAL_ENV="/opt/venv"
63+
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
64+
RUN uv venv --python ${PYTHON_VER} --seed ${VIRTUAL_ENV}
65+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
66+
67+
RUN pip install --upgrade pip wheel
68+
RUN pip install triton==3.4.0
6669

67-
RUN pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/xpu --no-cache-dir
70+
RUN pip install torch==2.8.0+xpu torchvision==0.23.0+xpu torchaudio==2.8.0+xpu --index-url https://download.pytorch.org/whl/xpu --no-cache-dir
6871

69-
RUN pip install evaluate torchdata pyctcdecode pytesseract decord galore-torch fire scipy scikit-learn sentencepiece sacremoses nltk rouge_score librosa soundfile g2p_en mpi4py requests_mock
70-
RUN pip install pretty_midi essentia resampy Levenshtein av sacrebleu phonemizer invisible_watermark schedulefree
71-
RUN pip install gguf hqq compressed_tensors gptqmodel mergekit autoawq deepspeed torchao onnx
72-
RUN pip install hf_transfer huggingface-hub hf-doc-builder datasets optimum-quanto timm transformers accelerate optimum peft
72+
RUN pip install torchcodec torchdata --no-cache-dir
7373

74+
RUN pip install evaluate pyctcdecode pytesseract decord galore-torch fire scipy scikit-learn sentencepiece sacremoses nltk rouge_score librosa soundfile g2p_en mpi4py requests_mock
75+
RUN pip install pretty_midi essentia resampy Levenshtein av sacrebleu phonemizer invisible_watermark schedulefree setuptools
76+
RUN pip install gptqmodel --no-build-isolation
77+
RUN pip install gguf hqq compressed_tensors autoawq deepspeed torchao onnx auto_round
78+
RUN pip install hf_transfer huggingface-hub hf-doc-builder datasets optimum-quanto timm transformers accelerate optimum peft diffusers trl kernels
79+
80+
# install liger-kernel
7481
RUN pip install git+https://github.com/linkedin/Liger-Kernel.git --extra-index-url https://download.pytorch.org/whl/test/xpu
7582

83+
# install mergekit
84+
RUN pip install --break-system-packages git+https://github.com/arcee-ai/[email protected]
85+
7686
# install bitsandbytes
7787
RUN pip install git+https://github.com/bitsandbytes-foundation/bitsandbytes.git
7888

0 commit comments

Comments
 (0)