Conversation
* Refactored `transformers` so that bridge configuration code is source-agnostic
* Initial breakup of Bridge into core and bridge only components. Setup remote driver in prep
* Initial setup of the vllm source
Cherry-picked from 98bbb835 on feature/vllm-integration. Resolved against
dev-4.x's Phase A type split:
- bridge.py: kept the shim (TransformerBridge content lives in
transformer_bridge.py now).
- sources/transformers.py: accepted the scaffold's package restructure
(transformers.py → transformers/{__init__,helpers,source}.py +
_hf_format.py).
- sources/transformers/source.py: re-applied Phase A's explicit
TransformersDriver construction in boot().
sources/vllm/source.py's boot_vllm currently sets bridge._forward_impl,
which Phase A removed. The function is dead until the next chunk lifts
it onto VLLMDriver + RemoteBridge — landing as-is so the scaffold tree is
on dev-4.x for incremental Phase B work.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Revision round 1 of the vLLM system
* Full vLLM integration initial completion
* jupiter patch
* dynamo patching
* pass through batch size
* add max model length to remote bridge boot
* Updating config construction to properly pass through to vLLM
* Wiring TLWorkerExtension
* Additional testing + diagnostic
* Another spot check
* Remove logging
* Fix issue with logit generation on hook_out
* Adjust to use token_ids directly instead of logprobs
* Updating Step 5 and driver bridge cleanup
* Add decoder layer for materializing the residual stream
* Updating tests due to changes on `dev`
* Fix pip install path
* Testing ln_final divergence
* documenting differences in ln_final
* Format cleanup
* Fix bug with beartype
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Refactored `transformers` so that bridge configuration code is source-agnostic
* Initial breakup of Bridge into core and bridge only components. Setup remote driver in prep
* Initial setup of the vllm source
Cherry-picked from 98bbb835 on feature/vllm-integration. Resolved against
dev-4.x's Phase A type split:
- bridge.py: kept the shim (TransformerBridge content lives in
transformer_bridge.py now).
- sources/transformers.py: accepted the scaffold's package restructure
(transformers.py → transformers/{__init__,helpers,source}.py +
_hf_format.py).
- sources/transformers/source.py: re-applied Phase A's explicit
TransformersDriver construction in boot().
sources/vllm/source.py's boot_vllm currently sets bridge._forward_impl,
which Phase A removed. The function is dead until the next chunk lifts
it onto VLLMDriver + RemoteBridge — landing as-is so the scaffold tree is
on dev-4.x for incremental Phase B work.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Revision round 1 of the vLLM system
* Full vLLM integration initial completion
* jupiter patch
* dynamo patching
* pass through batch size
* add max model length to remote bridge boot
* Updating config construction to properly pass through to vLLM
* Wiring TLWorkerExtension
* Additional testing + diagnostic
* Another spot check
* Remove logging
* Fix issue with logit generation on hook_out
* Adjust to use token_ids directly instead of logprobs
* Updating Step 5 and driver bridge cleanup
* Add decoder layer for materializing the residual stream
* Updating tests due to changes on `dev`
* Fix pip install path
* Testing ln_final divergence
* documenting differences in ln_final
* Format cleanup
* Initial batching test
* Add version print
* Setup batching for vllm
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Refactored `transformers` so that bridge configuration code is source-agnostic
* Initial breakup of Bridge into core and bridge only components. Setup remote driver in prep
* Initial setup of the vllm source
Cherry-picked from 98bbb835 on feature/vllm-integration. Resolved against
dev-4.x's Phase A type split:
- bridge.py: kept the shim (TransformerBridge content lives in
transformer_bridge.py now).
- sources/transformers.py: accepted the scaffold's package restructure
(transformers.py → transformers/{__init__,helpers,source}.py +
_hf_format.py).
- sources/transformers/source.py: re-applied Phase A's explicit
TransformersDriver construction in boot().
sources/vllm/source.py's boot_vllm currently sets bridge._forward_impl,
which Phase A removed. The function is dead until the next chunk lifts
it onto VLLMDriver + RemoteBridge — landing as-is so the scaffold tree is
on dev-4.x for incremental Phase B work.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Revision round 1 of the vLLM system
* Full vLLM integration initial completion
* jupiter patch
* dynamo patching
* pass through batch size
* add max model length to remote bridge boot
* Updating config construction to properly pass through to vLLM
* Wiring TLWorkerExtension
* Additional testing + diagnostic
* Another spot check
* Remove logging
* Fix issue with logit generation on hook_out
* Adjust to use token_ids directly instead of logprobs
* Updating Step 5 and driver bridge cleanup
* Add decoder layer for materializing the residual stream
* Updating tests due to changes on `dev`
* Fix pip install path
* Testing ln_final divergence
* documenting differences in ln_final
* Format cleanup
* Initial batching test
* Add version print
* Setup batching for vllm
* Additional documentation and coverage
* CI Failure cleanup
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* INitial Inspect Driver setup * Additional improvements to inspect * Cleaning up inspect driver flaws * Adding additional coverage to ensure verify interventions & CUDA support * Improving architecture verification process * extended inspect tests to cover more model types * Clean up leaking rand change * Fix inspect memoize bug * Additional inspect improvements * Initial setup of inspect vllm provider * Additional inspect driver feature tightening * migrating dev 4.x changes * format checks * docstring cleanup * Fixing CI issues
* notebook fix * Rebuilding real logits * improve buffers * Fixed softcap bug * per-position interventino * Inspect HF provider servers head-split attention hooks * Resolving final gaps in interp skills
* Initial bug fixes from sweep * cleanup duplication and comments * vllm extra
* multi-gpu setup * Fixing typing errors * parity report improvements * improve variance * test splitting * disabled cache * adjusted tests to be divisible by 2 gpu * fixed bug * tensor decoding * Documented successfuly test * Add pipeline parallelism * bug fix for 0'ed layers * bug fix – dynamic ownership * Update cleanup
* Add dedicated GraniteMoe adapter tests (#1302) (#1524) granite_moe had substantive test coverage, but embedded inside test_granite_adapter.py rather than in its own file — inconsistent with every other architecture listed in #1302 (including granite_moe_hybrid), which each get a dedicated test_<name>_adapter.py. Moves that coverage into test_granite_moe_adapter.py and adds the one piece that was missing: an explicit config-flag test class (GraniteMoe doesn't override config setup, so it inherits dense Granite's flags, but nothing asserted that directly before). test_granite_adapter.py goes back to covering only GraniteArchitectureAdapter, matching its own docstring. * Updating documentation for future deprecation (#1523) * feat: add RWKV-7 (Goose) TransformerBridge adapter (RWKV7ForCausalLM) (#1521) * feat: add RWKV-7 (Goose) TransformerBridge adapter (RWKV7ForCausalLM) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * refactor: use OpaqueBlockBridge for RWKV-7; introduce OpaqueBlockBridge base class Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * added hook_out_is_single_residual_stream default to OpaqueBlockBridge * style: apply black formatting to opaque_block, ssm_block, __init__ Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * refactor: replace SSM2MixerBridge with GeneralizedComponent for RWKV-7 attn/ffn sublayers Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix black formatting in generate_report.py Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> --------- Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> Co-authored-by: jlarson4 <jonahalarson@comcast.net> * feat: add RavenForCausalLM (Huginn) depth-recurrent adapter (#1520) * Add RavenForCausalLM (Huginn) TransformerBridge adapter Adds a TransformerBridge architecture adapter for RavenForCausalLM (tomg-group-umd/huginn-0125), a depth-recurrent decoder with a prelude / weight-tied recurrent core / coda structure, resolving #1469. - raven.py delegates the recurrence to the remote-code HF forward and maps the three physical block lists (prelude / core_block / coda) via SSMBlockBridge, with combined-QKV native attention and a gated MLP. Sets applicable_phases=[] (a random initial latent state and post-residual sandwich norms diverge from the verify_models phases) and supports_fold_ln=False (ln_f is reused mid-network). prepare_loading patches Huginn's remote code for transformers v5 (tied-weights-keys dict form + a weight re-init guard). - Registers in the adapter factory, the model registry (canonical author and description) and supported_models.json; surfaces the recurrence-shape config via both _HF_PASSTHROUGH_ATTRS lists. - Adds synthetic-config unit tests and CI-gated integration tests. * fix: pass num_steps as int to iterate_forward (0-d tensor has no len) * fix: remove unused torch import and use setattr for dynamic cfg attrs * style: apply black formatting to raven.py Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * refactor: introduce OpaqueBlockBridge; use it for Raven instead of SSMBlockBridge Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: apply black formatting to opaque_block, ssm_block, __init__ Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * fix: strip dead hook_q/k/v aliases from Raven AttentionBridge Raven uses a combined Wqkv projection (no separate q/k/v submodules), so AttentionBridge's default hook_q/hook_k/hook_v aliases (which target q.hook_out / k.hook_out / v.hook_out) are unresolvable. The upstream test_every_hook_alias_resolves_to_hookpoint audit catches these as 9 dead aliases across prelude / core_block / coda. Strip them by setting an instance-level hook_aliases that omits those three keys, leaving only the aliases that have real HookPoint targets. Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * chore: merge upstream/dev — add RWKV-7 passthrough attrs and registry entry Brings in the RWKV-7 additions from #1521 that landed in dev: - _bridge_builder.py: added RWKV-7 passthrough attrs (num_heads, value_dim, decay/gate/a/v_low_rank_dim, norm_first, norm_bias, fuse_norm, attn_mode, hidden_act) - generate_report.py: added RWKV7ForCausalLM description entry Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> --------- Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * Fix Tracr demo output_label: compiled labels are auto-numbered (#1525) The Tracr demo passes output_label="reverse", but Tracr builds labels as f"{name}_{unique_id}", so the compiled expression's residual labels are reverse_1:* and the demo raises ValueError at the state-dict cell. Pass reverse.label instead of hardcoding the name, and correct the same wrong label shape in the unit-test fixture (real Tracr never emits "reverse:1") and in the infer_tracr_output_label docstring example. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * Add TransformerBridge adapter for lightweight decoder-only pretraining models (#1519) * Add TransformerLens pretrain bridge adapter * Add TransformerLens pretrain bridge adapter * Setup registry for hookedtransformer deprecation * bug fixes and rebase to 4.x * Hook management improvements * implemented `stop_at_layer` on TransformerBridge * input_to_embed and pos_slice added to bridge * prevent corruption, check_hooks_to_add placed in all locations that need it * Adjusted head detector to be HookedTransformer agnostic, added key value injection to bridge * Add specific migration differences section * Attempting to let pytest run in parallel * Attempting to fix the OOM on the multi-device Full Coverage run --------- Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> Co-authored-by: Delaida Muminovic <delaida.muminovic.22@size.ba> Co-authored-by: Mukund Pandey <mukund.pandey@gmail.com> Co-authored-by: Joseph Quevedo <41499530+dewstend@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Cacapice <kombrellaro@gmail.com>
* Add dedicated GraniteMoe adapter tests (#1302) (#1524) granite_moe had substantive test coverage, but embedded inside test_granite_adapter.py rather than in its own file — inconsistent with every other architecture listed in #1302 (including granite_moe_hybrid), which each get a dedicated test_<name>_adapter.py. Moves that coverage into test_granite_moe_adapter.py and adds the one piece that was missing: an explicit config-flag test class (GraniteMoe doesn't override config setup, so it inherits dense Granite's flags, but nothing asserted that directly before). test_granite_adapter.py goes back to covering only GraniteArchitectureAdapter, matching its own docstring. * Updating documentation for future deprecation (#1523) * feat: add RWKV-7 (Goose) TransformerBridge adapter (RWKV7ForCausalLM) (#1521) * feat: add RWKV-7 (Goose) TransformerBridge adapter (RWKV7ForCausalLM) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * refactor: use OpaqueBlockBridge for RWKV-7; introduce OpaqueBlockBridge base class Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * added hook_out_is_single_residual_stream default to OpaqueBlockBridge * style: apply black formatting to opaque_block, ssm_block, __init__ Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * refactor: replace SSM2MixerBridge with GeneralizedComponent for RWKV-7 attn/ffn sublayers Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix black formatting in generate_report.py Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> --------- Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> Co-authored-by: jlarson4 <jonahalarson@comcast.net> * feat: add RavenForCausalLM (Huginn) depth-recurrent adapter (#1520) * Add RavenForCausalLM (Huginn) TransformerBridge adapter Adds a TransformerBridge architecture adapter for RavenForCausalLM (tomg-group-umd/huginn-0125), a depth-recurrent decoder with a prelude / weight-tied recurrent core / coda structure, resolving #1469. - raven.py delegates the recurrence to the remote-code HF forward and maps the three physical block lists (prelude / core_block / coda) via SSMBlockBridge, with combined-QKV native attention and a gated MLP. Sets applicable_phases=[] (a random initial latent state and post-residual sandwich norms diverge from the verify_models phases) and supports_fold_ln=False (ln_f is reused mid-network). prepare_loading patches Huginn's remote code for transformers v5 (tied-weights-keys dict form + a weight re-init guard). - Registers in the adapter factory, the model registry (canonical author and description) and supported_models.json; surfaces the recurrence-shape config via both _HF_PASSTHROUGH_ATTRS lists. - Adds synthetic-config unit tests and CI-gated integration tests. * fix: pass num_steps as int to iterate_forward (0-d tensor has no len) * fix: remove unused torch import and use setattr for dynamic cfg attrs * style: apply black formatting to raven.py Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * refactor: introduce OpaqueBlockBridge; use it for Raven instead of SSMBlockBridge Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: apply black formatting to opaque_block, ssm_block, __init__ Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * style: fix import order in generalized_components/__init__.py (isort) Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * fix: strip dead hook_q/k/v aliases from Raven AttentionBridge Raven uses a combined Wqkv projection (no separate q/k/v submodules), so AttentionBridge's default hook_q/hook_k/hook_v aliases (which target q.hook_out / k.hook_out / v.hook_out) are unresolvable. The upstream test_every_hook_alias_resolves_to_hookpoint audit catches these as 9 dead aliases across prelude / core_block / coda. Strip them by setting an instance-level hook_aliases that omits those three keys, leaving only the aliases that have real HookPoint targets. Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * chore: merge upstream/dev — add RWKV-7 passthrough attrs and registry entry Brings in the RWKV-7 additions from #1521 that landed in dev: - _bridge_builder.py: added RWKV-7 passthrough attrs (num_heads, value_dim, decay/gate/a/v_low_rank_dim, norm_first, norm_bias, fuse_norm, attn_mode, hidden_act) - generate_report.py: added RWKV7ForCausalLM description entry Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> --------- Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> * Fix Tracr demo output_label: compiled labels are auto-numbered (#1525) The Tracr demo passes output_label="reverse", but Tracr builds labels as f"{name}_{unique_id}", so the compiled expression's residual labels are reverse_1:* and the demo raises ValueError at the state-dict cell. Pass reverse.label instead of hardcoding the name, and correct the same wrong label shape in the unit-test fixture (real Tracr never emits "reverse:1") and in the infer_tracr_output_label docstring example. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * Add TransformerBridge adapter for lightweight decoder-only pretraining models (#1519) * Add TransformerLens pretrain bridge adapter * Add TransformerLens pretrain bridge adapter * Setup registry for hookedtransformer deprecation * bug fixes and rebase to 4.x * Hook management improvements * implemented `stop_at_layer` on TransformerBridge * input_to_embed and pos_slice added to bridge * prevent corruption, check_hooks_to_add placed in all locations that need it * Adjusted head detector to be HookedTransformer agnostic, added key value injection to bridge * Add specific migration differences section * Attempting to let pytest run in parallel * Attempting to fix the OOM on the multi-device Full Coverage run * Big comment sweep * Comment fix --------- Signed-off-by: Mukund Pandey <mukund.pandey@gmail.com> Co-authored-by: Delaida Muminovic <delaida.muminovic.22@size.ba> Co-authored-by: Mukund Pandey <mukund.pandey@gmail.com> Co-authored-by: Joseph Quevedo <41499530+dewstend@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Cacapice <kombrellaro@gmail.com>
* Fixing tests that were broken by the migration from dev to 4.x * Updating docs for latest information, adding support for vision benchmarking * Clean up dead code in architecture adapters, properly documenting all our slow tests, fixing some test code configs * Test and architecture DRY cleanup * more DRY tests * Refactoring repeated architecture functions into helpers * Reduced duplication across adapters in component mapping and other setup components
* fix(bridge): make tokenizer assignment re-run wiring logic * pipeline fix * pipeline fix * pipeline fix
Co-authored-by: Guan Tong <tguan@gmail.com>
* rebased on dev-4.x * change base branch
…ort (#1580) * feat(native): add param-free pre-norm (LNPre/RMSPre) and fold_ln support * pipeline fix * review changes
* fix(bridge): gate batched-list position_ids on the target model Batched list input builds an attention_mask and position_ids itself so pad tokens don't contaminate the forward. The mask is safe for any model, but the position_ids were handed over unchecked: a forward taking neither position_ids nor **kwargs raises TypeError where it would have returned logits. This is the gap jlarson4 raised while reviewing #1610. That PR added _accepts_derived_position_ids() and gated the main forward() derivation, but these two sites were left for a follow-up because no model could be shown to fail there. The LLaDA test harness builds a fixed-signature forward in process, which reproduces it: TypeError: TinyLLaDAModelLM.forward() got an unexpected keyword argument 'position_ids' Gate both sites on the same helper. The attention_mask stays unconditional -- it is safe everywhere, and withholding it would reintroduce the padding contamination this branch exists to prevent. A single unbatched string was never affected, and the test asserts that alongside the batched case. The regression test wraps its forward spy in functools.wraps: the gate reads that forward's signature, so a bare (*args, **kwargs) wrapper would look like it accepts position_ids and silently defeat the check under test. Fixes #1626 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(bridge): gate the cached-step position_ids on the target model too Review follow-up on #1627. Gating only the batched-list prompt derivation moved the injection rather than stopping it: every branch of the cached-step block supplies position_ids, so a refused model fell through to the torch.full(total_len - 1) fallback, which counts pad slots and is therefore wrong per row for a left-padded batch. Measured on hf-internal-testing/tiny-random-OPTForCausalLM, which the gate refuses because OPTLearnedPositionalEmbedding consumes the mask and derives its own positions, while its forward would accept the kwarg: before #1627 cached steps [[9],[2]] [[10],[3]] [[11],[4]] <- per row #1627 as sent cached steps [[9],[9]] [[10],[10]] [[11],[11]] <- pad slots now cached steps None <- OPT derives cached-vs-uncached max |logit diff| goes 7.45e-08 -> 2.98e-01 -> 7.45e-08, so this was a regression the PR introduced and it is now removed. Gate the whole three-way block rather than each branch, so a model that owns its position derivation receives the mask alone, matching the uncached path. Adds tests/integration/model_bridge/test_batched_generate_position_ids.py. The _generate_tokens half of #1627 had no coverage: neither fixed-signature architecture in the suite can reach that site, since LLaDA raises NotImplementedError on generate. A text-level parity test would not catch this either, because greedy argmax absorbs the drift and the decoded strings match in both states, so the tests compare logits and separately assert that no position_ids reaches a refused model. Two of them are red on 15d9553. Refs #1626 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* Fix TransformerBridge adapter traversal coverage * Address TransformerBridge traversal review feedback
* improving the final hookedTransformer deprecation items * Clean up unnecessary assertions * Fixing CI failures * tolerance fix
…ign=True) (#1660) * fix(bridge): preserve split-component views under load_state_dict(assign=True) assign=True replaces each target parameter object instead of copying into existing storage, which desyncs view-backed split components (gpt2's q/k/v, gate/up) from the combined weight (c_attn, gate_up_proj) they share storage with -- original_model.state_dict() silently keeps stale data. Route those specific keys through an explicit in-place copy_() instead, and raise a clear error if a shape mismatch makes that unsafe. Fixes #1637 * fix(bridge): route storage-sharing assign=True writes through copy_, not just view-backed ones Generalizes #1660's detection from partial views (torn from tensor size vs. its own storage) to any current tensor that shares underlying storage with another key. This covers the reviewer-flagged gap of writing a combined weight's own raw key directly under assign=True (which orphaned the views sharing its storage), and as a side effect also fixes tied embed/unembed desyncing under assign=True (#1725). Adds a dtype/device guard alongside the existing shape guard, validates every key before applying any copy_ instead of copy-as-it-validates, and excludes meta tensors from the storage-group check -- every meta tensor reports data_ptr()==0, which would otherwise falsely group unrelated offloaded parameters together -- so a meta target takes the ordinary assign=True materialization path instead. Addresses review from jlarson4 and koriyoshi2041 on #1660.
* wrappign up final pre-deprecation items * Eliminating Hooked* classes from test suites * Updating goldens revision for latest data * Final demo updates * Codified hookedrootmodule * prep for removal of Hooked* system * Format cleanup * test fix
* HookedTransformer Deprecation * Additional hooked deprecation prep
…dge (#1758) In #1740 the import in LIT_Integration_Demo.ipynb was updated to TransformerBridge, but the model loading cell still called HookedTransformer.from_pretrained, which raised a NameError since HookedTransformer was no longer imported. Update the cell to load via TransformerBridge.boot_transformers with enable_compatibility_mode(). Co-authored-by: Jonah Larson <jonahalarson@comcast.net>
* fix: raise on stop_at_layer when no 'blocks' stack is registered Replace the stop_at_layer reject-list with an allowlist guard and check self._modules instead of hasattr for both stop_at_layer and start_at_layer. Addresses #1769 * docs: note NotImplementedError in stop_at_layer docstring test: cover a wrapped model exposing its own .blocks Addresses #1769 * test: cover a wrapped model exposing its own .blocks Addresses #1769 --------- Co-authored-by: jlarson4 <jonahalarson@comcast.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Preparing for the release of v4
Type of change
Checklist: