-
Notifications
You must be signed in to change notification settings - Fork 102
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 int8 lora #431
Fix int8 lora #431
Conversation
doombeaker
commented
Dec 17, 2023
•
edited
Loading
edited
- 社区版 LoRA 修复、跑通
- 商业版 int8 修复
- CI 中加入社区版 LoRA 测试
.to(weight.device) | ||
) | ||
weight = weight.to(torch.float32) * org_weight_scale | ||
# if is_rewrite_qkv and is_quant: |
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.
出图效果和原来不一致了,应该是这里 is_rewrite_qkv
恒为 False 导致的
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.
这里 is_rewrite_qkv 恒为 False 是应为:CrossAttentionPytorch 最新的Comfyui名字 CrossAttention
https://github.com/Oneflow-Inc/onediff/blob/516ea1f95293c1d9e3a4e77488eaa4da90c3cb68/onediff_comfy_nodes/utils/diffusers_quant_utils.py#L239-L241
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.
出图效果和原来不一致了,应该是这里
is_rewrite_qkv
恒为 False 导致的
看了这里添加量化权重的逻辑应该是没有问题 和以前一样,我单独量化 conv 出图效果一致,但是加上 linear 量化效果不一致。具体还待确认
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.
@ccssu 我记得用量化插件量化 sdxl turbo 时,是 disable conv,保留 linear,效果就比较一致。
这个没什么特别的原因,就是新的量化是不做筛选的,有些模型层类别 conv(或者 linear)对量化比较敏感,量化后效果就差了。
我觉得这里满足:
- 能提速
- 出图效果比较一致
就可以了。
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.
这个问题在之前就存在,怀疑是 ComfyUI 机制导致的问题。加载 2 个 load checkpoint 可以绕过 |
@@ -0,0 +1,581 @@ | |||
{ |
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.
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.
lora 的 CI 挂了,而且我本地暂时复现不出来,我先把这个 PR 里你加入的 LoRA CI revert 了。之后再慢慢加 LoRA 的效果比较的 CI 吧。
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.
收到👌
5021f57
to
5d4b53e
Compare