CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / evidence / amd-speed-20261114 / raw / amd-launch-gap / card / final / logs / gap-run.sh
| 1 | #!/bin/sh |
| 2 | # Launch-gap card run: published launcher (plan), new launcher (plan2) and HIP graph replay of the same |
| 3 | # 18 kernels, interleaved in one session; then attribution arms and the altered-weights controls. |
| 4 | G=/workspace/gap |
| 5 | L=$G/logs |
| 6 | mkdir -p $L |
| 7 | exec > $G/run.log 2>&1 |
| 8 | set -x |
| 9 | while ! grep -q PRE_DONE $G/pre.log; do sleep 5; done |
| 10 | grep -q 'PREPARE_RC=0' $G/pre.log || { echo PREPARE_FAILED; exit 1; } |
| 11 | while ! test -f $G/bin-upload.json; do sleep 5; done |
| 12 | sha256sum $G/bin-old/omega-launch $G/bin-new/omega-launch |
| 13 | echo "08a504911ec6e87a9746632a14d22245155597e3a8ed384c93c0e5260bb691e1 $G/bin-old/omega-launch" | sha256sum -c || exit 1 |
| 14 | echo "78e09581723d88f596d7bcf17ad43e6f6b64297ff749314fc4249f75f75fe686 $G/bin-new/omega-launch" | sha256sum -c || exit 1 |
| 15 | { date -u +%FT%TZ; uname -a; cat /opt/rocm/.info/version; rocminfo 2>/dev/null | grep -E 'Marketing Name|Name: +gfx' | head -6; |
| 16 | for n in /sys/class/kfd/kfd/topology/nodes/*; do echo "node $n gpu_id $(cat $n/gpu_id 2>&1)"; grep -E 'gfx_target_version|num_xcc|simd_count|drm_render_minor' $n/properties 2>&1; done; |
| 17 | python3 -c 'import torch;print("torch",torch.__version__,torch.version.hip)'; nproc; grep -m1 'model name' /proc/cpuinfo; } > $L/card.txt 2>&1 |
| 18 | cd $G/CUDApp/evidence/amd-qwen38-native-20261113 |
| 19 | export AMDSERVE_WEIGHTS=/tmp/qwen3.8-27b-fp8 |
| 20 | mkdir -p out |
| 21 | python3 oracle/emit-plan.py oracle/driver-real2.py "$AMDSERVE_WEIGHTS" out/real2.plan --capacity=131072 --fixture-json=oracle/lighthouse256.json; echo "EMIT_RC=$?" |
| 22 | python3 oracle/check-plan.py out/real2.plan "$AMDSERVE_WEIGHTS"; echo "CHECK_RC=$?" |
| 23 | python3 oracle/emit-plan.py oracle/driver-real2.py "$AMDSERVE_WEIGHTS" out/real2-controls.plan --controls --capacity=131072 --fixture-json=oracle/lighthouse256.json; echo "EMITC_RC=$?" |
| 24 | python3 oracle/check-plan.py out/real2-controls.plan "$AMDSERVE_WEIGHTS"; echo "CHECKC_RC=$?" |
| 25 | sha256sum out/real2.plan out/real2-controls.plan out/code/*.hsaco > $L/plan-and-code.sha256 |
| 26 | cat $L/plan-and-code.sha256 |
| 27 | cd out |
| 28 | for mode in plan plan2 planscope planstage; do |
| 29 | sed "s/^omega-launch plan /omega-launch $mode /" real2.plan.cmd > cmd-$mode.sh |
| 30 | sed "s/^omega-launch plan /omega-launch $mode /" real2-controls.plan.cmd > cmdc-$mode.sh |
| 31 | done |
| 32 | cp real2.plan.cmd real2-controls.plan.cmd cmd-*.sh cmdc-*.sh $L/ |
| 33 | omega() { # LABEL BINDIR CMDFILE |
| 34 | echo "$1 start $(date -u +%FT%T.%NZ)" |
| 35 | PATH="$2:$PATH" sh "$3" > $L/omega-$1.txt 2> $L/omega-$1.err; echo "$1 rc=$?" |
| 36 | echo "$1 end $(date -u +%FT%T.%NZ)"; grep -c OMEGA_STEP $L/omega-$1.txt |
| 37 | } |
| 38 | hip() { # LABEL |
| 39 | echo "$1 start $(date -u +%FT%T.%NZ)" |
| 40 | (cd .. && python3 $G/gap-hip.py oracle/driver-real2.py "$AMDSERVE_WEIGHTS" oracle/lighthouse256.json $L/hip-$1.json 131072 > $L/hip-$1.txt 2>&1); echo "$1 rc=$?" |
| 41 | echo "$1 end $(date -u +%FT%T.%NZ)"; tail -1 $L/hip-$1.txt | cut -c1-400 |
| 42 | } |
| 43 | for r in warmup run1 run2 run3 run4 run5; do |
| 44 | omega old-plan-$r $G/bin-old cmd-plan.sh |
| 45 | omega new-plan2-$r $G/bin-new cmd-plan2.sh |
| 46 | hip graph-$r |
| 47 | echo "ROUND_DONE $r" |
| 48 | done |
| 49 | omega control-old-plan $G/bin-old cmdc-plan.sh |
| 50 | omega control-new-plan2 $G/bin-new cmdc-plan2.sh |
| 51 | echo MAIN_DONE |
| 52 | for r in run1 run2; do |
| 53 | omega new-planscope-$r $G/bin-new cmd-planscope.sh |
| 54 | omega new-planstage-$r $G/bin-new cmd-planstage.sh |
| 55 | omega new-plan-$r $G/bin-new cmd-plan.sh |
| 56 | done |
| 57 | echo ATTRIBUTION_DONE |
| 58 | cd $G |
| 59 | python3 gap-verdict.py $L published-ids.json > $L/verdict.txt 2>&1; echo "VERDICT_RC=$?" |
| 60 | cat $L/verdict.txt |
| 61 | cp pre.log run.log gap-*.sh gap-*.py published-ids.json $L/ 2>/dev/null |
| 62 | cd $L && sha256sum $(ls | grep -v SHA256SUMS) > SHA256SUMS |
| 63 | cd $G && tar czf gap-evidence.tar.gz logs && sha256sum gap-evidence.tar.gz > gap-evidence.tar.gz.sha256 |
| 64 | cat gap-evidence.tar.gz.sha256 |
| 65 | echo RUN_DONE |