-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in SanaPipeline example? #10489
Labels
bug
Something isn't working
Comments
@geronimi73 Gemma2Model.from_pretrained(
"Sana_600M_1024px_diffusers",
subfolder="text_encoder",
# quantization_config=quant_config,
torch_dtype=torch.bfloat16,
) output: Gemma2Model(
(embed_tokens): Embedding(256000, 2304, padding_idx=0)
(layers): ModuleList(
(0-25): 26 x Gemma2DecoderLayer(
(self_attn): Gemma2Attention(
(q_proj): Linear(in_features=2304, out_features=2048, bias=False)
(k_proj): Linear(in_features=2304, out_features=1024, bias=False)
(v_proj): Linear(in_features=2304, out_features=1024, bias=False)
(o_proj): Linear(in_features=2048, out_features=2304, bias=False)
(rotary_emb): Gemma2RotaryEmbedding()
)
(mlp): Gemma2MLP(
(gate_proj): Linear(in_features=2304, out_features=9216, bias=False)
(up_proj): Linear(in_features=2304, out_features=9216, bias=False)
(down_proj): Linear(in_features=9216, out_features=2304, bias=False)
(act_fn): PytorchGELUTanh()
)
(input_layernorm): Gemma2RMSNorm((2304,), eps=1e-06)
(pre_feedforward_layernorm): Gemma2RMSNorm((2304,), eps=1e-06)
(post_feedforward_layernorm): Gemma2RMSNorm((2304,), eps=1e-06)
(post_attention_layernorm): Gemma2RMSNorm((2304,), eps=1e-06)
)
)
(norm): Gemma2RMSNorm((2304,), eps=1e-06)
) BTW, the precision for Gemma is BF16 according to the official repo. |
@lawrence-cj Got it! Thank you!! |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I think there might be something wrong with the
SanaPipeline
example code at https://huggingface.co/docs/diffusers/main/en/api/pipelines/sana#diffusers.SanaPipelineIt results in a shape mismatch (see detailed logs below):
mat1 and mat2 shapes cannot be multiplied (600x256000 and 2304x1152)
I've noticed that the
text_encoder
model looks different depending on the way it is loaded.Reproduction
),pipeline.text_encoder
looks like this:If however I don't load the components separately but with the code provided by @lawrence-cj here it 1) works and 2) the
text_encoder
looks different:-> the language modeling head
lm_head
is gone. Is guess that's all expected (?) but I haven't found any documentation of this behaviour or where in the pipeline code this happens.Reproduction
Loading without
quantization_config
because for some reason this does not work on my mac but I tried the same code on a 4090 and it fails there too.Logs
System Info
Who can help?
@sayakpaul @lawrence-cj
The text was updated successfully, but these errors were encountered: