model train-many: one launcher that owns an allocation and trains a queue of configs across its GPUs

Aperta
#446 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start from the existing leech model train entry point and the _grid_point_worker failure-handling pattern, then read how model_last.pt and model_resume.pt are written and resumed. The new train-many launcher needs one persistent worker per GPU fed from a queue, and it depends on the shared-memory corpus issue. Done means the five listed tests pass, including the bit-identical standalone match.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Allocations here arrive in bursts, and the preference is to use a held allocation fully, in one job. The pipeline instead submits one Slurm job per model (seed x arm x fold x pairwise pair). Each pays its own queue wait, ~3 min corpus load, and compile; a run that early-stops frees a GPU nobody refills; and --gpus 4 DDP gives only 2.25x end to end while one run already saturates an A30 at 95% (CLAUDE.md). For sweeps, four independent single-GPU runs give ~4x throughput.

Spec

Add leech model train-many: a launcher that owns the allocation and trains a queue of configs.

  • Input: --queue queue.json, a list of {output_dir, <TrainConfig fields>} sharing --train-data/--val-data. Output: one directory per config exactly as leech model train writes it.
  • Loads the corpus once (depends on the shared-memory corpus issue), starts one persistent worker per visible GPU pinned to cuda:i, and feeds workers from a queue so a worker finishing or early-stopping immediately takes the next config.
  • Each config runs the unmodified single-GPU trainer with its own seeded sampler. Never share a DataLoader, sampler or batch stream between models: a run in the pool must be bit-identical to the same run standalone.
  • Failure isolation: an exception in one config is recorded (status: failed + traceback in that config's dir) and the queue continues (cf. _grid_point_worker). Exit non-zero at the end if any config failed.
  • Walltime: read SLURM_JOB_END_TIME; do not start a config whose expected duration (median of completed siblings; unknown until one completes) exceeds the time left. Skipped configs are listed in the summary.
  • Resume: on restart, skip dirs with model_last.pt, resume dirs with model_resume.pt (passing --resume as today, so the recipe/corpus fingerprint guard still applies). model_resume.pt stays undeclared as a Snakemake output.
  • CPU budget: require cpus_per_task >= n_gpus * (1 + num_workers); refuse with that message otherwise.
  • Write train_many_summary.json (config -> status, device, wall time, best metric).
  • Pipeline: a train_sweep_{pair} rule owns the allocation (queue as params, outputs are the per-config metrics.json files). Prefer this to Snakemake group: jobs, which are separate processes and cannot share the corpus.

Acceptance criteria

  • Four configs on a 4-GPU node run concurrently on four distinct devices; a fifth starts on the first GPU to free.
  • Per-config model_best.pt is bit-identical to a standalone same-seed leech model train run.
  • One deliberately failing config does not stop the others and yields a non-zero overall exit.
  • Killed mid-run and restarted: finished configs are skipped, in-flight ones resume.
  • A config is not started when it cannot finish before SLURM_JOB_END_TIME.

Tests

  • test_train_many_assigns_distinct_devices (CPU stand-in devices)
  • test_train_many_isolates_failures
  • test_train_many_resumes_and_skips_complete
  • test_train_many_respects_walltime_budget
  • test_train_many_matches_standalone_run

Blocked by / non-goals

  • Blocked by the shared-memory corpus issue (without it, N workers hold N corpus copies).
  • Not packing multiple models onto one GPU, not multi-node, not changing any recipe.
Lingua principale
Python
Stelle
0
Fork
0
Merge medio
11h 17m
PR unite (30g)
23

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rnabioco/leech

Tutte le issue di rnabioco/leech

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.