mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #248] [MERGED] Performance improvements for qwen 3.x (Part 2) #255
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#255
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/248
Author: @rattus128
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @comfyanonymous
Base:
main← Head:prs/qwen-3x-general-2📝 Commits (10+)
beb01d5Round W4A8 and W6A8 decode onto the INT8 grid without conversionsae30597Add clustered ConvRot quantization with fused input activationsa84bfa9Add quantized activation API with INT8 dispatch5126939Add the resident decode-layout hookba5b11bSupport W4A8 and W6A8 through the activation APIdc09a05Extract the canonical W4A8 chunked GEMM pathc03f18fSupport packed W4A8 and W6A8 weights in chunked GEMMfd835d5Extract shared W4A8 and W6A8 code packing helpersb836caeAdd packed W4A8 and W6A8 small-M MMA decode2f2dd58Fuse packed W4A8 and W6A8 input activations and residuals📊 Changes
17 files changed (+2024 additions, -157 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/__init__.py(+275 -74)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+208 -34)📝
comfy_kitchen/backends/cuda/ops/int8_linear.cu(+281 -0)📝
comfy_kitchen/backends/cuda/ops/w4a8_gemm.cu(+526 -11)📝
comfy_kitchen/backends/eager/__init__.py(+4 -0)📝
comfy_kitchen/backends/eager/w4a8_int8.py(+46 -34)📝
comfy_kitchen/backends/hip/__init__.py(+16 -0)📝
comfy_kitchen/backends/triton/w4a8_int8.py(+17 -0)📝
comfy_kitchen/constraints.py(+9 -0)📝
comfy_kitchen/tensor/base.py(+33 -0)📝
comfy_kitchen/tensor/int8.py(+16 -0)📝
comfy_kitchen/tensor/w4a8_int8.py(+103 -4)➕
comfy_kitchen/tensor/w4a8_packed.py(+111 -0)📝
tests/test_constraints.py(+40 -0)📝
tests/test_tensor.py(+41 -0)➕
tests/test_w4a8_mma.py(+274 -0)📝
tests/test_w4a8_requant.py(+24 -0)📄 Description
Part 2 of qwen 3.x LLM performance improvements.
The main change is w4a8 and w6a8 M<8 memory-bandwidth optimized GEMV kernels and weight relayout facilities.
Interleaving the weights and their scales allows for significantly less memory access churn by linearizing access and allows a higher steady state read of weights. Some kernels to relayout weights are added accordingly.
These kernels use the tensor-cores instead of dp4a, which is similar performance for M=1 but gives significant optimization for MTP structures up the M=8.
The API for linear_input_act and switching between kernels for quants is put behind an abstraction in CK.
Add the usual suspect fusions.
Theres a super arcane fp32 quantization optimization in there too.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.