TASK - Training (PCMA Stage 1 + Stage 2)
Objective: produce checkpoints/stage1/ and checkpoints/stage2/ (or checkpoints/final/) from the paper's PCMA curriculum. Code: training/, configs: configs/, entry: scripts/train_stage*.sh.
Prerequisites
- Env ready:
bash scripts/setup.sh && bash scripts/verify_environment.sh - Weights cached:
bash scripts/download_models.sh(~1.6GB, foundation only - no official Earth-OneVision weights exist,docs/assumptions.md#A11) - India/full manifests built (see data-subset runbook): one JSONL per stage
- Disk: checkpoints are full state dicts +
optimizer.pt/scheduler.ptevery 500 steps (training/trainer.py) - keep 50GB+ free
Config (do not edit code for these)
| Knob | Stage 1 file | Stage 2 file | Paper value |
|---|---|---|---|
| LR | configs/stage1.yaml (2e-5) | configs/stage2.yaml (5e-6) | explicit |
| Epochs | 4 | 4 | explicit |
| Batch/GPU, grad-accum | batch_size_per_gpu, gradient_accumulation_steps | same | eff. batch 32 on 8×H100; single-device uses accum as stand-in |
| Seq len, opt, sched | configs/base.yaml (5400, AdamW wd=0.05, cosine warmup 0.03) | - | explicit |
Steps
- Build + validate manifests:
python tools/convert_dataset.py --dataset cdvqa --split train
python tools/validate_dataset.py --manifest data/manifests/cdvqa/train.jsonl --intended-use train
cat data/manifests/*/train.jsonl > data/manifests/stage1_train.jsonl # train.py takes ONE manifest
- Dry-run the loop (minutes, catches 90% of failures):
bash scripts/smoke_test.sh- all 12 steps must pass. - Stage 1 (Apple Silicon):
MANIFEST=data/manifests/stage1_train.jsonl IMAGES_ROOT=data/converted bash scripts/train_stage1.sh
- Stage 2 (same, with optical replay baked into its manifest):
bash scripts/train_stage2.sh - CUDA multi-GPU instead:
deepspeed --num_gpus=8 training/train.py --config configs/stage1.yaml \
--deepspeed configs/deepspeed_zero2.json \
--manifest data/manifests/stage1_train.jsonl --images_root data/converted
Done criteria
-
checkpoints/stage{1,2}/final/containmodel.pt,tokenizer/, andearth_onevision_metadata.json(training/checkpointing.py) - Loss decreases across epochs; no
NotImplementedErrorfrom MPS (vision tower stays on CPU by design,docs/assumptions.md#A13) - Checkpoint reloads:
load_checkpointrefuses anything not labeledearth_onevision_reproduction_checkpoint- expected
Debug
| Symptom | Cause → fix |
|---|---|
| OOM on MPS | lower batch_size_per_gpu to 1, raise gradient_accumulation_steps; reduce vision.max_patches in configs/base.yaml |
aten::_upsample_bilinear2d_aa NotImplementedError | vision tower must stay CPU-pinned (model/earth_onevision.py:to) - don't "fix" by moving it to MPS |
GQA mps_matmul crash in generate | attn_implementation: eager on MPS is the workaround, not a bug |
| Train manifest rejected | run tools/validate_dataset.py --intended-use train - test/val leakage fails the build by design |