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

Aperta
#447 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à
4/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, pytorch, yaml

Direzione di ricerca

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.

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

Descrizione

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.
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.