Commit 68d7e87
## Summary
Evo2 SAE **eval: label producers + probing harness** — turn DNA into an
`ActivationBuffer` (the one model-touching step) and score it through
the probing CLI (AUROC / annotate / linear / domain-F1 /
loss-recovered). Lives in the **`evo2_sae.eval.probing`** package,
alongside the #1629 primitives.
**Stacked on #1629** (→ #1622). #1630 supplies the eval labels.
## Contents — `evo2_sae.eval.probing`
- `evo2_buffer.py` — DNA → `ActivationBuffer` (the only model-touching
code: Evo2 → layer-L residual → `SAE.encode` + per-token labels)
- `labelers.py` — per-token biological labelers (genetic code / CDS
frame; prokaryotic gene calling via `pyrodigal`)
- `annot_tracks.py` — BED/GFF interval-track loader → per-token masks
(RefSeq / Rfam / JASPAR / ENCODE)
- `euk_windows.py` — eukaryotic gene-structure windows
- `probe.py` — the probing CLI (`extract` / `auroc` / `annotate` /
`linear` / `euk-f1` / `domain-eval`)
- `probe_loss_recovered.py` — SAE fidelity (loss recovered); reuses the
shared `sae.eval.loss_recovered`
Imports are package-relative; the primitives come from
`evo2_sae.eval.probing`. `loss_recovered` stays in the shared `sae` lib
(used by esm2/codonfm too).
## How to run
```bash
cd interpretability/sparse_autoencoders/recipes/evo2
bash .ci_build.sh && source .ci_test_env.sh # or: PYTHONPATH=src:../../sae/src
pytest tests/test_probe_integration.py tests/test_labelers.py tests/test_annot_tracks.py tests/test_euk_windows.py
# CLI: python -m evo2_sae.eval.probing.probe extract|auroc|annotate|linear|domain-eval ...
```
No dedicated CI lane (deferred — see #1622; CI should fold into the
repo-wide recipe lane later).
## Tests
- **CPU (no model):** label producers (`labelers` / `annot_tracks` /
`euk_windows`) + the probe-CLI integration (buffer save/load roundtrip
incl. the dense twin, AUROC/annotate/linear over a planted feature,
`domain_f1` over interval tracks). **35 passed.**
- **GPU:** the real-engine buffer/loss-recovered path is gated by
`@pytest.mark.skipif(not torch.cuda.is_available())` — runs on a GPU
box, skips otherwise.
---------
Signed-off-by: Polina Binder <pbinder@nvidia.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: root <root@nvidia-lepton040.cm.cluster>
1 parent 73c261f commit 68d7e87
13 files changed
Lines changed: 1954 additions & 1 deletion
File tree
- interpretability/sparse_autoencoders/recipes/evo2
- src/evo2_sae/eval/probing
- tests
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
Lines changed: 146 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
0 commit comments