-
Notifications
You must be signed in to change notification settings - Fork 4.2k
218 lines (197 loc) · 9.89 KB
/
autotp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: autotp
on:
pull_request:
paths:
- '.github/workflows/autotp.yml'
- 'requirements/**'
- 'deepspeed/__init__.py'
- 'deepspeed/module_inject/**'
- '!deepspeed/module_inject/containers/**' # exclude container dir
workflow_dispatch:
merge_group:
branches: [ master ]
schedule:
- cron: "0 0 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: [self-hosted, cpu]
steps:
- uses: actions/checkout@v3
- id: setup-venv
uses: ./.github/workflows/setup-venv
- name: Install gcc-9
run: |
sudo add-apt-repository -u ppa:ubuntu-toolchain-r/test
sudo apt install -y gcc-9 g++-9
# set gcc-9 and g++9 to default
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 99
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 99
- name: Check gcc version
run: |
# Get gcc version
gcc --version
g++ --version
- name: Detect instruction sets on instance
run: |
lscpu
cat /proc/meminfo
pip install cmake
git clone https://github.com/intel/intel-extension-for-pytorch
cd intel-extension-for-pytorch/tests/cpu/isa
cmake .
make
./cpu_features
- name: Install numactl
run: |
sudo apt-get install -y numactl
- name: Install oneCCL Bindings for PyTorch
run: |
pip install torch
python -m pip install intel_extension_for_pytorch
# the curl line is for troubleshooting
curl -L https://pytorch-extension.intel.com/release-whl/stable/cpu/us/
python -m pip install oneccl_bind_pt --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/
pip install py-cpuinfo
# check installed version
pip list |grep \\\<torch\\\>
pip list |grep intel-extension-for-pytorch
pip list |grep oneccl-bind-pt
- name: Install oneCCL
run: |
git clone https://github.com/oneapi-src/oneCCL
cd oneCCL
mkdir build
cd build
cmake ..
make -j install
- name: Install transformers
run: |
git clone https://github.com/huggingface/transformers
cd transformers
git rev-parse --short HEAD
pip install .
- name: Install deepspeed
run: |
python -c "import torch;import intel_extension_for_pytorch as ipex;print(ipex._C._has_xpu())"
# check why the host does not have AVX2 support
pip install .[dev,1bit,autotuning,inf]
ds_report
- name: Python environment check
run: |
pip list
- name: Download DeepSpeedExamples
run: |
git clone https://github.com/Microsoft/DeepSpeedExamples
- name: Sanity check minimal
run: |
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
source oneCCL/build/_install/env/setvars.sh
python -c "import torch;import intel_extension_for_pytorch as ipex;print(ipex._C._has_xpu())"
- name: AutoTP test (facebook/opt-1.3b)
run: |
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
source oneCCL/build/_install/env/setvars.sh
# modify MODEL to change the model name, other lines are the same
export MODEL=facebook/opt-1.3b
cd DeepSpeedExamples/inference/huggingface/text-generation
deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
- name: AutoTP test (bigscience/bloom-3b)
run: |
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
source oneCCL/build/_install/env/setvars.sh
# modify MODEL to change the model name, other lines are the same
export MODEL=bigscience/bloom-3b
cd DeepSpeedExamples/inference/huggingface/text-generation
deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
- name: AutoTP test (EleutherAI/gpt-j-6b)
run: |
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
source oneCCL/build/_install/env/setvars.sh
# modify MODEL to change the model name, other lines are the same
export MODEL=EleutherAI/gpt-j-6b
cd DeepSpeedExamples/inference/huggingface/text-generation
deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
- name: AutoTP test (baichuan-inc/Baichuan-7B)
run: |
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
source oneCCL/build/_install/env/setvars.sh
# modify MODEL to change the model name, other lines are the same
export MODEL=baichuan-inc/Baichuan-7B
cd DeepSpeedExamples/inference/huggingface/text-generation
deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
# - name: AutoTP test (bigcode/starcoder)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=bigcode/starcoder
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
#
# - name: AutoTP test (tiiuae/falcon-7b)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=tiiuae/falcon-7b
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
#
# - name: AutoTP test (google/flan-t5-xl)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=google/flan-t5-xl
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
#
# - name: AutoTP test (mistralai/Mistral-7B-v0.1)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=mistralai/Mistral-7B-v0.1
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
#
# - name: AutoTP test (mosaicml/mpt-7b)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=mosaicml/mpt-7b
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
#
# - name: AutoTP test (meta-llama/Llama-2-7b-hf)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=meta-llama/Llama-2-7b-hf
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1
#
# - name: AutoTP test (EleutherAI/gpt-neox-20b)
# run: |
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# source oneCCL/build/_install/env/setvars.sh
# # modify MODEL to change the model name, other lines are the same
# export MODEL=EleutherAI/gpt-neox-20
# cd DeepSpeedExamples/inference/huggingface/text-generation
# deepspeed --num_gpus 2 --bind_cores_to_rank inference-test.py --model $MODEL --dtype bfloat16 --use_meta_tensor
# deepspeed --num_gpus 2 --bind_cores_to_rank ds-hf-compare.py --model $MODEL --dtype bfloat16 --num_inputs 1