#!/usr/bin/env bash
set -euo pipefail
cd /srv/home/gc-sdk/ipu-stack
rg -q 'hardwareTest=PASS' artifacts/search-state-20260912/bs1/continued/run.log
cp artifacts/search-state-20260912/bs1/state.json artifacts/search-state-20260912/bs1/attempt24-state.json
source .env
RAYON_NUM_THREADS=24 RUST_LOG=info artifacts/search-state-20260912/ipu-trivial-test "$IPU_CONFIG" --sdk "$POPLAR_SDK_ENABLED" --runtime-source device/static_runtime.S --workload siglip-vit-benchmark --vit-layers 27 --vit-batch 1 --fuse-qkv --fp8-scale=-4 --optimization-steps 64 --load-search-state artifacts/search-state-20260912/bs1/state.json --save-search-state artifacts/search-state-20260912/bs1/state.json --exchange-stream-words 1024 --no-profile --reference-run --reference-fp32 --reference-inferences 2 --device-lock artifacts/layout-sweep/device.lock --memory-profile-directory artifacts/search-state-20260912/bs1/extended/memory --save-reference-inputs artifacts/search-state-20260912/bs1/extended/resident --package artifacts/search-state-20260912/bs1/extended/model.ipuexe > artifacts/search-state-20260912/bs1/extended/run.log 2>&1
RUST_LOG=warn target/release/ipu-host-exchange-bench artifacts/search-state-20260912/bs1/extended/model.ipuexe "$IPU_CONFIG" --data artifacts/search-state-20260912/bs1/extended/resident --sdk "$POPLAR_SDK_ENABLED" --device-lock artifacts/layout-sweep/device.lock --poll-us 0 > artifacts/search-state-20260912/bs1/extended/busy.log 2>&1
