mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[GH-ISSUE #98] CUTLASS INT8 dequant selects poor config for tall MiniMax H3 shapes on RTX A6000 #30
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#30
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 @Many0therFunctions on GitHub (Aug 7, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/98
Summary
The automatic
cutlass_int8_dequantdispatch appears to select a poor CUTLASS configuration for tall sequence shapes on an NVIDIA RTX A6000 (sm86). The exact MiniMax H3 projection shapes from ComfyUI logs reach the CUTLASS path, but QKV is nearly no faster than BF16 until a faster compiled configuration is selected explicitly.Environment:
M = 80661tokensReproduction
The four production projection shapes are:
ComfyUI logs show the normal path:
Production timings for one projection call on the A6000:
The extension exposes
benchmark_cutlass_int8_dequant_config. Sweeping the available configs for the same QKV tensors produced:An end-to-end test using the existing ConvRot activation quantizer plus explicit CUTLASS config 0 measured approximately
89.5 ms, versus144.3 msthrough the normal automatic call.For the same
M, the fastest configurations were:Expected behavior
The automatic CUTLASS selection should benchmark or select a configuration based on the actual
(M, N, K, device)geometry, or use a shape heuristic that handles tall sequence lengths. A fixed/default configuration is especially problematic becauseMis the packed MiniMax sequence length and varies with video duration, spatial resolution, audio length, text, and reference media.The QKV and MLP-up shapes are architecture-fixed in
N/K, butMchanges with the workflow's packed sequence length. The issue is therefore not specific to one literalM=80661; the dispatcher should account for tallMand wideN.Could you expose the chosen CUTLASS config in diagnostics and add a benchmark/heuristic path for these tall Ampere shapes? The existing benchmark binding made the discrepancy straightforward to verify.
The full benchmark script and logs can be provided if useful.
@coderabbitai[bot] commented on GitHub (Aug 7, 2026):
🔗 Related PRs
Comfy-Org/comfy-kitchen#88 - Add swiglu input_act and partial-rotary rot_dim for rms_rope [merged]
Comfy-Org/comfy-kitchen#90 - Add optimized w4a8 with int8 codebook [merged]
Comfy-Org/comfy-kitchen#94 - HIP: fix RDNA4 GEMM tile selection, vectorize fp8 elementwise kernels [open]
Comfy-Org/comfy-kitchen#96 - a4w8: use frozen codebook LUT + row-chunked quantize, improve LoRA application [merged]
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
@Many0therFunctions commented on GitHub (Aug 7, 2026):
Additional sm86 tuning results
I completed a resumable sweep on an RTX A6000 (sm86), covering:
M = 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 49152, 65536, 80661, 98304The relevant configurations are:
128x256x64, ordinary identity scheduling128x256x64, Lean Stream-K schedulingThe stable sm86 result is:
I then validated neighboring geometries:
For
M >= 12288, config 0 beat config 13 by approximately 1.62x-1.76x across the tested region. AtM=8192, config 0 and config 13 were often close, so the threshold is deliberately conservative.The reason is architectural: the A6000 has 84 SMs and the MiniMax QKV has
N/256 = 84output tiles. The ordinary identity tile already provides good coverage; Stream-K adds reduction/scheduling overhead without solving an occupancy problem.I also built a local
sm86-only CUTLASS wheel with this selector branch:Validation of the rebuilt wheel:
The selector branch is scoped to sm86 and leaves other architectures unchanged. The source also needs explicit
sm86in the default CUDA architecture list; the current Linux default omitted it and built75,80,89,90a,100f,120f.The local patch and complete CSV tuning matrix are available if maintainers want them.