Let evaluation run in batches and on a stratified sample
Hussein+1: Claude Opus 5 (1M context)
646b079
Reproducing the Arabic Little STT benchmark means scoring a dozen checkpoints on
the same held-out speakers, and `evaluate` transcribed one clip per forward
pass. The test split is 4,073 utterances; at that rate a single large checkpoint
is most of an hour and the sweep does not fit in a session.
Batch the generate call. Whisper pads every clip to the same 30 s window, so a
batch costs one forward pass rather than `batch_size` of them. Batches are
grouped by language first, because the language token rides in the decoder
prompt and one `generate` call carries a single prompt for the whole batch.
Verified identical: batch_size 1 and 4 produce the same WER, the same CER, and
the same hypothesis for every utterance.
`--limit` takes a speaker-stratified sample instead of the whole manifest.
Uniform sampling would let the child with the most recordings dominate a small
draw, moving the score for reasons unrelated to the model, so it draws from each
speaker in turn. Seeded, since a benchma…
Resolve tf32 against the GPU, and reject GPUs PyTorch cannot use
Hussein+1: Claude Opus 5 (1M context)
85d3028
Second GPU run got past LoRA injection and died building the trainer:
error: --tf32 requires Ampere or a newer GPU arch, cuda>=11 and torch>=1.7
The configs enable tf32 because it is free speed where it exists, but the guard
was `config.tf32 if torch.cuda.is_available() else False` -- which asks whether
there is a GPU, not whether that GPU has TF32. Anything below Ampere reaches
Transformers, which raises rather than ignoring the flag. Resolve it against the
device instead, the way the script already resolves precision, and say so when a
requested tf32 is dropped. Losing tf32 costs speed; failing the run costs the
whole run.
Preflight also let this through, and let through the larger problem behind it: a
Tesla P100 is sm_60, PyTorch 2.10 compiles for sm_70 and up, and such a GPU is
visible, reports its memory, and satisfies `is_available()` before failing at the
first kernel launch. Compare each device against `torch.cuda.get_arch_list()` and
refuse there -- preflight exists to …
Cover the warmup-argument fallback with a test
Hussein+1: Claude Opus 5 (1M context)
ef7b4bf
The version-dependent choice was inline in `run_training`, which meant the only
way to exercise it was a full training run against a specific Transformers
build. Lift it into `warmup_kwargs` and test both spellings against stand-in
dataclasses, so neither branch depends on which version happens to be installed.
Verified since the previous commit that the fallback is load-bearing in both
directions: 5.0.0 still has `warmup_ratio`, 5.16.1 has only `warmup_steps`, and
a 2-step LoRA run now completes on both. Kaggle shipped 5.0.0 at the time of the
failing log, so the extras keep the `<6` ceiling rather than pinning to one.
The helper also rejects a ratio of 1.0 on the newer spelling. `warmup_steps`
reads a value >= 1 as a literal step count, so passing it through would turn a
full-length warmup into a single step -- a quality regression with no error.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uis9uRynosX69gefzFQe…
Make GPU training run on the Kaggle image
Hussein+1: Claude Opus 5 (1M context)
9954b4c
Four things stopped `train_gpu.sh` from reaching a first optimizer step on
Kaggle, each independently fatal.
A `.venv-gpu/pyvenv.cfg` from an earlier cloud run had been committed. Every
fresh clone therefore started with a directory that looks like a virtualenv but
has no `bin/`, and `python -m venv` on it fails inside ensurepip rather than
rebuilding it. Untrack the file, ignore the directory, and have the script
clear an incomplete tree before creating one so an existing clone self-heals.
The image ships transformers 5 and huggingface-hub 1.x, while the extras pinned
`transformers<5` and `huggingface-hub<1`. Installing the package downgraded the
hub underneath transformers and broke the import. Widen both ceilings; the only
hub API used is `snapshot_download`, which is unchanged in 1.x.
Transformers 5 removed `warmup_ratio` from `Seq2SeqTrainingArguments` and folded
it into `warmup_steps`, which reads a value below 1.0 as a fraction of total
steps -- the same meaning. Choose the s…