Skip to content

Hooked Class Deprecation - #1759

Merged
jlarson4 merged 2 commits into
dev-4.xfrom
deprecation/Hooked--class-deprecation
Sep 9, 2026
Merged

jlarson4 merged 2 commits into
dev-4.xfrom
deprecation/Hooked--class-deprecation

Conversation

@jlarson4

@jlarson4 jlarson4 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Description

This is the preparation for the removal of Hooked* classes

  • Removed the five model classesHookedTransformer, HookedEncoder, HookedEncoderDecoder, HookedAudioEncoder, BertNextSentencePrediction.
  • Removed the supporting stackloading_from_pretrained.py, config/hooked_transformer_config.py, the whole components/ tree (26 files) and pretrained/weight_conversions/ (33 files), factories/mlp_factory.py, the train.py / utils.py shims, and the two HT-dependent capture scripts.
  • Kept-side repairs__init__.py reshaped (lazy-legacy map + de-shadowing removed, __all__ trimmed); config / multi_gpu / key_value_cache retyped off the deleted config; remote_bridge switched to utilities; get_official_model_name rehomed to supported_models.py; goldens pure-helpers rehomed to goldens_capture_spec.py; make_docs.py HT-table generator removed.
  • Tests — deleted ~30 HT-only test files; re-anchored the post-norm, MoE-expert-fold, and resolver guards onto the surviving code; added test_bert_weight_surface.py; made the doctest guard permanent.
  • Config / docs / CI — dead Hooked* filterwarnings, apidoc excludes, and QUARANTINES rows removed; the HookedTransformer model-properties table preserved as a committed static page with a 4.0 deprecation banner.
  • Notebook hard breaks — Main_Demo (checkpoint-labels import), Colab_Compatibility (loadingsupported_models), LIT (call site → bridge), hf-tl-logit-comparator (ported to bridge); stale HT-deprecation stderr stripped from Grokking / No_Position outputs.
  • Public-API tombstones_REMOVED_IN_4_0 directed-message map in __init__.py's __getattr__.
  • Code fixes — case-insensitive get_official_model_name restored (+ regression test); hook_points import-shim removed as promised (directed error); alias-warning over-promise softened.
  • Contributor guidance — AGENTS.md mirror rule + §2 table + paragraph, .github/copilot-instructions.md, config/AGENTS.md de-HT'd.
  • Package READMEslit/README.md (+ dead __all__ entry), benchmarks/README.md (use_ht_referenceuse_hf_reference, dead link); README PyPI blurb; contributing.md banner.
  • Bookkeepingdoc_sanitize.cfg dead sanitizer + duplicate section; goldens provenance + 3 dead capture-script comments; QUARANTINES T5 note.
  • Coverage — new test_head_detector_bridge.py and test_model_protocol_bridge.py.
  • Packagingbetter-abc + muutils dropped from pyproject.toml; uv.lock refreshed.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

@jlarson4
jlarson4 merged commit ffc629c into dev-4.x Sep 9, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant