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

オープン
#448 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
0
フォーク
0
平均マージ
11時間 17分
マージ済み PR(30日)
23

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rnabioco/leech のほかの issue

rnabioco/leech の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。