Skip to content

Commit f40b344

Browse files
committed
ice runner
1 parent e362dc9 commit f40b344

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

.github/workflows/ice/submit.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 --ntasks-per-node=20 # Number of cores per node required
18+
"
19+
20+
sbatch_gpu_opts="\
21+
#SBATCH -G V100:2\
22+
"
23+
24+
if [ "$2" == "cpu" ]; then
25+
sbatch_device_opts="$sbatch_cpu_opts"
26+
elif [ "$2" == "gpu" ]; then
27+
sbatch_device_opts="$sbatch_gpu_opts"
28+
else
29+
usage
30+
exit 1
31+
fi
32+
33+
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2"
34+
35+
sbatch <<EOT
36+
#!/bin/bash
37+
#SBATCH -Jshb-$job_slug # Job name
38+
#SBATCH --account=gts-sbryngelson3 # charge account
39+
#SBATCH -N1 # Number of nodes required
40+
$sbatch_device_opts
41+
#SBATCH -t 02:00:00 # Duration of the job (Ex: 15 mins)
42+
#SBATCH -q embers # QOS Name
43+
#SBATCH -o$job_slug.out # Combined output and error messages file
44+
#SBATCH -W # Do not exit until the submitted job terminates.
45+
46+
set -e
47+
set -x
48+
49+
cd "\$SLURM_SUBMIT_DIR"
50+
echo "Running in $(pwd):"
51+
52+
job_slug="$job_slug"
53+
job_device="$2"
54+
55+
. ./mfc.sh load -c p -m $2
56+
57+
$sbatch_script_contents
58+
59+
EOT
60+

.github/workflows/ice/test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
build_opts=""
4+
if [ "$job_device" == "gpu" ]; then
5+
build_opts="--gpu"
6+
fi
7+
8+
./mfc.sh build -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 phoenix

.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', 'frontier']
106+
lbl: ['gt', 'ice', 'frontier']
107107
exclude:
108108
- device: cpu
109109
lbl: frontier
@@ -121,6 +121,10 @@ jobs:
121121
if: matrix.lbl == 'gt'
122122
run: bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/test.sh ${{ matrix.device }}
123123

124+
- name: Build & Test
125+
if: matrix.lbl == 'ice'
126+
run: bash .github/workflows/ice/submit.sh .github/workflows/phoenix/test.sh ${{ matrix.device }}
127+
124128
- name: Build
125129
if: matrix.lbl == 'frontier'
126130
run: bash .github/workflows/frontier/build.sh

0 commit comments

Comments
 (0)