Reanchoring tests and benchmarks - #1603
Conversation
|
Drive-by note from reading this against This PR removes 35 test files, and six of them are inventoried in
The file's own header says it's an "Inventory of every Two of these are worth a second look beyond bookkeeping, since deleting the test also drops the documented coverage note:
If that coverage moves somewhere under the new goldens layout, updating the rows to point at the new home would keep the inventory useful; if it's intentionally dropped, deleting the rows says so explicitly. Also dangling after this lands, both referencing Happy to send a follow-up PR that just syncs |
…inventory (#1606) Two changes that both make tests/QUARANTINES.md true again. 1. Un-quarantine the encoder acceptance suites (#1605) test_hooked_encoder.py and test_hooked_encoder_decoder.py were skipped by 3efbd6e ("Cleanup (#1129)", 2025-11-15) as "CI test pollution". There is no order-dependence in either: T5 is 22 passed / 1 skipped / 0 failed standalone and inside the full tier, and BERT had a single failure, test_bert_block. That failure was a stale API assumption, not pollution. BertLayer.forward returned tuple[torch.Tensor] in transformers 4.56 and returns a bare Tensor in 5.x, so huggingface_block(embed_out)[0] went from unpacking the tuple to indexing the batch dimension ([1,8,768] vs [8,768]). The module was quarantined while the pin was still transformers>=4.56 — the test was green at the time — and broke at the v5 floor bump in 8e8d9d4 (#1315, 2026-05-19), unobserved because the module was dark. The sibling [0] unpacks at :58/:88/:108 are still correct; BertSelfAttention and BertEncoder kept their contracts. Restores 40 tests (36 runnable, 4 environment-gated). 2. Sync the inventory with the files #1603 removed The reanchoring in #1603 deleted 35 test files without touching tests/QUARANTINES.md, leaving 10 rows across 6 deleted files: test_hooked_transformer.py (x2), test_multi_gpu.py (x2), test_tensor_extraction_consistency.py, test_tokenization_methods.py, unit/components/test_attention.py (x3) and test_mlp_factory.py. Those rows are removed. With test_hooked_transformer.py gone, no whole-file quarantines remain, so the "⚠️ Technical debt — whole-file" section is dropped entirely. AGENTS.md and contributing.md both asserted the HookedTransformer acceptance suite was quarantined and named the two encoder files alongside it; both are corrected. Also fixes three drifted line numbers in the inventory and notes that the multi-GPU validation record refers to a since-removed file. Verified: tests/acceptance -m "not slow" -> 230 passed, 31 skipped, 0 failed. Every path referenced in QUARANTINES.md now exists, and every module-level skip marker in tests/ is accounted for. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Description
Re-anchors TransformerBridge's entire test and benchmark suite off the live
HookedTransformeroracle, so the upcomingHooked*removal can land without deleting the proof that the bridge is correct. After this PR, no test or benchmark constructs aHookedTransformer. The references come from three sources instead:HookedTransformeracross 6 models × 4 processing configs, hosted on the HF Hub (lars4776/TL-Goldens) and pinned by commit revision intests/goldens.py. The gpt2 golden anchors reproduce the published Main-Demo values (3.999 → 5.453) exactly.AutoModelForCausalLM(fp32, eager) directly.retain_gradground truth, batch equals per-row forward).Main changes:
scripts/capture_ht_goldens.py), revision-pinned loader +GoldenCellaccessor (tests/goldens.py), skip-gated session fixtures.reference_logits,reference_hooks,reference_activations, …) instead of areference_model; Phase 3's HFlog_softmaxfallback promoted to the only equivalence path; Phases 5/6 retired;--no-ht-referenceremoved; memory estimates recalibrated.adapter=None ↔ adapterweight-processing equivalence test is resurrected as an executable spec against the frozen state dicts (1e-5, fp64-verified noise floor), and the skipped backward-hook gradient test is resurrected against autograd.get_bridge_params/tl_parameters()returned a wrongly-reshapedW_Vfor joint-QKV models and omitted LN params (corruptingSVDInterpreterresults);ActivationCache.remove_batch_dim/apply_slice_to_batch_dimmishandled broadcast cache entries on batch>1. Weight-conversion and factory signatures widened fromHookedTransformerConfigtoTransformerLensConfig.lit/rewritten onto the bridge:HookedTransformerLIT*→TransformerLensLIT*(legacy aliases kept for one transition release); model validation is protocol-based;from_pretrainedboots a compat-mode bridge.Type of change
Checklist: