mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #191] [MERGED] Add w6a8 quantization support #208
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#208
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?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/191
Author: @kijai
Created: 9/22/2026
Status: ✅ Merged
Merged: 9/23/2026
Merged by: @comfyanonymous
Base:
main← Head:w6a8📝 Commits (4)
f1d394dAdd w6a8 quantization support89653b7ruff6eef282Bit fasterb10ac1fReject sub-16 group sizes for 6-bit weights📊 Changes
8 files changed (+678 additions, -231 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/__init__.py(+77 -53)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+39 -19)📝
comfy_kitchen/backends/cuda/ops/w4a8_gemm.cu(+102 -64)📝
comfy_kitchen/backends/eager/w4a8_int8.py(+210 -60)📝
comfy_kitchen/backends/hip/__init__.py(+24 -14)📝
comfy_kitchen/backends/triton/w4a8_int8.py(+20 -12)📝
comfy_kitchen/tensor/w4a8_int8.py(+32 -9)➕
tests/test_w6a8.py(+174 -0)📄 Description
W6A8: 6-bit weights on the INT8 GEMM path
Adds a 6-bit option to
AsymW4A8Int8Layout. Same kernels and checkpoint plumbing.6-bit is uniform (no codebook), symmetric, fp8 group scales, group size a multiple of 16.
On real MiniMax-H3 weights: ~3x lower weight error than W4A8 (0.024 vs 0.073 relL2) for
0.78 bytes/weight (int8: 1.0, W4A8: 0.56), at the same speed as W4A8, which is
int8 parity at H3 token counts.
Also switches the chunked W4A8/W6A8 linear to the faster 64-lane ConvRot
activation quantizer
int8_linearalready uses (~20% faster W4A8 at M=4096).Verified on the real H3
out_projlayer (N=5376, K=7168) at M=4096, RTX 5090:W6A8 timing is independent of group size (one fp8 scale per 16-column decode vector either way). Group sizes below 16 are not worth it and thus not supported.
Core side PR to use this: https://github.com/Comfy-Org/ComfyUI/pull/16483
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.