diff --git a/docker/llm/finetune/lora/cpu/docker/Dockerfile b/docker/llm/finetune/lora/cpu/docker/Dockerfile index 4b6f51b9..8c564b03 100644 --- a/docker/llm/finetune/lora/cpu/docker/Dockerfile +++ b/docker/llm/finetune/lora/cpu/docker/Dockerfile @@ -21,7 +21,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] h RUN mkdir /ipex_llm/data && mkdir /ipex_llm/model && \ # install pytorch 2.0.1 apt-get update && \ - apt-get install -y python3-pip python3.9-dev python3-wheel git software-properties-common && \ + apt-get install -y python3-pip python3.11-dev python3-wheel git software-properties-common && \ pip3 install --upgrade pip && \ export PIP_DEFAULT_TIMEOUT=100 && \ pip install --upgrade torch==2.1.0 --index-url https://download.pytorch.org/whl/cpu && \ @@ -37,9 +37,9 @@ RUN mkdir /ipex_llm/data && mkdir /ipex_llm/model && \ pip install -r /ipex_llm/requirements.txt && \ # install python add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get install -y python3.9 && \ + apt-get install -y python3.11 && \ rm /usr/bin/python3 && \ - ln -s /usr/bin/python3.9 /usr/bin/python3 && \ + ln -s /usr/bin/python3.11 /usr/bin/python3 && \ ln -s /usr/bin/python3 /usr/bin/python && \ pip install --no-cache requests argparse cryptography==3.3.2 urllib3 && \ pip install --upgrade requests && \ diff --git a/docker/llm/finetune/qlora/cpu/docker/Dockerfile b/docker/llm/finetune/qlora/cpu/docker/Dockerfile index 2aaaa08e..4f68d486 100644 --- a/docker/llm/finetune/qlora/cpu/docker/Dockerfile +++ b/docker/llm/finetune/qlora/cpu/docker/Dockerfile @@ -21,7 +21,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] h RUN mkdir -p /ipex_llm/data && mkdir -p /ipex_llm/model && \ # install pytorch 2.1.0 apt-get update && \ - apt-get install -y --no-install-recommends python3-pip python3.9-dev python3-wheel python3.9-distutils git software-properties-common && \ + apt-get install -y --no-install-recommends python3-pip python3.11-dev python3-wheel python3.11-distutils git software-properties-common && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ pip3 install --upgrade pip && \ diff --git a/docker/llm/finetune/qlora/cpu/docker/Dockerfile.k8s b/docker/llm/finetune/qlora/cpu/docker/Dockerfile.k8s index 71a8a5e1..f14e0b08 100644 --- a/docker/llm/finetune/qlora/cpu/docker/Dockerfile.k8s +++ b/docker/llm/finetune/qlora/cpu/docker/Dockerfile.k8s @@ -22,7 +22,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] h RUN mkdir -p /ipex_llm/data && mkdir -p /ipex_llm/model && \ apt-get update && \ apt install -y --no-install-recommends openssh-server openssh-client libcap2-bin gnupg2 ca-certificates \ - python3-pip python3.9-dev python3-wheel python3.9-distutils git software-properties-common && \ + python3-pip python3.11-dev python3-wheel python3.11-distutils git software-properties-common && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p /var/run/sshd && \ diff --git a/docker/llm/finetune/qlora/xpu/docker/Dockerfile b/docker/llm/finetune/qlora/xpu/docker/Dockerfile index ea5fe693..478ed5bc 100644 --- a/docker/llm/finetune/qlora/xpu/docker/Dockerfile +++ b/docker/llm/finetune/qlora/xpu/docker/Dockerfile @@ -18,15 +18,15 @@ RUN curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-P apt-get install -y curl wget git gnupg gpg-agent software-properties-common libunwind8-dev vim less && \ # install Intel GPU driver apt-get install -y intel-opencl-icd intel-level-zero-gpu=1.3.26241.33-647~22.04 level-zero level-zero-dev --allow-downgrades && \ - # install python 3.9 + # install python 3.11 ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ env DEBIAN_FRONTEND=noninteractive apt-get update && \ add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get install -y python3.9 && \ + apt-get install -y python3.11 && \ rm /usr/bin/python3 && \ - ln -s /usr/bin/python3.9 /usr/bin/python3 && \ + ln -s /usr/bin/python3.11 /usr/bin/python3 && \ ln -s /usr/bin/python3 /usr/bin/python && \ - apt-get install -y python3-pip python3.9-dev python3-wheel python3.9-distutils && \ + apt-get install -y python3-pip python3.11-dev python3-wheel python3.11-distutils && \ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ # install XPU ipex-llm pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ && \ diff --git a/docker/llm/inference/cpu/docker/Dockerfile b/docker/llm/inference/cpu/docker/Dockerfile index f8a302f7..319ffcdf 100644 --- a/docker/llm/inference/cpu/docker/Dockerfile +++ b/docker/llm/inference/cpu/docker/Dockerfile @@ -9,22 +9,30 @@ ENV PYTHONUNBUFFERED=1 COPY ./start-notebook.sh /llm/start-notebook.sh -# Install PYTHON 3.9 +# Update the software sources RUN env DEBIAN_FRONTEND=noninteractive apt-get update && \ +# Install essential packages apt install software-properties-common libunwind8-dev vim less -y && \ +# Install git, curl, and wget + apt-get install -y git curl wget && \ +# Install Python 3.11 + # Add Python 3.11 PPA repository add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get install -y python3.9 git curl wget && \ + # Install Python 3.11 + apt-get install -y python3.11 && \ + # Remove the original /usr/bin/python3 symbolic link rm /usr/bin/python3 && \ - ln -s /usr/bin/python3.9 /usr/bin/python3 && \ + # Create a symbolic link pointing to Python 3.11 at /usr/bin/python3 + ln -s /usr/bin/python3.11 /usr/bin/python3 && \ + # Create a symbolic link pointing to /usr/bin/python3 at /usr/bin/python ln -s /usr/bin/python3 /usr/bin/python && \ - apt-get install -y python3-pip python3.9-dev python3-wheel python3.9-distutils && \ + # Install Python 3.11 development and utility packages + apt-get install -y python3-pip python3.11-dev python3-wheel python3.11-distutils && \ +# Download and install pip, install FastChat from source requires PEP 660 support curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ -# Install FastChat from source requires PEP 660 support python3 get-pip.py && \ rm get-pip.py && \ pip install --upgrade requests argparse urllib3 && \ - pip3 install --no-cache-dir --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \ - pip install --pre --upgrade ipex-llm[all] && \ # Download ipex-llm-tutorial cd /llm && \ pip install --upgrade jupyterlab && \ diff --git a/docker/llm/inference/xpu/docker/Dockerfile b/docker/llm/inference/xpu/docker/Dockerfile index 74dec616..b3269627 100644 --- a/docker/llm/inference/xpu/docker/Dockerfile +++ b/docker/llm/inference/xpu/docker/Dockerfile @@ -20,16 +20,16 @@ RUN curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-P wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \ echo 'deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc' | tee /etc/apt/sources.list.d/intel.gpu.jammy.list && \ rm /etc/apt/sources.list.d/intel-graphics.list && \ - # Install PYTHON 3.9 and IPEX-LLM[xpu] + # Install PYTHON 3.11 and IPEX-LLM[xpu] ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ env DEBIAN_FRONTEND=noninteractive apt-get update && \ apt install software-properties-common libunwind8-dev vim less -y && \ add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get install -y python3.9 git curl wget && \ + apt-get install -y python3.11 git curl wget && \ rm /usr/bin/python3 && \ - ln -s /usr/bin/python3.9 /usr/bin/python3 && \ + ln -s /usr/bin/python3.11 /usr/bin/python3 && \ ln -s /usr/bin/python3 /usr/bin/python && \ - apt-get install -y python3-pip python3.9-dev python3-wheel python3.9-distutils && \ + apt-get install -y python3-pip python3.11-dev python3-wheel python3.11-distutils && \ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ # Install FastChat from source requires PEP 660 support python3 get-pip.py && \ diff --git a/docker/llm/serving/cpu/docker/Dockerfile b/docker/llm/serving/cpu/docker/Dockerfile index 06ddb7f5..e3ddb7ca 100644 --- a/docker/llm/serving/cpu/docker/Dockerfile +++ b/docker/llm/serving/cpu/docker/Dockerfile @@ -16,7 +16,7 @@ RUN cd /llm && \ # Fix Trivy CVE Issues pip install Jinja2==3.1.3 transformers==4.36.2 gradio==4.19.2 cryptography==42.0.4 && \ # Fix Qwen model adpater in fastchat - patch /usr/local/lib/python3.9/dist-packages/fastchat/model/model_adapter.py < /llm/model_adapter.py.patch && \ + patch /usr/local/lib/python3.11/dist-packages/fastchat/model/model_adapter.py < /llm/model_adapter.py.patch && \ chmod +x /opt/entrypoint.sh && \ chmod +x /sbin/tini && \ cp /sbin/tini /usr/bin/tini diff --git a/python/llm/example/CPU/QLoRA-FineTuning/alpaca-qlora/README.md b/python/llm/example/CPU/QLoRA-FineTuning/alpaca-qlora/README.md index 9641d356..a3d0ba36 100644 --- a/python/llm/example/CPU/QLoRA-FineTuning/alpaca-qlora/README.md +++ b/python/llm/example/CPU/QLoRA-FineTuning/alpaca-qlora/README.md @@ -60,7 +60,7 @@ pip install oneccl_bind_pt --extra-index-url https://developer.intel.com/ipex-wh 2. modify conf in `finetune_one_node_two_sockets.sh` and run ``` -source ${conda_env}/lib/python3.9/site-packages/oneccl_bindings_for_pytorch/env/setvars.sh +source ${conda_env}/lib/python3.11/site-packages/oneccl_bindings_for_pytorch/env/setvars.sh bash finetune_one_node_two_sockets.sh ``` diff --git a/python/llm/example/GPU/HF-Transformers-AutoModels/Model/voiceassistant/README.md b/python/llm/example/GPU/HF-Transformers-AutoModels/Model/voiceassistant/README.md index f34731df..74afab59 100644 --- a/python/llm/example/GPU/HF-Transformers-AutoModels/Model/voiceassistant/README.md +++ b/python/llm/example/GPU/HF-Transformers-AutoModels/Model/voiceassistant/README.md @@ -163,7 +163,7 @@ frame_data = np.frombuffer(audio.frame_data, np.int16).flatten().astype(np.float #### Sample Output ```bash (llm) ipex@ipex-llm:~/Documents/voiceassistant$ python generate.py --llama2-repo-id-or-model-path /mnt/windows/demo/models/Llama-2-7b-chat-hf --whisper-repo-id-or-model-path /mnt/windows/demo/models/whisper-medium -/home/ipex/anaconda3/envs/llm/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source? +/home/ipex/anaconda3/envs/llm/lib/python3.11/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source? warn( [?] Which microphone do you choose?: Default @@ -189,11 +189,11 @@ Extracting data files: 100%|█████████████████ Generating validation split: 73 examples [00:00, 5328.37 examples/s] Converting and loading models... Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:09<00:00, 3.04s/it] -/home/ipex/anaconda3/envs/yina-llm/lib/python3.9/site-packages/transformers/generation/configuration_utils.py:362: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.9` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. +/home/ipex/anaconda3/envs/yina-llm/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:362: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.9` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. warnings.warn( -/home/ipex/anaconda3/envs/yina-llm/lib/python3.9/site-packages/transformers/generation/configuration_utils.py:367: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.6` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. +/home/ipex/anaconda3/envs/yina-llm/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:367: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.6` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed. warnings.warn( -/home/ipex/anaconda3/envs/yina-llm/lib/python3.9/site-packages/transformers/generation/utils.py:1411: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use a generation configuration file (see https://huggingface.co/docs/transformers/main_classes/text_generation ) +/home/ipex/anaconda3/envs/yina-llm/lib/python3.11/site-packages/transformers/generation/utils.py:1411: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use a generation configuration file (see https://huggingface.co/docs/transformers/main_classes/text_generation ) warnings.warn( Calibrating... Listening now...