powergrid/ai/strong/launch-multiplayer-teacher.sh

22 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
players=${1:?Specify player count 2–6}
[[ "$players" =~ ^[2-6]$ ]]
shard=$((players - 2))
[[ "$shard" =~ ^[0-9]+$ ]]
hf jobs run --detach --flavor cpu-performance --timeout 3h \
--secrets HF_TOKEN \
--env HF_DATA_REPO=coyotte508/powergrid-ai-training-v1 \
--env SHARD="$shard" --env GAMES=240 --env DATA_WORKERS=24 --env SEARCH_SAMPLES=16 --env GEOGRAPHY=1 --env FEATURE_REVISION=4.0-multiplayer --env PLAYER_COUNT="$players" --env DATA_VERSION=multiplayer-teacher-v1 --env INCLUDE_ALL_PHASES=1 \
--label project=powergrid-ai --label stage="multiplayer-teacher-v1-$shard" \
-- pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime bash -lc '
set -euo pipefail
python -m pip install --quiet --timeout 120 --retries 5 huggingface_hub==2.0.0
mkdir -p /workspace
python -c "import urllib.request,tarfile; urllib.request.urlretrieve(\"https://nodejs.org/dist/v24.14.0/node-v24.14.0-linux-x64.tar.xz\",\"/tmp/node.tar.xz\");tarfile.open(\"/tmp/node.tar.xz\").extractall(\"/opt\")"
export PATH=/opt/node-v24.14.0-linux-x64/bin:$PATH
python -c "from huggingface_hub import hf_hub_download;import tarfile;p=hf_hub_download(\"coyotte508/powergrid-ai-training-v1\",\"strong-source-v17.tgz\",repo_type=\"dataset\",revision=\"36c3d6b2f8545bd3551fc571a8cb6cb45a8f88b1\");tarfile.open(p).extractall(\"/workspace\")"
cd /workspace
node --test ai/test.cjs ai/strong/test.cjs
python -u ai/strong/generate-search-data.py
'