dataset: fp16 resident signal tensor behind --signal-dtype (ADR 0006 section 2)

Aperta
#448 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
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start in src/leech/dataset.py at _prepare_signals_block (where the signal tensor is cast) and __getitems__ (where it is gathered), and read ADR 0006 section 2 in dev-notes/adr/0006-memory-mapped-chunk-corpora.md. Add the --signal-dtype flag with default float32, then check the three named tests: test_fp16_signal_resident_dtype_and_nbytes, test_fp16_getitems_returns_float32 and test_fp32_default_unchanged. Done means resident bytes halve and the fp32 path stays bit-identical; the default flip waits on the paired-seed production comparison.

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

Descrizione

Problem

ADR 0006 (dev-notes/adr/0006-memory-mapped-chunk-corpora.md, section 2) chose fp16 for the resident signal tensor but it is not implemented. Signal is the largest tensor in the training corpus (about 36 GB resident on the production charging corpus, ~21 GB at fp16), and with each rank holding its own copy that cost is multiplied by --gpus.

Spec

  • Keep the signal tensor in float16 in LeechDataset (cast once in _prepare_signals_block, src/leech/dataset.py) and convert to float32 in __getitems__ after the gather. Models and augmentation still see float32, so no model change.
  • Behind a flag first: --signal-dtype {float32,float16}, default float32. Record the value in the model config and prepare/train provenance so a checkpoint documents it.
  • Normalized signal (median-MAD) is O(1) in magnitude, so fp16's 11-bit mantissa (~1e-3 relative) is the only loss; this must be shown not to matter before the default flips.

Acceptance criteria

  • Resident signal bytes halve (assert on tensor nbytes).
  • Paired comparison on the production corpus, >= 6 paired seeds (3 is too few to call a sign, see project notes): the fp16-minus-fp32 AUROC difference is within the within-arm SD (~2.3e-5) and its CI includes 0. Only then propose changing the default.
  • fp32 default path is bit-identical to today.

Tests

  • test_fp16_signal_resident_dtype_and_nbytes
  • test_fp16_getitems_returns_float32
  • test_fp32_default_unchanged

Non-goals

  • Quantizing other tensors or changing the on-disk dtype.
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.