merge: store one corpus per prepare config and represent splits/folds as row-index files

Abierto
#447 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
4/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
18/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python, pytorch, yaml

Línea de trabajo

Start with _merge_arrays_by_split and _merge_folds in src/leech/splitting/splitter.py, then trace how LeechDataset and _ArrayStream.keep consume the split files. The spec lists five tests to add, including bit-identical model_best.pt against legacy splits. Done means one merged corpus plus split_rows.npz, legacy directories still loading, and all five tests passing. Coordinate with #411 and #289 first.

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

Descripción

Problem

leech data merge writes train, val and test as three full copies of the corpus (_merge_arrays_by_split, src/leech/splitting/splitter.py), and --k-fold K writes K full copies (_merge_folds). Grid-search and ablation rules re-prepare and re-merge on top (grid_search.smk, ablation.smk). With home at 106% of quota and 36.5 GiB per production corpus, the same bytes are stored 3-5 times, and "a derived corpus is a function of its config; write it once" is the repo owner's standing rule.

Spec

Store one corpus per prepare config and represent each split as a row-index file over it.

  • merge emits the merged corpus once plus split_rows.npz (train, val, test int64 row indices; for k-fold, fold_{k}_train/val) and the existing split_runs.json. The merge's member-set validation and run-holdout logic stay inside _merge_arrays_by_split (CLAUDE.md: no second merge).
  • LeechDataset accepts (corpus_path, rows); it already selects by mask (_ArrayStream.keep, ChunkTable.select), so extend that to take an index array and preserve row order.
  • Per-input label/source_group overrides (-i label=file.npz) become per-row columns in the merged corpus so they survive without per-split copies.
  • Backwards compatible: existing three-file split directories keep loading; a one-line log states which layout was read. eval test, predict, bundling and split_runs.json consumers work with both.
  • Coordinate with #411 (--split-from DIR): that flag should read split_rows.npz directly in the new layout and keep the current behaviour for old layouts. Do not duplicate the work of #289 (streaming through the spill).

Acceptance criteria

  • data merge on a fixture writes one corpus + index file; total stored bytes ~1x the corpus (was ~1x per split, i.e. train+val+test copies, and K copies for k-fold).
  • Training on (corpus, rows) yields bit-identical model_best.pt to training on the legacy per-split files for the same seed.
  • A held-out run in split_runs.json has none of its rows in train/val index sets.
  • Legacy split directories still load and evaluate.

Tests

  • test_merge_writes_single_corpus_and_row_index
  • test_dataset_from_rows_matches_legacy_split_files
  • test_kfold_rows_partition_corpus
  • test_run_holdout_rows_disjoint_from_train
  • test_legacy_split_layout_still_loads

Non-goals

  • fp16 storage, mmap, or any change to the chunk format (CHUNK_FIELDS, #288).
  • Removing the legacy layout reader in this change.
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.