feat: extended flora to flux, added fora_backbone_calls_per_step parameter #494
feat: extended flora to flux, added fora_backbone_calls_per_step parameter #494
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
| model.vae = compile_callable(model.vae, smash_config) | ||
| #model.text_encoder = compile_callable(model.text_encoder, smash_config) | ||
| #model.text_encoder_2 = compile_callable(model.text_encoder_2, smash_config) | ||
| #model.vae = compile_callable(model.vae, smash_config) |
There was a problem hiding this comment.
Accidentally committed commented-out compilation code
Medium Severity
The compilation of text_encoder, text_encoder_2, and vae in fora_logic has been commented out rather than deleted. The analogous deepcache_logic function still compiles these components (lines 332-333). This appears to be debugging code that was accidentally left in, reducing the optimization benefits of torch_compile when used with FORA-enabled models. The PR description doesn't mention intentionally removing this compilation.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| @@ -0,0 +1,640 @@ | |||
| { | |||
There was a problem hiding this comment.
Adding a information on how to down load install pruna.
# if you are not running the latest version of this tutorial, make sure to install the matching version of pruna
# the following command will install the latest version of pruna
%pip install pruna
Reply via ReviewNB
| @@ -0,0 +1,640 @@ | |||
| { | |||
There was a problem hiding this comment.
Instead of having this as a comment
#Login to HuggingFace (required for Flux2 model access)
To have it as text before the code block and link to the model:https://huggingface.co/black-forest-labs/FLUX.2-klein-4B
Then, have the code regarding the unoptimized model. So loading it, prompting, benchmark baseline. And after that, the optimisation of the model and results.
Reply via ReviewNB
| @@ -0,0 +1,640 @@ | |||
| { | |||
There was a problem hiding this comment.
| @@ -0,0 +1,640 @@ | |||
| { | |||
There was a problem hiding this comment.
| @@ -0,0 +1,640 @@ | |||
| { | |||
There was a problem hiding this comment.
A summary of what has happened in this tutorial. Something like this
"In this tutorial, we demonstrated a standard workflow for optimizing and evaluating an image generation model using Pruna.
We defined our optimization strategy using the SmashConfig object and applied it to the model with the smash function.
The results show that we can significantly improve runtime performance while maintaining a high level of output quality."
Reply via ReviewNB
minettekaum
left a comment
There was a problem hiding this comment.
All in all, it looks good to me. I added some comments about the tutorial's order and a bit more elaboration 😄
Description
Added flux2 compatibility to fora, as well as fora torch compile logic. Added CFG logic to fora.
Related Issue
Fixes #(issue number)
Type of Change
How Has This Been Tested?
Ran it with flux 1dev, flux2klein 4b and flux2klein 4b base to test backwards compatibility, and the compatibility of the backbone_calls_per_step with all three models.
Checklist
Additional Notes
test_fora_flux2klein.ipynb