-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fix using VAE in quantization mode #1090
base: main
Are you sure you want to change the base?
Conversation
WalkthroughRecent changes in the codebase involve the removal of conditional logic concerning the OneFlow backend in Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- onediff_comfy_nodes/modules/booster_cache.py (2 hunks)
- onediff_comfy_nodes/modules/oneflow/booster_quantization.py (3 hunks)
Additional context used
Ruff
onediff_comfy_nodes/modules/oneflow/booster_quantization.py
135-135: No explicit
stacklevel
keyword argument found(B028)
Additional comments not posted (2)
onediff_comfy_nodes/modules/booster_cache.py (1)
54-64
: Evaluate the impact of removing OneFlow backend checks.The removal of OneFlow backend checks simplifies the code but may affect functionality related to caching and backend compatibility. Ensure that this change aligns with the overall architectural goals and does not introduce regressions.
Consider verifying the impact of these changes on the system's behavior, especially in environments where OneFlow might be used.
onediff_comfy_nodes/modules/oneflow/booster_quantization.py (1)
130-139
: Ensure the newVAE
handling aligns with quantization objectives.The new method for handling
VAE
in theexecute
method is a valuable addition. Ensure that this approach aligns with the overall quantization strategy and does not introduce inconsistencies.Consider testing the behavior of this method with various
VAE
models to ensure it functions as expected.Tools
Ruff
135-135: No explicit
stacklevel
keyword argument found(B028)
@execute.register(VAE) | ||
def _(self, model: VAE, **kwargs): | ||
# TODO: VAE does not support quantization and patch compatibility | ||
from .booster_basic import BasicOneFlowBoosterExecutor | ||
|
||
warnings.warn( | ||
"TODO: VAE does not support quantization and patch compatibility", | ||
UserWarning, | ||
) | ||
return BasicOneFlowBoosterExecutor().execute(model, **kwargs) |
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.
Add stacklevel
to the warning for better traceability.
The warning about VAE
not supporting quantization lacks a stacklevel
argument, which could help identify where the warning originates.
Apply this diff to improve the warning:
warnings.warn(
"TODO: VAE does not support quantization and patch compatibility",
UserWarning,
+ stacklevel=2
)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
@execute.register(VAE) | |
def _(self, model: VAE, **kwargs): | |
# TODO: VAE does not support quantization and patch compatibility | |
from .booster_basic import BasicOneFlowBoosterExecutor | |
warnings.warn( | |
"TODO: VAE does not support quantization and patch compatibility", | |
UserWarning, | |
) | |
return BasicOneFlowBoosterExecutor().execute(model, **kwargs) | |
@execute.register(VAE) | |
def _(self, model: VAE, **kwargs): | |
# TODO: VAE does not support quantization and patch compatibility | |
from .booster_basic import BasicOneFlowBoosterExecutor | |
warnings.warn( | |
"TODO: VAE does not support quantization and patch compatibility", | |
UserWarning, | |
stacklevel=2 | |
) | |
return BasicOneFlowBoosterExecutor().execute(model, **kwargs) |
Tools
Ruff
135-135: No explicit
stacklevel
keyword argument found(B028)
Summary by CodeRabbit
VAE
models in the booster quantization process, with a warning about current limitations.