-
Notifications
You must be signed in to change notification settings - Fork 4.1k
128 lines (110 loc) · 4.4 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
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