Fix Granite residual contribution hooks - #1658
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
residual + sublayer_out * residual_multiplierinline, soblocks.N.hook_attn_out/hook_mlp_outexposed raw module outputs. The value was off by the multiplier and wrong as intervention points.ScaledResidualBlockBridgemakeshook_attn_out/hook_mlp_outreal HookPoints firing on the scaled contribution. Reads seeraw * scalewith a bit-exact forward, a write ofv(including in-place mutation) reconstructsvas the contribution, and backward hooks always route through the HookPoint.granite,granite_moe, andgranite_moe_hybridadapters, withresidual_multiplieradded to the config passthrough. Zero scale is rejected at construction.hook_attn_outis pruned at bind time. With experts,hook_mlp_outstays absent, theblock_sparse_moe + shared_mlpsum has no single capture point._maybe_wire_capture_hooksetc.) since it now wires more than pre-LN capture.residual_multiplier=0.22: residual identities, contribution = raw × scale, zero-ablation, write/in-place-mutation/bit-exactness regressions, backward-hook gradient flow, and HF forward parity across dense + MoE + hybrid.GraniteMoeHybridForCausalLMstrict-xfail in the alias-resolution audit.Fixes #1648 – Granite portion
Type of change
Checklist: