Skip to content

Commit 1c6ff07

Browse files
ashwinmaclaude
andcommitted
perf-optimizer-loop: scrub internal names for public repo
Remove username, site-specific paths (/shared/aaji, /home/aaji, rad-vultr-login), cluster-specific node names (lux-mi355x-*), partition/account names (lux, vultr_lux), and the now-refuted a-nodes-vs-b-nodes 17% performance gap narrative from all committed files. - Replace hardcoded paths with $AI4S_SHARED_DIR throughout scripts and agent prompt files; add AI4S_SHARED_DIR required-or-fail guard in run_optimizer_loop.sh - Replace partition/account SBATCH directives with generic defaults - Rewrite lessons #9, #10, #16, #18 in SKILL.md to drop cluster- specific node-class framing; preserve the methodological lesson (always check nodes_list before drawing class conclusions) - Delete HANDOFF.md (ephemeral session artifact, not repo material); add HANDOFF.md to .gitignore - Remove Authors/contacts block from HANDOFF.md before deletion Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
1 parent 7682fa3 commit 1c6ff07

11 files changed

Lines changed: 94 additions & 211 deletions

File tree

.cursor/skills/ai4science-perf-analysis/SKILL.md

Lines changed: 24 additions & 28 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ vic_server.log
6262

6363
# Local cluster config (site-specific, auto-created by agent)
6464
.cluster-config.yaml
65+
66+
# Session-scoped agent handoff files (ephemeral, not for the repo)
67+
HANDOFF.md
6568
.claude/settings.local.json
6669
nul
6770

material_science/models/HydraGNN/examples/microbench_node_health.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22
# microbench_node_health.sh
33
#
4-
# Per-node hardware/firmware/health survey for AMD MI355X (gfx950) nodes on
5-
# Vultr Lux. Runs four micro-tests in ~30 wall-clock seconds:
4+
# Per-node hardware/firmware/health survey for AMD MI355X (gfx950) nodes.
5+
# Runs four micro-tests in ~30 wall-clock seconds:
66
# 1. host inventory - CPU, NUMA, kernel, NICs, PCIe link, mounts, /tmp dd
77
# 2. GPU + driver inventory - rocminfo, rocm-smi (vbios/fw/topo), PCIe link state
88
# 3. CPU dual-NUMA STREAM - COPY/SCALE/ADD/TRIAD, 128 threads, NUMA-interleaved
@@ -24,7 +24,7 @@
2424
# and one summary line of pass/fail to stdout.
2525
#
2626
# Env vars (all optional, with defaults):
27-
# OUT_DIR (default: /shared/$USER/microbench-node-health)
27+
# OUT_DIR (default: $AI4S_SHARED_DIR/microbench-node-health)
2828
# HG_SIF (default: $AI4S_SHARED_DIR/images/pytorch_rocm7.2.2_ubuntu24.04_py3.12_pytorch_release_2.10.0.sif)
2929
# AI4S_SHARED_DIR (default: /shared/$USER)
3030
# STREAM_THRESHOLD_COPY_GBPS (default: 200) - dual-NUMA COPY pass floor
@@ -33,8 +33,8 @@
3333
#
3434
# SBATCH directives:
3535
#SBATCH --job-name=node-health
36-
#SBATCH --partition=lux
37-
#SBATCH --account=vultr_lux
36+
#SBATCH --partition=gpu
37+
#SBATCH --account=default
3838
#SBATCH --nodes=1
3939
#SBATCH --ntasks=1
4040
#SBATCH --cpus-per-task=128
@@ -47,11 +47,11 @@
4747
set -u
4848

4949
H=$(hostname -s)
50-
OUT_DIR="${OUT_DIR:-/shared/$USER/microbench-node-health}"
50+
OUT_DIR="${OUT_DIR:-${AI4S_SHARED_DIR:-/tmp}/microbench-node-health}"
5151
HOST_OUT="$OUT_DIR/$H"
5252
mkdir -p "$HOST_OUT"
5353

54-
AI4S_SHARED_DIR="${AI4S_SHARED_DIR:-/shared/$USER}"
54+
AI4S_SHARED_DIR="${AI4S_SHARED_DIR:-/tmp}" # set AI4S_SHARED_DIR to your cluster's shared storage root
5555
HG_SIF="${HG_SIF:-${AI4S_SHARED_DIR}/images/pytorch_rocm7.2.2_ubuntu24.04_py3.12_pytorch_release_2.10.0.sif}"
5656
STREAM_THRESHOLD_COPY_GBPS="${STREAM_THRESHOLD_COPY_GBPS:-200}"
5757
STREAM_THRESHOLD_TRIAD_GBPS="${STREAM_THRESHOLD_TRIAD_GBPS:-200}"

material_science/models/HydraGNN/examples/run_optimizer_loop.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# n_iters_budget Max iterations (recommend 5).
1818
#
1919
# Abort:
20-
# Graceful: touch /shared/aaji/models/HydraGNN/perf-runs/loop-<uuid>/STOP
20+
# Graceful: touch $AI4S_SHARED_DIR/models/HydraGNN/perf-runs/loop-<uuid>/STOP
2121
# Emergency: scancel <jobid> + tmux kill-session -t hg-loop
2222

2323
set -euo pipefail
@@ -44,7 +44,7 @@ RECIPE_DIR="${REPO_ROOT}/material_science/models/HydraGNN/recipes/perf-optimizer
4444
ORCH_PROMPT="${RECIPE_DIR}/agents/orchestrator.md"
4545

4646
# Loop-dir convention matches recipes/perf-optimizer-loop/README.md
47-
AI4S_SHARED_DIR="${AI4S_SHARED_DIR:-/shared/aaji}"
47+
: "${AI4S_SHARED_DIR:?AI4S_SHARED_DIR must be set (e.g. export AI4S_SHARED_DIR=/shared/\$USER)}"
4848
HG_BASE="${AI4S_SHARED_DIR}/models/HydraGNN"
4949
PERF_RUNS_DIR="${HG_BASE}/perf-runs"
5050
LOOP_DIR="${PERF_RUNS_DIR}/loop-${LOOP_UUID}"
@@ -72,10 +72,10 @@ PREFLIGHT_NOTES=()
7272

7373
# 1. cluster up
7474
if command -v sinfo > /dev/null 2>&1; then
75-
_IDLE_OR_MIX=$(sinfo -p lux,rad -h -o '%t' 2>/dev/null | grep -cE '^(idle|mix|alloc)$' || true)
75+
_IDLE_OR_MIX=$(sinfo -h -o '%t' 2>/dev/null | grep -cE '^(idle|mix|alloc)$' || true)
7676
if [[ "${_IDLE_OR_MIX:-0}" -eq 0 ]]; then
7777
PREFLIGHT_FAIL_REASON="cluster_down"
78-
PREFLIGHT_NOTES+=("sinfo reports 0 usable nodes on partitions lux,rad")
78+
PREFLIGHT_NOTES+=("sinfo reports 0 usable nodes — check partition names in .cluster-config.yaml")
7979
fi
8080
else
8181
PREFLIGHT_FAIL_REASON="no_slurm"
@@ -93,8 +93,8 @@ fi
9393

9494
# 3. tools present
9595
for _bin in \
96-
/shared/aaji/tools/omnistat-pr271/bin/omnistat-usermode \
97-
/shared/aaji/tools/victoriametrics/victoria-metrics-prod; do
96+
"${AI4S_SHARED_DIR}/tools/omnistat-pr271/bin/omnistat-usermode" \
97+
"${AI4S_SHARED_DIR}/tools/victoriametrics/victoria-metrics-prod"; do
9898
if [[ -z "$PREFLIGHT_FAIL_REASON" && ! -x "$_bin" ]]; then
9999
PREFLIGHT_FAIL_REASON="tool_missing"
100100
PREFLIGHT_NOTES+=("missing: $_bin (run the perf-analysis launcher subagent first to install)")
@@ -104,7 +104,7 @@ done
104104
# 4. SIF + overlay
105105
for _f in \
106106
"${HG_BASE}/overlays/hydragnn-overlay.img" \
107-
"${AI4S_SHARED_DIR}/images/pytorch_rocm7.2.2_ubuntu24.04_py3.12_pytorch_release_2.10.0.sif"; do
107+
"${AI4S_SHARED_DIR}/images/pytorch_rocm7.2.2_ubuntu24.04_py3.12_pytorch_release_2.10.0.sif"; do # set AI4S_SHARED_DIR to your cluster's shared storage root
108108
if [[ -z "$PREFLIGHT_FAIL_REASON" && ! -f "$_f" ]]; then
109109
PREFLIGHT_FAIL_REASON="image_missing"
110110
PREFLIGHT_NOTES+=("missing: $_f")
@@ -151,7 +151,7 @@ if [[ -n "$PREFLIGHT_FAIL_REASON" ]]; then
151151
fi
152152

153153
_DISK_FREE=$(df -h "$PERF_RUNS_DIR" | awk 'NR==2 {print $4}')
154-
_log_status "PREFLIGHT_OK cluster=lux disk_free=${_DISK_FREE} claude_cli=ok api_egress=ok orch_prompt=ok"
154+
_log_status "PREFLIGHT_OK disk_free=${_DISK_FREE} claude_cli=ok api_egress=ok orch_prompt=ok"
155155

156156
if [[ $PREFLIGHT_ONLY -eq 1 ]]; then
157157
_log_status "PREFLIGHT_ONLY mode: exiting before invoking orchestrator"

material_science/models/HydraGNN/examples/sbatch_train_perf_amd.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@
88
# 1. Wraps srun with omnistat-usermode --start/--stopexporters/--stopserver.
99
# 2. Generates a per-job copy of gfm_mlip.json with a "Profile" block injected
1010
# so HydraGNN's built-in torch.profiler captures rank-0 of node-0 only.
11-
# 3. Hard-codes the lux partition / vultr_lux account so this script works
12-
# out-of-the-box on Lux. Override via SBATCH_PARTITION/SBATCH_ACCOUNT if
13-
# submitting to a different cluster.
11+
# 3. Defaults to a cluster partition/account that can be overridden via
12+
# SBATCH_PARTITION/SBATCH_ACCOUNT env vars for your cluster.
1413
# 4. Defaults are tuned for a quick perf run: --nodes=2, NUM_EPOCH=2,
1514
# MAX_NUM_BATCH=30, time=00:30:00 — enough for the wait=5/warmup=3/active=3
1615
# profiler schedule plus a clean epoch 0 for warm caches.
1716
#
1817
# Quick start:
19-
# export AI4S_SHARED_DIR=/shared/aaji
18+
# export AI4S_SHARED_DIR=/shared/$USER
2019
# sbatch material_science/models/HydraGNN/examples/sbatch_train_perf_amd.sh
2120
#
2221
# Required:
2322
# AI4S_SHARED_DIR — shared base path
24-
# /shared/aaji/tools/omnistat-pr271/ (created by the launcher subagent)
25-
# /shared/aaji/tools/victoriametrics/ (created by the launcher subagent)
23+
# $AI4S_SHARED_DIR/tools/omnistat-pr271/ (created by the launcher subagent)
24+
# $AI4S_SHARED_DIR/tools/victoriametrics/ (created by the launcher subagent)
2625
#
2726
# Optional env-var overrides (with defaults):
2827
# HG_NUM_EPOCH=2
@@ -33,8 +32,8 @@
3332
# OMNISTAT_USERMODE_INTERVAL=1 # seconds
3433

3534
#SBATCH --job-name=hydragnn-perf
36-
#SBATCH --partition=lux
37-
#SBATCH --account=vultr_lux
35+
#SBATCH --partition=gpu
36+
#SBATCH --account=default
3837
#SBATCH --nodes=2
3938
#SBATCH --ntasks-per-node=8
4039
#SBATCH --gpus-per-node=8
@@ -71,7 +70,7 @@ HG_REPO_DIR="${HG_REPO_DIR:-${HG_BASE}/code/HydraGNN}"
7170
HYDRAGNN_MAX_NUM_BATCH="${HYDRAGNN_MAX_NUM_BATCH:-30}"
7271
PROFILE_TARGET_EPOCH="${PROFILE_TARGET_EPOCH:-1}"
7372

74-
OMNISTAT_VENV="${OMNISTAT_VENV:-/shared/aaji/tools/omnistat-pr271}"
73+
OMNISTAT_VENV="${OMNISTAT_VENV:-${AI4S_SHARED_DIR}/tools/omnistat-pr271}"
7574
# Read the omnistat config from the in-repo recipe (single source of truth).
7675
# Override with OMNISTAT_TEMPLATE=/path/to/file if you need a custom probe config.
7776
# A staged copy under ${HG_BASE}/perf-runs/ is intentionally NOT used as the
@@ -87,7 +86,7 @@ OMNISTAT_USERMODE_INTERVAL="${OMNISTAT_USERMODE_INTERVAL:-1}"
8786
# See material_science/models/HydraGNN/recipes/perf-analysis/agents/launcher.md
8887
# for how to build libomnistat_trace.so on a compute node.
8988
OMNISTAT_KERNEL_TRACE="${OMNISTAT_KERNEL_TRACE:-0}"
90-
OMNISTAT_TRACE_LIB="${OMNISTAT_TRACE_LIB:-/shared/aaji/tools/omnistat-src/build-trace/libomnistat_trace.so}"
89+
OMNISTAT_TRACE_LIB="${OMNISTAT_TRACE_LIB:-${AI4S_SHARED_DIR}/tools/omnistat-src/build-trace/libomnistat_trace.so}"
9190
# IMPORTANT: the kernel-trace collector registers /kernel_trace on the SAME
9291
# Flask app as the other omnistat endpoints, so the tool library must POST to
9392
# the [omnistat.collectors] `port` (8101 here), NOT the library's own default
@@ -173,9 +172,9 @@ if [[ "$OMNISTAT_KERNEL_TRACE" == "1" ]]; then
173172
echo "ERROR: OMNISTAT_KERNEL_TRACE=1 but tool library not found:" >&2
174173
echo " $OMNISTAT_TRACE_LIB" >&2
175174
echo " Build it on a compute node:" >&2
176-
echo " salloc -p lux -A vultr_lux -N 1 --time=00:15:00 --gpus-per-node=1 \\" >&2
175+
echo " salloc -p <partition> -A <account> -N 1 --time=00:15:00 --gpus-per-node=1 \\" >&2
177176
echo " apptainer exec --rocm \"\$HG_SIF\" bash -c '" >&2
178-
echo " cd /shared/aaji/tools/omnistat-src && \\" >&2
177+
echo " cd \$AI4S_SHARED_DIR/tools/omnistat-src && \\" >&2
179178
echo " cmake -S rocprofiler-sdk/ -B build-trace/ -DBUILD_KERNEL_TRACE_LIB=ON && \\" >&2
180179
echo " cmake --build build-trace/ -j 8'" >&2
181180
exit 2

material_science/models/HydraGNN/recipes/perf-optimizer-loop/HANDOFF.md

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)