Fix AuraFlow attn processors applying norm_added_q to key projection#13533
Merged
yiyixuxu merged 1 commit intohuggingface:mainfrom Apr 21, 2026
Merged
Conversation
Both AuraFlowAttnProcessor2_0 and FusedAuraFlowAttnProcessor2_0 were calling attn.norm_added_q on encoder_hidden_states_key_proj while guarded by a check on attn.norm_added_k. This applies the query normalization layer to the key, which is a copy-paste error. Consistent with every other attention processor in this file that defines both norm_added_q and norm_added_k (e.g. FluxAttnProcessor, CogVideoXAttnProcessor, HunyuanAttnProcessor), where norm_added_k is applied to the added key projection.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
terarachang
pushed a commit
to terarachang/diffusers
that referenced
this pull request
Apr 30, 2026
…uggingface#13533) Both AuraFlowAttnProcessor2_0 and FusedAuraFlowAttnProcessor2_0 were calling attn.norm_added_q on encoder_hidden_states_key_proj while guarded by a check on attn.norm_added_k. This applies the query normalization layer to the key, which is a copy-paste error. Consistent with every other attention processor in this file that defines both norm_added_q and norm_added_k (e.g. FluxAttnProcessor, CogVideoXAttnProcessor, HunyuanAttnProcessor), where norm_added_k is applied to the added key projection.
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.
What does this PR do?
Both
AuraFlowAttnProcessor2_0andFusedAuraFlowAttnProcessor2_0inattention_processor.pycontain a copy-paste error whereattn.norm_added_qis called on the encoder key projection while guarded by a check onattn.norm_added_k:This silently applies the query's added-QK norm to the key projection, which is wrong whenever the two layers have different parameters (and is definitely wrong as a logical statement of the attention equations).
Every other attention processor in this file that defines both
norm_added_qandnorm_added_k(e.g.FluxAttnProcessor,CogVideoXAttnProcessor,HunyuanAttnProcessor, etc.) correctly appliesnorm_added_kto the key.This PR fixes both occurrences (lines 2143 and 2240).
Before submitting
Who can review?
@yiyixuxu @sayakpaul