-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[Flux] allow tests to run #9050
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
Conversation
@@ -123,6 +122,7 @@ def forward( | |||
) | |||
|
|||
hidden_states = torch.cat([attn_output, mlp_hidden_states], dim=2) | |||
gate = gate.unsqueeze(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, will fail for multiple images.
dtype = self.text_encoder.dtype if self.text_encoder is not None else self.transformer.dtype | ||
text_ids = torch.zeros(batch_size, prompt_embeds.shape[1], 3).to(device=device, dtype=dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text_ids = torch.zeros(batch_size, prompt_embeds.shape[1], 3).to(device=device, dtype=self.text_encoder.dtype) | ||
dtype = self.text_encoder.dtype if self.text_encoder is not None else self.transformer.dtype | ||
text_ids = torch.zeros(batch_size, prompt_embeds.shape[1], 3).to(device=device, dtype=dtype) | ||
text_ids = text_ids.repeat(num_images_per_prompt, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allow num_images_per_prompt
> 1.
**inputs, | ||
).images[0] | ||
|
||
max_diff = np.abs(output_with_prompt - output_with_embeds).max() | ||
assert max_diff < 1e-4 | ||
|
||
def test_fused_qkv_projections(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not supported yet. Will add after @yiyixuxu performs the refactors.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I would remove OriginalModelMixin from the transformer as well. Since single file loading isn't supported yet
* fix tests * fix * float64 skip * remove sample_size. * remove * remove more * default_sample_size. * credit black forest for flux model. * skip * fix: tests * remove OriginalModelMixin * add transformer model test * add: transformer model tests
What does this PR do?
Some comments inline.