mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[GH-ISSUE #9] INT8 support #5
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kanttouchthis on GitHub (Jan 6, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/9
For nvidia gpus with 8.0 <= compute capability < 8.9 which don't have fp8 support, torch._int_mm can be used for torch.int8 matmul. from my own testing, this results in a ~30% performance increase over bf16/fp16 matmul when torch.compiled. this could be used with fp8 by dequantizing before re-quantizing to int8, or it could be used with int8 weights or bit-packed lower precision (u)int weights. in my own extension i use this technique with svd for fast and reasonably accurate 4 bit quantization, but it would be great to see first party support. it should also be fairly easy to implement an int8 matmul kernel in cuda/triton for other gpus.
@kanttouchthis commented on GitHub (Jan 6, 2026):
here is a code snippet for int8 matmul, which achieved 1.25 it/s compared to 0.91 it/s for bf16/fp16 on flux.1 on my machine (the normal forward pass was also compiled the same way).
@Ph0rk0z commented on GitHub (Jan 7, 2026):
You check out https://github.com/silveroxides/ComfyUI-QuantOps
It has int8 support without having to do SDNQ. I quantized some TE to int8 and visual performance matched GGUF but with more speed.
I also have been cheating activations with https://github.com/Ph0rk0z/SageAttention2, in the case of FP8 it's faster. Am also kinda topping out at 1.25it/s for 896x1152 chromas/z-images/fluxes
@silveroxides commented on GitHub (Mar 9, 2026):
@Ph0rk0z QuantOps now utilize my custom fork of comfy-kitchen:
https://github.com/silveroxides/comfy-kitchen
with prebuild wheels available at:
https://huggingface.co/silveroxides/Chroma1-HD-fp8-scaled/tree/main/experimental
If combined with this PR (Because annoyingly ComfyUI disables triton on comfy-kitchen):
https://github.com/Comfy-Org/ComfyUI/pull/12730
Then you can run models using tensorwise int8 with matmul faster than ComfyUI core fp8 even.
This should be supported on 30,40 and 50-series cards.
@Ph0rk0z commented on GitHub (Mar 9, 2026):
Yup, I have been hacking branches of your kitchen to get rid of unsupported FP8 functions in cuda and force-enabling triton. Its very hard to choose which branch though. I have to guestimate by commits. Also made it run on cuda 12.6 and bypassed those checks. So far model goes:https://github.com/BobJohnson24/ComfyUI-INT8-Fast and TE is off your plugin.
Whether it's faster than compiled FP8 with patched triton is hit or miss but I think int8 quality is slightly better and less prone to breaking when using mixed FP8 quants.
@silveroxides commented on GitHub (Mar 10, 2026):
@Ph0rk0z
it is main now and pre-built wheels exist
https://github.com/Comfy-Org/ComfyUI/issues/12830#issuecomment-4030593734
@Ph0rk0z commented on GitHub (Mar 11, 2026):
Main seems to be working. Outputs are a little different from the old int8 branch. Not sure if for better or for worse. I think the TE is better but I've only used the int8-fast for chroma itself. I'll double check it works with models too, last time it didn't work with tensworwise.
@silveroxides commented on GitHub (Jun 2, 2026):
My PR is finally up. https://github.com/Comfy-Org/comfy-kitchen/pull/37