Apply learned RMSNorm scales in Matrix-Game-3 action attention - #84
Open
zjn20030811 wants to merge 1 commit into
Open
Apply learned RMSNorm scales in Matrix-Game-3 action attention#84zjn20030811 wants to merge 1 commit into
zjn20030811 wants to merge 1 commit into
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.
Summary
Problem
The action module's WanRMSNorm registers a learned weight, and the released base and distilled checkpoints contain these action-normalization parameters. Its forward path currently ignores the weight and returns only an unscaled RMS-normalized tensor.
Each enabled action block uses four of these norms before mouse and keyboard attention. The released configuration enables 15 action blocks, so 60 learned scale vectors are loaded but have no effect on the attention logits.
The canonical WanRMSNorm in wan/modules/model.py already applies the trained scale and computes the reduction in float32.
Released checkpoint evidence
At official model revision 382aa382a03cec057360755aa72c7735025770bb, both the base and distilled safetensors contain all 60 expected action RMSNorm weights with no missing keys.
For blocks.9.action_model.img_attn_q_norm.weight:
Loading that released weight into the current and fixed implementations changes all 64 output dimensions. The relative L2 difference is 15.16%, and the current implementation leaves weight.grad unset. The fixed implementation matches weighted RMSNorm and gives all 64 weight elements nonzero gradients.
Fix
Mirror the canonical implementation in the action module:
Validation