Use stable torch 2.6 xpu package

This commit is contained in:
James Ketr 2025-03-06 17:33:06 -08:00
parent 7a9253d64b
commit 872e74efbb

View File

@ -136,7 +136,7 @@ RUN python3 -m venv --system-site-packages /opt/pytorch/venv
SHELL [ "/opt/pytorch/shell" ] SHELL [ "/opt/pytorch/shell" ]
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/xpu RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu
RUN pip3 freeze > /opt/pytorch/requirements.txt RUN pip3 freeze > /opt/pytorch/requirements.txt
SHELL [ "/bin/bash", "-c" ] SHELL [ "/bin/bash", "-c" ]
@ -180,9 +180,7 @@ RUN { \
SHELL [ "/opt/ipex-llm/shell" ] SHELL [ "/opt/ipex-llm/shell" ]
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/xpu RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu
#COPY --from=ipex-2.6.10 /opt/ipex-2.6.10/dist/intel_extension_for_pytorch-2.6.10*.whl /opt/wheels/
#RUN for pkg in /opt/wheels/intel_extension_for_pytorch-2.6.10*.whl; do pip install $pkg[xpu-2-6]; done
WORKDIR /opt/ipex-llm/python/llm WORKDIR /opt/ipex-llm/python/llm
RUN pip install requests wheel RUN pip install requests wheel
@ -215,7 +213,7 @@ RUN { \
echo ' fi' ; \ echo ' fi' ; \
echo 'fi' ; \ echo 'fi' ; \
echo 'update-alternatives --set python3 /opt/python/bin/python3.11' ; \ echo 'update-alternatives --set python3 /opt/python/bin/python3.11' ; \
echo 'source /opt/intel/oneapi/setvars.sh' ; \ echo 'if [[ -e /opt/intel/oneapi/setvars.sh ]]; then source /opt/intel/oneapi/setvars.sh; fi' ; \
echo 'source /opt/airc/venv/bin/activate' ; \ echo 'source /opt/airc/venv/bin/activate' ; \
echo 'if [[ "${1}" == "shell" ]]; then echo "Dropping to shell"; /bin/bash; exit $?; fi' ; \ echo 'if [[ "${1}" == "shell" ]]; then echo "Dropping to shell"; /bin/bash; exit $?; fi' ; \
echo 'while true; do' ; \ echo 'while true; do' ; \
@ -259,7 +257,7 @@ RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRO
RUN { \ RUN { \
echo '#!/bin/bash' ; \ echo '#!/bin/bash' ; \
echo 'update-alternatives --set python3 /opt/python/bin/python3.11' ; \ echo 'update-alternatives --set python3 /opt/python/bin/python3.11' ; \
echo 'source /opt/intel/oneapi/setvars.sh' ; \ echo 'if [[ -e /opt/intel/oneapi/setvars.sh ]]; then source /opt/intel/oneapi/setvars.sh; fi' ; \
echo 'source /opt/airc/venv/bin/activate' ; \ echo 'source /opt/airc/venv/bin/activate' ; \
echo 'if [[ "$1" == "" ]]; then bash -c; else bash -c "${@}"; fi' ; \ echo 'if [[ "$1" == "" ]]; then bash -c; else bash -c "${@}"; fi' ; \
} > /opt/airc/shell ; \ } > /opt/airc/shell ; \
@ -267,7 +265,7 @@ RUN { \
SHELL [ "/opt/airc/shell" ] SHELL [ "/opt/airc/shell" ]
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/xpu RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu
# Install ipex-llm built in ipex-llm-src # Install ipex-llm built in ipex-llm-src
COPY --from=ipex-llm-src /opt/ipex-llm/python/llm/dist/*.whl /opt/wheels/ COPY --from=ipex-llm-src /opt/ipex-llm/python/llm/dist/*.whl /opt/wheels/
RUN for pkg in /opt/wheels/ipex_llm*.whl; do pip install $pkg; done RUN for pkg in /opt/wheels/ipex_llm*.whl; do pip install $pkg; done
@ -284,8 +282,6 @@ RUN pip3 install pydle transformers sentencepiece accelerate \
# as well as MistralSpda* things missing # as well as MistralSpda* things missing
RUN pip install "sentence_transformers<3.4.1" "transformers==4.40.0" RUN pip install "sentence_transformers<3.4.1" "transformers==4.40.0"
RUN pip3 install pydle transformers sentencepiece accelerate
# To get xe_linear and other Xe methods # To get xe_linear and other Xe methods
RUN pip3 install 'bigdl-core-xe-all>=2.6.0b' RUN pip3 install 'bigdl-core-xe-all>=2.6.0b'
@ -311,7 +307,7 @@ RUN { \
echo 'fi' ; \ echo 'fi' ; \
echo 'echo "Container: airc"' ; \ echo 'echo "Container: airc"' ; \
echo 'echo "Setting pip environment to /opt/airc"' ; \ echo 'echo "Setting pip environment to /opt/airc"' ; \
echo 'source /opt/intel/oneapi/setvars.sh'; \ echo 'if [[ -e /opt/intel/oneapi/setvars.sh ]]; then source /opt/intel/oneapi/setvars.sh; fi' ; \
echo 'source /opt/airc/venv/bin/activate'; \ echo 'source /opt/airc/venv/bin/activate'; \
echo 'if [[ "${1}" == "shell" ]] || [[ "${1}" == "/bin/bash" ]]; then' ; \ echo 'if [[ "${1}" == "shell" ]] || [[ "${1}" == "/bin/bash" ]]; then' ; \
echo ' echo "Dropping to shell"' ; \ echo ' echo "Dropping to shell"' ; \