forked from Ascend/Ascend-CI
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 2.93 KB
/
deepspeed.yaml
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
name: huawei-ascend-npu
defaults:
run:
shell: bash -ieo pipefail {0}
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/huawei-ascend-npu.yml'
- 'requirements/**'
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
issues: write
jobs:
unit-tests:
runs-on: [self-hosted, ascend, npu]
container:
image: ascendai/cann
ports:
- 80
volumes:
- /usr/local/dcmi:/usr/local/dcmi
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
- /etc/ascend_install.info:/etc/ascend_install.info
options: --network host
--name deepspeed_unit-tests
--device /dev/davinci4
--device /dev/davinci_manager
--device /dev/devmm_svm
--device /dev/hisi_hdc
--shm-size "20g"
--entrypoint /bin/bash
env:
PT_HPU_LAZY_MODE: 0
TORCHINDUCTOR_COMPILE_THREADS: 1
TEST_LIST: |
test_accelerator.py
test_autotuning.py
test_compression.py
steps:
- uses: actions/checkout@v4
- name: Install pytorch
run: |
npu-smi info
apt-get update
source /root/.bashrc
pip install torch==2.2.0 torchvision==0.17.0 torch_npu==2.2.0 numpy==1.26.4 cloudpickle tornado ml-dtypes -i https://pypi.tuna.tsinghua.edu.cn/simple
python << EOF
if __name__ == '__main__':
import torch
import torch_npu
torch_npu.npu.set_device("npu:0")
print(f"Device Name: {torch.npu.get_device_name(0)}")
print(f"Device Count: {torch.npu.device_count()}")
print(f"Device Available: {torch.npu.is_available()}")
EOF
# - name: Install transformers
# run: |
# source /root/.bashrc
# echo "y" | apt-get install git
# git clone https://github.com/huggingface/transformers
# cd transformers
# git rev-parse --short HEAD
# pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple
- name: Install deepspeed
run: |
source /root/.bashrc
echo "y" | apt-get install git
git clone https://github.com/microsoft/DeepSpeed.git
cd DeepSpeed
pip install .[1bit,npu,autotuning,inf] -i https://pypi.tuna.tsinghua.edu.cn/simple
ds_report
- name: Python environment
run: |
source /root/.bashrc
pip list
- name: Unit tests
run: |
source /root/.bashrc
unset TORCH_CUDA_ARCH_LIST # only jit compile for current arch
cd DeepSpeed/tests/
pytest --verbose tests/*