Slayer1B-1.09-Instruct-26.11: weights, card, notes, training code, manifests and results (history squashed; training data not published)
6071ec5 Download training/code/vast_run.sh from SlayerLab/Slayer1B-1.09-Instruct-26.11: direct link, hf CLI and curl.
- Browser
- Download file 3.42 kB
-
https://huggingface.co/SlayerLab/Slayer1B-1.09-Instruct-26.11/resolve/main/training/code/vast_run.sh
- Command line
-
hf download hf://SlayerLab/Slayer1B-1.09-Instruct-26.11/training/code/vast_run.sh
-
curl -L -o vast_run.sh https://huggingface.co/SlayerLab/Slayer1B-1.09-Instruct-26.11/resolve/main/training/code/vast_run.sh
3.42 kB
| # Slayer1B SFT on a vast.ai box (tested target: 8 x RTX 4090, CUDA 12.x image with Python >= 3.11). | |
| # 1) copy this directory + data/<name>/ to /workspace/slayer1b (rsync/scp from the workstation) | |
| # 2) bash vast_run.sh setup # deps, base checkpoint (SHA-256 checked), trainer code, tokenizer | |
| # 3) bash vast_run.sh baseline # 0/1 evals of the base model (sharded over GPUs) | |
| # 4) bash vast_run.sh train s1 # torchrun on all GPUs | |
| # 5) bash vast_run.sh eval runs/s1/sft_stepN.pt | |
| set -euo pipefail | |
| cd "$(dirname "$0")" | |
| [ -f /venv/main/bin/activate ] && source /venv/main/bin/activate | |
| DATA=${DATA:-data/s1_toolcall} | |
| CK=${CK:-/workspace/ckpt} | |
| NG=$(nvidia-smi -L | wc -l) | |
| BASE_SHA=ad675d0cd61b2291b4cfbfd93c8a5d28217a12498fef7c7f997728911ddb952b # wagi_95000.pt (SHA256SUMS of the archive) | |
| ARCHIVE_REV=d117d69e9f1dc8c72d15d43f06783c83b17c6f7b | |
| MODEL_REV=03746aeb917bae8298edf34516aa303e3a3e2182 | |
| export SLAYER_TRAINER=$CK/train_gpt_ref_r24_2.py SLAYER_TOKENIZER=$CK/tokenizer.json | |
| evalall() { # $1 ckpt, $2 out prefix | |
| for r in $(seq 0 $((NG-1))); do | |
| CUDA_VISIBLE_DEVICES=$r python evals.py --ckpt "$1" --data "$DATA" --tokenizer "$SLAYER_TOKENIZER" --rank $r --world $NG --out "$2.r$r.json" & | |
| done; wait | |
| python - "$2" "$NG" <<'PY' | |
| import json, sys | |
| pre, n = sys.argv[1], int(sys.argv[2]) | |
| parts = [json.load(open(f"{pre}.r{r}.json")) for r in range(n)] | |
| res = {k: sum((p["results"].get(k, []) for p in parts), []) for k in parts[0]["results"]} | |
| def m(rows, k="ok"): return round(sum(bool(x.get(k)) for x in rows) / len(rows), 4) if rows else None | |
| out = {"chat_format_ok": m(res.get("chat_format", [])), "tool_replay_ok": m(res.get("tool_replay", [])), | |
| "loop_end_to_end": m([x for x in res.get("loop", []) if x["kind"] != "no_tool"]), | |
| "loop_forced_end_to_end": m([x for x in res.get("loop_forced", []) if x["kind"] != "no_tool"]), | |
| "loop_no_tool_correct": m([x for x in res.get("loop", []) if x["kind"] == "no_tool"]), | |
| "n": {k: len(v) for k, v in res.items()}} | |
| json.dump({"summary": out, "results": res}, open(f"{pre}.json", "w"), indent=1, ensure_ascii=False) | |
| print(json.dumps(out, indent=1)) | |
| PY | |
| } | |
| case "${1:-}" in | |
| setup) | |
| uv pip install -q numpy tokenizers huggingface_hub pyarrow pyyaml # torch comes with the image venv | |
| mkdir -p "$CK" | |
| python - <<PY | |
| from huggingface_hub import hf_hub_download | |
| import hashlib, shutil | |
| p = hf_hub_download("SlayerLab/Slayer1B-1.09-checkpoints", "wagi_95000.pt", revision="$ARCHIVE_REV", local_dir="$CK") | |
| h = hashlib.sha256(open(p, "rb").read()).hexdigest(); assert h == "$BASE_SHA", h | |
| for f in ["train_gpt_ref_r24_2.py", "tutorials/runtime/tokenizer.json"]: | |
| q = hf_hub_download("SlayerLab/Slayer1B-1.09", f, revision="$MODEL_REV", local_dir="$CK") | |
| dst = "$CK/" + f.split("/")[-1] | |
| import os | |
| if os.path.abspath(q) != os.path.abspath(dst): | |
| shutil.copy(q, dst) | |
| print("setup ok") | |
| PY | |
| ;; | |
| baseline) evalall "$CK/wagi_95000.pt" results/base_95000 ;; | |
| train) | |
| name=${2:-s1} | |
| torchrun --nproc_per_node "$NG" train.py --ckpt "$CK/wagi_95000.pt" --ckpt-sha256 $BASE_SHA --data "$DATA" --out "runs/$name" \ | |
| --lr ${LR:-2e-5} --epochs ${EPOCHS:-1} --mb-tokens ${MBT:-16384} --accum ${ACCUM:-2} --eval-every 200 --save-every ${SAVE:-1000} ;; | |
| eval) evalall "$2" "results/$(basename "$2" .pt)" ;; | |
| *) echo "usage: $0 setup|baseline|train [name]|eval ckpt"; exit 1 ;; | |
| esac | |