Status:
smoke/debugfor the local and 1-GPU paths. Intended use: validate the Tau -> Kueue -> Ray path end to end with a real PyTorch training script, then scale the same script up behind your owntau.yaml. Not for: treating the synthetic fallback or inline FineWeb tokenization as production data prep.
This example turns a GPT-2-shaped causal LM run into a Tau-shaped PyTorch Ray
workload. It ships the training script and a result verifier; you supply a
tau.yaml describing the queue, storage, and compute shape for your cluster.
train.py— self-contained PyTorch causal LM training script using RayTorchTrainer.verify_result.py— checks metrics/history for CUDA, FineWeb source, loss decrease, and parameter count.
At runtime the script searches for FineWeb token shards under:
/data/datasets/fineweb/**/*.bin/data/datasets/fineweb/**/*.npy/data/datasets/fineweb/**/*.pt/data/datasets/fineweb/**/*.txt
Binary .bin shards are read as uint16 token ids, matching the common
llm.c/nanoGPT data shape. If no FineWeb shard exists, the script falls back to a
tiny deterministic byte corpus and records "dataset_source": "fallback:synthetic-byte-corpus" in metrics.json. That fallback proves the
Tau path, not a data target.
Setting NANOGPT_PREPARE_FINEWEB=1 lets the script create a GPT-2-tokenized
FineWeb smoke shard before training, on a cluster with egress. Prefer a
pre-tokenized dataset artifact for anything larger than a smoke run: inline
tokenization holds GPUs idle while it downloads and tokenizes. Split
tokenization into a CPU data-prep run and let training consume a pre-tokenized
manifest.
# from the repository root
python3 examples/nanogpt-ray/train.py \
--local-smoke --steps 2 --batch-size 2 --eval-every 1 --eval-batches 1 \
--out-dir /tmp/nanogpt-smokeThis needs no Ray install and no cluster. It writes metrics.json and
stellar/history.jsonl, with dataset_source set to the synthetic fallback.
Write a tau.yaml that points entrypoint at train.py and sets the queue,
storage, and compute shape for your cluster, then:
make install-tau-cli
tau run --config path/to/your/tau.yaml --dry-run=client
tau run --config path/to/your/tau.yamlSee ../ray-tune-smoke/tau.yaml for a minimal
config-first example to copy from, and
docs/tau/tau-run-config.md for
the full schema.
Keep one config per experiment variant rather than adding tau run flags: tau run
stays config-first, and each tau.yaml owns its entrypoint, runtime, storage,
queue, and metrics contract.
The run writes, under /data/checkpoints/workflows/<run>/:
metrics.jsoncheckpoints/last.ptstellar/history.jsonl
Import the Stellar-style history into an expstore:
taugrid-portal experiment import jsonl \
--run nanogpt-fineweb-ray \
--history /path/to/history.jsonl \
--project nanogpt-smoke \
--experiment nanogpt-fineweb \
--group ray-smokeEdit your tau.yaml rather than adding tau run flags:
runtime.env.NANOGPT_STEPSruntime.env.NANOGPT_BATCH_SIZEruntime.env.NANOGPT_BLOCK_SIZEruntime.env.NANOGPT_N_LAYERruntime.env.NANOGPT_N_HEADruntime.env.NANOGPT_N_EMBDruntime.env.NANOGPT_USE_COMPILEruntime.env.NANOGPT_USE_BF16runtime.env.NANOGPT_USE_RMSNORMruntime.env.NANOGPT_ACTIVATIONruntime.env.NANOGPT_COOLDOWN_FRACruntime.env.NANOGPT_STOP_AT_TARGETcompute.workerscompute.gpus_per_workerpolicy.queuestorage.data_pvc
Increase batch/steps only after a smoke run proves queue admission, dataset visibility, output import, and verifier success.
Verify a result bundle:
python3 examples/nanogpt-ray/verify_result.py \
--metrics /path/to/metrics.json \
--history /path/to/history.jsonl \
--require-cuda \
--require-fineweb \
--min-parameters 100000000