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

Abierto
#446 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
18/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Python
Estrellas
0
Forks
0
Merge medio
11 h 17 min
PR fusionados (30 d)
23

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rnabioco/leech

Todos los issues de rnabioco/leech

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.