interplane.Get Omega
Read in your language

omega-helix

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-helix / scripts / train-gb10-bf16.sh

61 lines · 1894 bytes Raw Blame History
1#!/bin/sh
2# Reproduce the DGX Spark (NVIDIA GB10, sm_121) 85k tok/s BF16 (or 68k tok/s FP32)
3# 15.8M v2 training configuration:
4# V=4096, T=256, D=384, H=12, F=1536, L=8, B=64 (16,384 tokens/step, P=15,833,472)
5#
6# Usage:
7# sh scripts/train-gb10-bf16.sh <train.tok> [held.tok] [merges4096.bin]
8#
9# Env:
10# MODE bf16 (default, gtrainb ~85k tok/s) or fp32 (gtrainf ~68k tok/s)
11# STEPS total training steps (default: 30000; Rung 10 used 60000)
12# EVERY checkpoint/log interval in steps (default: 250)
13# LOOP set to 1 to initialize a looped-core OLLMCK03 checkpoint (LP=2, LC=4, NP=3 -> 16 apps)
14# RUNDIR output directory for checkpoints & logs (default: ./run-gb10)
15set -eu
16
17if [ $# -lt 1 ]; then
18 echo "usage: $0 <train.tok> [held.tok] [merges4096.bin]" >&2
19 exit 2
20fi
21
22here=$(cd "$(dirname "$0")/.." && pwd)
23TRAIN_TOK=$1
24HELD_TOK=${2:-}
25MERGES=${3:-}
26MODE=${MODE:-bf16}
27STEPS=${STEPS:-30000}
28EVERY=${EVERY:-250}
29LOOP=${LOOP:-0}
30RUNDIR=${RUNDIR:-$here/run-gb10}
31
32BIN=$here/build/ollm-gb10
33[ -x "$BIN" ] || TARGET=gb10 sh "$here/scripts/build.sh"
34
35mkdir -p "$RUNDIR"
36CK=$RUNDIR/ck.bin
37
38if [ ! -f "$CK" ]; then
39 if [ "$LOOP" = 1 ]; then
40 echo "Initializing 15.8M looped-core OLLMCK03 checkpoint (LP=2, LC=4, NP=3 -> 16 layer apps)..."
41 "$BIN" init "$CK" 4096 256 384 12 1536 8 64 1 "$STEPS" 3000 16 2 4 3
42 else
43 echo "Initializing 15.8M v2 checkpoint (V=4096 T=256 D=384 H=12 F=1536 L=8 B=64)..."
44 "$BIN" init "$CK" 4096 256 384 12 1536 8 64 1 "$STEPS" 3000 16
45 fi
46fi
47
48CMD=gtrainb
49[ "$MODE" = fp32 ] && CMD=gtrainf
50
51echo "Starting GB10 $CMD ($MODE) for $STEPS steps (16,384 tok/step)..."
52"$BIN" "$CMD" "$CK" "$TRAIN_TOK" "$STEPS" "$EVERY"
53
54if [ -n "$HELD_TOK" ]; then
55 echo "Running on-chip held-out evaluation (geval)..."
56 if [ -n "$MERGES" ]; then
57 "$BIN" geval "$CK" "$HELD_TOK" 2243 "$MERGES"
58 else
59 "$BIN" geval "$CK" "$HELD_TOK" 2243
60 fi
61fi