Skip to content

Commit 2f33f55

Browse files
committed
add delta runner
1 parent de267d6 commit 2f33f55

File tree

3 files changed

+88
-1
lines changed

3 files changed

+88
-1
lines changed

.github/workflows/delta/submit.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
usage() {
6+
echo "Usage: $0 [script.sh] [cpu|gpu]"
7+
}
8+
9+
if [ ! -z "$1" ]; then
10+
sbatch_script_contents=`cat $1`
11+
else
12+
usage
13+
exit 1
14+
fi
15+
16+
sbatch_cpu_opts="\
17+
#SBATCH -p cpu
18+
#SBATCH --account=bdiy-delta-cpu
19+
"
20+
21+
sbatch_gpu_opts="\
22+
#SBATCH -p gpuA100x4
23+
#SBATCH --account=bdiy-delta-gpu
24+
#SBATCH --gpus-per-node=2
25+
"
26+
27+
if [ "$2" == "cpu" ]; then
28+
sbatch_device_opts="$sbatch_cpu_opts"
29+
elif [ "$2" == "gpu" ]; then
30+
sbatch_device_opts="$sbatch_gpu_opts"
31+
else
32+
usage
33+
exit 1
34+
fi
35+
36+
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2"
37+
38+
sbatch <<EOT
39+
#!/bin/bash
40+
#SBATCH -Jshb-$job_slug # Job name
41+
#SBATCH -N1 # Number of nodes required
42+
$sbatch_device_opts
43+
#SBATCH -t 02:00:00 # Duration of the job (Ex: 15 mins)
44+
#SBATCH -n 20
45+
#SBATCH -o$job_slug.out # Combined output and error messages file
46+
#SBATCH -W # Do not exit until the submitted job terminates.
47+
#SBATCH --constraint="scratch"
48+
49+
set -e
50+
set -x
51+
52+
cd "\$SLURM_SUBMIT_DIR"
53+
echo "Running in $(pwd):"
54+
55+
job_slug="$job_slug"
56+
job_device="$2"
57+
58+
. ./mfc.sh load -c d -m $2
59+
60+
$sbatch_script_contents
61+
62+
EOT
63+

.github/workflows/delta/test.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
build_opts=""
4+
if [ "$job_device" == "gpu" ]; then
5+
build_opts="--gpu"
6+
fi
7+
8+
./mfc.sh test --dry-run -j 8 $build_opts
9+
10+
n_test_threads=8
11+
12+
if [ "$job_device" == "gpu" ]; then
13+
gpu_count=$(nvidia-smi -L | wc -l) # number of GPUs on node
14+
gpu_ids=$(seq -s ' ' 0 $(($gpu_count-1))) # 0,1,2,...,gpu_count-1
15+
device_opts="-g $gpu_ids"
16+
n_test_threads=`expr $gpu_count \* 2`
17+
fi
18+
19+
./mfc.sh test --max-attempts 3 -a -j $n_test_threads $device_opts -- -c delta
20+

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
strategy:
104104
matrix:
105105
device: ['cpu', 'gpu']
106-
lbl: ['gt', 'ice', 'frontier']
106+
lbl: ['gt', 'ice', 'delta', 'frontier']
107107
exclude:
108108
- device: cpu
109109
lbl: frontier
@@ -125,6 +125,10 @@ jobs:
125125
if: matrix.lbl == 'ice'
126126
run: bash .github/workflows/ice/submit.sh .github/workflows/ice/test.sh ${{ matrix.device }}
127127

128+
- name: Build & Test
129+
if: matrix.lbl == 'delta'
130+
run: bash .github/workflows/delta/submit.sh .github/workflows/delta/test.sh ${{ matrix.device }}
131+
128132
- name: Build
129133
if: matrix.lbl == 'frontier'
130134
run: bash .github/workflows/frontier/build.sh

0 commit comments

Comments
 (0)