forked from deepmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (131 loc) · 4.61 KB
/
Copy pathcuda.yml
File metadata and controls
151 lines (131 loc) · 4.61 KB
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
name: CUDA Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- develop
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test on CUDA Build
runs-on: gpu
if: github.repository_owner == 'deepmodeling'
container:
image: ghcr.io/deepmodeling/abacus-cuda
options: --gpus all
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_COMPRESS: "true"
CCACHE_MAXSIZE: 8G
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
with:
submodules: recursive
- name: Install CI tools
run: |
sudo apt-get update
sudo apt-get install -y ccache xz-utils ninja-build pkg-config
- name: Calculate compiler cache fingerprint
id: compiler
run: |
fingerprint="$({ c++ --version; nvcc --version; ccache --version; } | sha256sum | cut -d' ' -f1)"
echo "fingerprint=${fingerprint}" >> "${GITHUB_OUTPUT}"
- name: Restore compiler cache
uses: actions/cache@v6
with:
path: ${{ env.CCACHE_DIR }}
key: abacus-cuda-ccache-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.compiler.outputs.fingerprint }}-${{ github.sha }}
restore-keys: |
abacus-cuda-ccache-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.compiler.outputs.fingerprint }}-
- name: Prepare compiler cache
run: |
mkdir -p "${CCACHE_DIR}"
ccache --set-config="max_size=${CCACHE_MAXSIZE}"
ccache --zero-stats
- name: Install external tools from toolchain
run: |
cd toolchain
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run -j8
./scripts/stage4/install_stage4.sh
cd ..
- name: Configure & Build
run: |
nvidia-smi
source toolchain/install/setup
rm -rf build
cmake -B build -G Ninja -DUSE_CUDA=ON -DBUILD_TESTING=ON -DENABLE_FLOAT_FFTW=ON \
-DCMAKE_CUDA_ARCHITECTURES=70
cmake --build build -j "$(nproc)"
cmake --install build
- name: Report compiler cache
if: always()
run: |
ccache --show-stats
ccache --show-stats >> "${GITHUB_STEP_SUMMARY}"
- name: Module_LCAO CUDA Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
ctest --test-dir build -V --timeout 1700 -R '^(MODULE_LCAO_tddft_radial_interpolation_cuda_test|MODULE_LCAO_tddft_snap_psibeta_half_test)$'
- name: Test 11_PW_GPU
run: |
cd tests/11_PW_GPU
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 12_NAO_Gamma_GPU
run: |
cd tests/12_NAO_Gamma_GPU
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 13_NAO_multik_GPU
run: |
cd tests/13_NAO_multik_GPU
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 02_NAO_Gamma on GPU
run: |
cd tests/02_NAO_Gamma
find . -name INPUT | while read f; do
if grep -qE '^[[:space:]]*device[[:space:]]+' "$f"; then
sed -i -E 's/^[[:space:]]*device[[:space:]]+.*/device gpu/' "$f"
else
echo "device gpu" >> "$f"
fi
done
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 03_NAO_multik on GPU
run: |
cd tests/03_NAO_multik
find . -name INPUT | while read f; do
if grep -qE '^[[:space:]]*device[[:space:]]+' "$f"; then
sed -i -E 's/^[[:space:]]*device[[:space:]]+.*/device gpu/' "$f"
else
echo "device gpu" >> "$f"
fi
done
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 15_rtTDDFT_GPU
run: |
cd tests/15_rtTDDFT_GPU
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 16_SDFT_GPU
run: |
cd tests/16_SDFT_GPU
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
- name: Test 01_PW on GPU
run: |
cd tests/01_PW
find . -name INPUT | while read f; do
if grep -q "^device" "$f"; then
sed -i 's/^device.*/device gpu/' "$f"
else
echo "device gpu" >> "$f"
fi
done
bash ../integrate/Autotest.sh -n 1 -a abacus -f CASES_GPU.txt