#!/bin/bash # Tokenize FineWeb with the pre-trained 16K BPE tokenizer. # The tokenizer model is committed to the repo; this script only needs to # download the raw docs and tokenize them into binary shards. # Run from experiments/quintary/ on the pod. set -e # Ensure conda env is active source ~/miniconda3/etc/profile.d/conda.sh 2>/dev/null || true conda activate golf 2>/dev/null || true echo "=== Building 16K dataset (reusing pre-trained tokenizer) ===" echo "" # Clone upstream if not present (gitignored in our repo) UPSTREAM_DIR="../../upstream" if [ ! -d "$UPSTREAM_DIR/data" ]; then echo "Cloning openai/parameter-golf..." git clone --depth 1 https://github.com/openai/parameter-golf.git "$UPSTREAM_DIR" fi # Reuse the committed tokenizer model — skips SentencePiece training python3 "$UPSTREAM_DIR/data/download_hf_docs_and_tokenize.py" \ --tokenizer-config ./tokenizer_specs_16k.json \ --output-root ./data \ --skip-byte \ --reuse-sp-model 16384=./fineweb_16384_bpe.model echo "" echo "=== Done ===" echo "Tokenizer: ./data/tokenizers/fineweb_16384_bpe.model" echo "Dataset: ./data/datasets/fineweb10B_sp16384/" echo "" echo "Run training with:" echo " VOCAB_SIZE=16384 TOKENIZER_PATH=./data/tokenizers/fineweb_16384_bpe.model \\" echo " DATA_PATH=./data/datasets/fineweb10B_sp16384 \\" echo " bash run_cuda_quintary.sh"