Skip to content

Commit 1d4947a

Browse files
authored
Add Buildkite pipeline to check flagship AMIP performance (#2438)
1 parent 17565e5 commit 1d4947a

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

.buildkite/perf/ClimaCoupler.jl

Submodule ClimaCoupler.jl added at 74e724d

.buildkite/perf/check-sypd.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
SYPD_FILE=output/gpu_amip_progedmf_1M_land_he16/artifacts/sypd.txt
4+
5+
if [[ ! -f "$SYPD_FILE" ]]; then
6+
echo "❌ SYPD file not found: $SYPD_FILE"
7+
exit 1
8+
fi
9+
10+
SYPD=$(cat "$SYPD_FILE" | tr -d '[:space:]')
11+
12+
if [[ -z "$SYPD" ]]; then
13+
echo "❌ SYPD file is empty"
14+
exit 1
15+
fi
16+
17+
echo "SYPD: $SYPD"
18+
19+
PERCENT_CHANGE=$(echo "scale=2; (($SYPD - $BASELINE_SYPD) / $BASELINE_SYPD) * 100" | bc)
20+
21+
if (( $(echo "$PERCENT_CHANGE <= $MIN_PERCENT_CHANGE" | bc -l) )); then
22+
echo "❌ SYPD changed by $PERCENT_CHANGE% (threshold: $MIN_PERCENT_CHANGE%)"
23+
exit 1
24+
else
25+
echo "✅ SYPD change ($PERCENT_CHANGE%) is okay (threshold: $MIN_PERCENT_CHANGE%)"
26+
fi

.buildkite/perf/pipeline.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# A pipeline for downstream performance checks
2+
agents:
3+
queue: clima
4+
slurm_time: 14:00:00
5+
modules: climacommon/2025_05_15
6+
7+
env:
8+
JULIA_DEPOT_PATH: "${BUILDKITE_BUILD_PATH}/${BUILDKITE_PIPELINE_SLUG}/depot/default"
9+
JULIA_MAX_NUM_PRECOMPILE_FILES: 100
10+
GKSwstype: 100
11+
SLURM_KILL_BAD_EXIT: 1
12+
COUPLER_PATH: ".buildkite/perf/ClimaCoupler.jl"
13+
CONFIG_PATH: "$COUPLER_PATH/config/nightly_configs"
14+
BENCHMARK_CONFIG_PATH: "$COUPLER_PATH/config/benchmark_configs"
15+
16+
timeout_in_minutes: 840
17+
18+
steps:
19+
- label: "Check if pipeline should run :mag:"
20+
key: "check_changes"
21+
soft_fail: true
22+
command:
23+
- git submodule update --init --recursive .buildkite/perf/ClimaCoupler.jl
24+
- |
25+
# Check if files in src, ext, or .buildkite/perf have changed
26+
if git diff --quiet origin/main...HEAD -- src ext .buildkite/perf; then
27+
echo "⏭️ No relevant changes detected, skipping downstream checks"
28+
exit 1
29+
else
30+
echo "✅ Relevant changes detected, running downstream checks"
31+
exit 0
32+
fi
33+
34+
- label: "init :GPU:"
35+
key: "init_gpu_env"
36+
depends_on: "check_changes"
37+
command:
38+
- "echo $$JULIA_DEPOT_PATH"
39+
- echo "--- Instantiate AMIP env"
40+
# Instantiate and dev install ClimaCore
41+
- "julia --project=$COUPLER_PATH/experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
42+
- 'julia --project=$COUPLER_PATH/experiments/ClimaEarth/ -e ''using Pkg; Pkg.develop(path=".")'''
43+
- 'julia --project=$COUPLER_PATH/experiments/ClimaEarth/ -e ''using Pkg; Pkg.add("MPI")'''
44+
- "julia --project=$COUPLER_PATH/experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'"
45+
- "julia --project=$COUPLER_PATH/experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'"
46+
agents:
47+
slurm_gpus: 1
48+
slurm_cpus_per_task: 8
49+
env:
50+
JULIA_NUM_PRECOMPILE_TASKS: 8
51+
JULIA_MAX_NUM_PRECOMPILE_FILES: 50
52+
53+
- label: "Flagship AMIP GPU with prognostic EDMF + 1M + integrated land (16 helems)"
54+
key: "gpu_amip_progedmf_1M_land_he16"
55+
depends_on: "init_gpu_env"
56+
command:
57+
- "srun julia --threads=3 --color=yes --project=$COUPLER_PATH/experiments/ClimaEarth/ $COUPLER_PATH/experiments/ClimaEarth/run_amip.jl --config_file $BENCHMARK_CONFIG_PATH/amip_progedmf_1m_land_he16.yml --job_id gpu_amip_progedmf_1M_land_he16"
58+
- echo "--- Checking SYPD from artifacts"
59+
- bash .buildkite/perf/check-sypd.sh
60+
artifact_paths: "output/gpu_amip_progedmf_1M_land_he16/artifacts/*"
61+
env:
62+
CLIMACOMMS_DEVICE: "CUDA"
63+
BASELINE_SYPD: "0.081"
64+
MIN_PERCENT_CHANGE: "-1"
65+
agents:
66+
slurm_gpus_per_task: 1
67+
slurm_cpus_per_task: 4
68+
slurm_ntasks: 1
69+
slurm_mem: 16GB

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".buildkite/perf/ClimaCoupler.jl"]
2+
path = .buildkite/perf/ClimaCoupler.jl
3+
url = https://github.com/CliMA/ClimaCoupler.jl.git

0 commit comments

Comments
 (0)