mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #215] [MERGED] Further optimize int8 GEMM (CORE-520) #226
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#226
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/215
Author: @kijai
Created: 9/29/2026
Status: ✅ Merged
Merged: 9/30/2026
Merged by: @comfyanonymous
Base:
main← Head:int8-l2-raster📝 Commits (2)
00a9cbeBand the int8 stream-K tile walk to keep weights in L292e9aa6Optimize for Ampere📊 Changes
6 files changed (+167 additions, -20 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/__init__.py(+25 -1)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+6 -0)📝
comfy_kitchen/backends/cuda/ops/cutlass_gemm_common.cuh(+49 -3)📝
comfy_kitchen/backends/cuda/ops/cutlass_gemm_int8.cu(+26 -16)📝
tests/test_int8.py(+48 -0)📝
tests/test_w6a8.py(+13 -0)📄 Description
The int8 GEMM's tile order re-streams a weight that outgrows L2 on every wave.
On a 5090 this read 20-26 GB per call for H3's fc1 at 32k tokens and dropped SM clocks under the power limit.
The stream-K swizzle now walks N in bands, band width depends on the card's L2:
sized to minimize what one wave reads, sqrt(SMs * tile_m / tile_n) tiles (6-8 on a
3080). Measured on a 3080: within 2% of the best width at any K, where 32 was up to
47% slower.
cannot stay in L2 only adds launches (up to 20% faster at M=512 on a 3080).
Bit-identical output, no new kernel instantiations. End to end gain in MiniMax-H3 workflow is modest ~2%, but free.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.