Repository navigation
Add Comfy Kitchen INT8 attention backend - #15448
Conversation
|
Hi @asaiyume, thanks for the PR! It does not appear to link an issue it fixes.
See the contribution guide for more details. Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice. Once the PR links an existing issue, the author box is ticked, or the |
|
Thanks for your PR @asaiyume. Do you think it's possible to package this as a kernel on the Hub and do it similar to |
sayakpaul
left a comment
There was a problem hiding this comment.
Thanks! The changes look good to me. But is it tied to the quant backend of Comfy? For example, can I load a regular checkpoint into a model and set its attention backend to this one?
|
Yes, it does work with normal models (official BF16s) and get the performance gains, similar to the |
|
Thanks @sayakpaul! Is the procedure for packaging kernels opening a issue then a PR on the huggingface/kernels-community? I think we should leave supporting of |
Yes, we can do so.
Okay no problem for me. But we should then do it right after this PR because we plan on depcrecating non Hub attention backends very soon. |
Will do! Should be able to complete it over the weekend. |
sayakpaul
left a comment
There was a problem hiding this comment.
Ran the tests using HF Jobs and they pass: https://huggingface.co/jobs/sayakpaul/6b12aa0adccc34da944d455e. Let's do the kernels implement ASAP if possible. Let me know your Hub username so that I can enable kernel publishing access.
|
On HF, same as GH |
|
Thanks. You should have kernel publishing access on the Hub now. |
What does this PR do?
Adds
comfy_kitchen_int8as an attention backend, usingint8_attentionfrom Comfy Kitchen. It follows the Comfy quantization support added in #15209. This gives around 8-15% performance boost compared to native baseline.Some Comfy-Org checkpoints already ask for it. In
qwen_image_2.1_turbo_int8_convrot, 31 of 32 blocks carry{"attention": "comfy_kitchen_int8"}. Reading that config automatically is left for a follow-up.Usage
pip install "comfy-kitchen>=0.2.41" accelerateResults
Z-Image-Turbo INT8 ConvRot, 2048x2048, 8 steps, torch 2.10.0, comfy-kitchen 0.2.41.
native (left)comfy_kitchen_int8 (right)MiniMax-H3 fl2va INT8 ConvRot, 704x704, 124 frames, 50 steps, torch 2.10.0, comfy-kitchen 0.2.41.
native (left)comfy_kitchen_int8 (right)h3_side_by_side.mp4
Before submitting
self-reviewskill on the diff?Who can review?
@DN6 @sayakpaul