dev-4.x contribution follow ups - #1614
Merged
Merged
Conversation
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
Works through the follow-up backlog from our PR reviews for the
dev-4.xchanges, verified against currentdev-4.x. The review caught and fixed several additional bugs, including two long-standing ones nobody had seen because the affected notebooks had never executed coherently end to end.Main changes:
W_in/W_out/W_gatewere raw aliases to the wrapped module's weight with no layout conversion, so every nn.Linear-backed model (all ofboot_native) returned transposed weights; Conv1D models were right by luck. Now layout-aware properties onMLPBridge, tested in both aspect ratios (the bottleneck shape defeats shape heuristics).boot_nativeinit parity: gpt2-mode default std was 0.02 instead of the legacy0.8/√d_model(toy-model training dynamics depend on this — the grokking demo memorizes vs. stalls); seeded init now generates on CPU/fp32 and copies in, so the same seed reproduces identical weights before or after.to(device)/.to(dtype);initializer_rangeacts as the xavier/kaiming gain like the legacy init did.get_bridge_paramsGQA expansion: grouped K/V and biases expand ton_heads(repeat_interleave, matching HFrepeat_kvpairing) soSVDInterpreter's per-head OV pairing is correct on GQA models; non-divisible head counts raise instead of silently floor-dividing.hook_aliasestargets can be a priority-ordered list; OLMo-Hybrid'shook_mlp_outnow resolves toln2_post.hook_outon post-norm layers and falls back tomlp.hook_outon linear-attention layers.enable_compatibility_mode()on audio models raises a clearNotImplementedErrorinstead of aKeyError; bias-free checkpoint stacking raises an actionable error that now survives__getattr__(CPython discards the original diagnostic otherwise);print(bridge)no longer crashes (__str__called a method that never existed);train()works on a config copy instead of mutating the caller's; dead_set_processed_weight_attributesremoved.TransformerBridge(merged with docs: migrate executable doctests to TransformerBridge #1576's version of the same migration; conflicts resolved in its favor), a decorative comment-only doctest inActivationCachemade live, and a repo guard test that fails if any surviving module's doctest referencesHookedTransformer.boot_nativeand actually green (96/96 and 30/30 under nbval). Three root causes found along the way:doc_sanitize.cfg's device-string stripper has never loaded — nbval's parser requires a space afterreplace:, soregex4silently didn't exist. One-character fix.key_freqs = [17, 25, 32, 47]from a past run — which matched neither observable model (HEAD's own stored norms plot shows different frequencies). The notebook now detects key frequencies from the embedding norms, and the restricted/excluded-loss cells finally demonstrate the canonical result against their own model (restricted 1.19e-07, excluded 5.07).Notebook diffs are stripped to necessary changes only (metadata/execution counts/env-specific outputs reverted to HEAD wherever nbval provably never compares them).
slow-tests.yml) — scheduled + manual dispatch, HF cache chained to the existing key, swap + disk reclaim, concurrency-guarded, with the >16GB-RAM adapters explicitly ignored until we have a large runner. Note the cron only fires once this reachesmain; dispatch works before that.Deferred with reasons (tracked in the plan doc): GIDD's
ScaledLinearscale needs the real hub class to verify before touching; copy-split staleness, storage-identity load grouping, muP native init, and SSM primitive generalization are issue-shaped product work.Type of change
Checklist: