Skip to content

Commit 88606e0

Browse files
authored
Change deepspeed installation (#3639)
1 parent c5442a3 commit 88606e0

File tree

11 files changed

+56
-826
lines changed

11 files changed

+56
-826
lines changed

examples/cpu/llm/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ COPY . ./intel-extension-for-pytorch
4343
RUN . ~/miniforge3/bin/activate && conda create -y -n compile_py310 python=3.10 && conda activate compile_py310 && \
4444
cd intel-extension-for-pytorch/examples/cpu/llm && \
4545
export CC=gcc && export CXX=g++ && \
46-
if [ -z ${COMPILE} ]; then bash tools/env_setup.sh 14; else bash tools/env_setup.sh 10; fi && \
46+
if [ -z ${COMPILE} ]; then bash tools/env_setup.sh 6; else bash tools/env_setup.sh 2; fi && \
4747
unset CC && unset CXX
4848

4949
FROM base AS deploy
@@ -60,7 +60,7 @@ COPY --from=dev /root/intel-extension-for-pytorch/tools/get_libstdcpp_lib.sh ./l
6060
RUN . ~/miniforge3/bin/activate && conda create -y -n py310 python=3.10 && conda activate py310 && \
6161
cd /usr/lib/x86_64-linux-gnu/ && ln -s libtcmalloc.so.4 libtcmalloc.so && cd && \
6262
cd ./llm && \
63-
bash tools/env_setup.sh 9 && \
63+
bash tools/env_setup.sh 1 && \
6464
python -m pip cache purge && \
6565
mv ./oneCCL_release /opt/oneCCL && \
6666
chown -R root:root /opt/oneCCL && \

examples/cpu/llm/README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,71 @@ And a set of data types are supported for various scenarios, including FP32, BF1
77

88
# 2. Environment Setup
99

10-
**Note**: The instructions in this section will setup an environment with a recent PyTorch\* nightly build and **a latest source build of IPEX**.
11-
If you would like to use stable PyTorch\* and IPEX release versions, please refer to the instructions [in the release branch](https://github.com/intel/intel-extension-for-pytorch/blob/v2.6.0%2Bcpu/examples/cpu/llm/README.md#2-environment-setup),
12-
in which IPEX is installed via prebuilt wheels using `pip install` rather than source code building.
10+
## 2.1 [RECOMMENDED] Docker-based environment setup with pre-built wheels
1311

14-
**Note**: Please be aware that in order to enable the latest optimizations for MoE models (DeepSeek, Mixtral, etc.) in `DeepSpeed`,
15-
we are setting a different argument for `env_setup.sh` in IPEX v2.6.0+cpu comparing with previous versions,
16-
in order to build `DeepSpeed` from source code with a recent commit.
12+
```bash
13+
# Get the Intel® Extension for PyTorch\* source code
14+
git clone https://github.com/intel/intel-extension-for-pytorch.git
15+
cd intel-extension-for-pytorch
16+
git checkout v2.7.0+cpu
17+
git submodule sync
18+
git submodule update --init --recursive
19+
20+
# Build an image with the provided Dockerfile by installing from Intel® Extension for PyTorch\* prebuilt wheel files
21+
# To have a custom ssh server port for multi-nodes run, please add --build-arg PORT_SSH=<CUSTOM_PORT> ex: 2345, otherwise use the default 22 SSH port
22+
DOCKER_BUILDKIT=1 docker build -f examples/cpu/llm/Dockerfile --build-arg PORT_SSH=2345 -t ipex-llm:2.7.0 .
23+
24+
# Run the container with command below
25+
docker run --rm -it --privileged -v /dev/shm:/dev/shm ipex-llm:2.7.0 bash
26+
27+
# When the command prompt shows inside the docker container, enter llm examples directory
28+
cd llm
29+
30+
# Activate environment variables
31+
# set bash script argument to "inference" or "fine-tuning" for different usages
32+
source ./tools/env_activate.sh [inference|fine-tuning]
33+
```
34+
35+
## 2.2 Conda-based environment setup with pre-built wheels
36+
37+
```bash
38+
# Get the Intel® Extension for PyTorch\* source code
39+
git clone https://github.com/intel/intel-extension-for-pytorch.git
40+
cd intel-extension-for-pytorch
41+
git checkout v2.7.0+cpu
42+
git submodule sync
43+
git submodule update --init --recursive
44+
45+
# GCC 12.3 is required. Installation can be taken care of by the environment configuration script.
46+
# Create a conda environment
47+
conda create -n llm python=3.10 -y
48+
conda activate llm
49+
50+
# Setup the environment with the provided script
51+
cd examples/cpu/llm
52+
bash ./tools/env_setup.sh 7
53+
54+
# Activate environment variables
55+
# set bash script argument to "inference" or "fine-tuning" for different usages
56+
source ./tools/env_activate.sh [inference|fine-tuning]
57+
```
1758

18-
## 2.1 [Recommended] Docker-based environment setup with compilation from source
59+
## 2.3 Docker-based environment setup with compilation from source
1960

2061
```bash
2162
# Get the Intel® Extension for PyTorch\* source code
2263
git clone https://github.com/intel/intel-extension-for-pytorch.git
2364
cd intel-extension-for-pytorch
65+
git checkout v2.7.0+cpu
2466
git submodule sync
2567
git submodule update --init --recursive
2668

2769
# Build an image with the provided Dockerfile by compiling Intel® Extension for PyTorch\* from source
2870
# To have a custom ssh server port for multi-nodes run, please add --build-arg PORT_SSH=<CUSTOM_PORT> ex: 2345, otherwise use the default 22 SSH port
29-
docker build -f examples/cpu/llm/Dockerfile --build-arg COMPILE=ON --build-arg PORT_SSH=2345 -t ipex-llm:main .
71+
docker build -f examples/cpu/llm/Dockerfile --build-arg COMPILE=ON --build-arg PORT_SSH=2345 -t ipex-llm:2.7.0 .
3072

3173
# Run the container with command below
32-
docker run --rm -it --net host --privileged -v /dev/shm:/dev/shm ipex-llm:main bash
74+
docker run --rm -it --net host --privileged -v /dev/shm:/dev/shm ipex-llm:2.7.0 bash
3375

3476
# When the command prompt shows inside the docker container, enter llm examples directory
3577
cd llm
@@ -39,12 +81,13 @@ cd llm
3981
source ./tools/env_activate.sh [inference|fine-tuning]
4082
```
4183

42-
## 2.2 Conda-based environment setup with compilation from source
84+
## 2.4 Conda-based environment setup with compilation from source
4385

4486
```bash
4587
# Get the Intel® Extension for PyTorch\* source code
4688
git clone https://github.com/intel/intel-extension-for-pytorch.git
4789
cd intel-extension-for-pytorch
90+
git checkout v2.7.0+cpu
4891
git submodule sync
4992
git submodule update --init --recursive
5093

@@ -55,7 +98,7 @@ conda activate llm
5598

5699
# Setup the environment with the provided script
57100
cd examples/cpu/llm
58-
bash ./tools/env_setup.sh 11
101+
bash ./tools/env_setup.sh 3
59102

60103
# Activate environment variables
61104
# set bash script argument to "inference" or "fine-tuning" for different usages

examples/cpu/serving/triton/Dockerfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

examples/cpu/serving/triton/README.md

Lines changed: 0 additions & 113 deletions
This file was deleted.

examples/cpu/serving/triton/THIRD-PARTY-PROGRAMS

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)