This project keeps the Experiment 1 assets (models + datasets) in sync with the preregistered grid described in experiment1/experiment1overview.md. Follow the steps below whenever you need to refresh the environment or verify that downloads completed successfully.
- Create or reuse a Hugging Face token with read access to gated repos (https://huggingface.co/settings/tokens).
- Request access to
meta-llama/Llama-3.2-1Band any other gated models well in advance—thescripts/download_assets.pycommand will warn if the token is missing approvals. - Run the CLI login once per machine (token is stored under
~/.cache/huggingface):
. .venv/bin/activate
huggingface-cli login --token <hf_xxx> --add-to-git-credentialThe download script automatically reuses this credential, so you do not need to export extra environment variables afterwards.
cd "Kernel PE"
./scripts/setup_env.shThis creates .venv/, upgrades pip, installs the repository in editable mode, and ensures a consistent Python toolchain for all experiment stages.
Use the orchestrator to pull every asset defined in experiment1/config.py:
. .venv/bin/activate
python scripts/download_assets.pyUseful flags:
--models-onlyor--datasets-only– limit the run to one asset type.--names gpt2-small wiki40b_en_pre2019– download a specific subset.--force– redownload even if sentinel files exist (useful after pruning caches).
Snapshot-backed datasets (e.g., CodeSearchNet parquet shards) are placed under data/snapshots/<dataset>/; Hugging Face streaming datasets are cached under data/hf_cache/<dataset>/. Each directory contains a .download_complete JSON with the exact config and patterns that were fetched, making it easy to audit what is on disk.
After running python experiment1/run.py tokenize ..., validate that every (model, dataset, length) combination produced the preregistered 200 sequences (100 centering + 100 eval for natural corpora, 200 eval for synthetic):
python scripts/check_tokenized_manifest.py --model gpt2-small --dataset wiki40b_en_pre2019 --seq-len 256The script scans data/experiment1/**/len_*.manifest.json and fails loudly if any counts drift from the preregistered split.
Run the commands below to confirm that downloads, tokenization, and the Track A/B/Spectral pipelines remain aligned with experiment1overview.md.
- Environment smoke test
./scripts/setup_env.sh . .venv/bin/activate python - <<'PY' import pandas, pyarrow print("parquet deps ok") PY
- Regenerate every
(model, dataset, length)splitpython experiment1/run.py tokenize --model all --dataset all --seq-len all --cleanup-legacy python scripts/check_tokenized_manifest.py
- Track A spot runs
CUDA_VISIBLE_DEVICES=3 python experiment1/run.py \ track-a --model gpt2-small --dataset wiki40b_en_pre2019 --seq-len 256 --device cuda CUDA_VISIBLE_DEVICES=3 python experiment1/run.py \ track-a --model olmo-1b --dataset wiki40b_en_pre2019 --seq-len 1024 --device cuda CUDA_VISIBLE_DEVICES=3 python experiment1/run.py \ track-a --model tinyllama-nope-1.1b --dataset synthetic_random --seq-len 1024 --device cuda
- Track B + Spectral probes
CUDA_VISIBLE_DEVICES=3 python experiment1/run.py \ track-b --model gpt2-small --dataset wiki40b_en_pre2019 --seq-len 256 --device cuda python experiment1/run.py spectral --model tinyllama-nope-1.1b --dataset synthetic_random --seq-len 256
Questions or conflicts between the code and experiment1overview.md should be raised immediately before collecting data. The tooling above is designed to surface these mismatches early so the full Track A/B pipelines only run on compliant assets.