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

Abierto
#448 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
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

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

Descripción

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