mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[GH-ISSUE #78] ROCm/gfx1201 INT8 ConvRot: eager fallback is very slow, global Triton crashes, selective Triton int8_linear works #27
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#27
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 @flexusjan on GitHub (Jul 18, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/78
ROCm/gfx1201 INT8 ConvRot: eager fallback is very slow, global Triton crashes, selective Triton
int8_linearworksSummary
On an AMD Radeon RX 9070 XT (
gfx1201) with ROCm 7.2, INT8 ConvRot models work only through the safe eager fallback, but the fallback is much slower than FP8. Enabling the global comfy-kitchen Triton backend crashes the process with a ROCm GPU memory access fault.However, a narrow workaround that keeps comfy-kitchen
cudaandtritondisabled globally, but routes only ConvRotint8_linearfrom eager tocomfy_kitchen.backends.triton.quantization.int8_linear, is stable and much faster on this machine.This looks like the ROCm INT8 ConvRot path needs more granular backend selection: Triton
int8_linearappears usable, while global Triton/RoPE and the CUDA/nanobind backend paths are not safe on this setup.I searched for related reports first. The closest ComfyUI issues I found are related but not exact:
Environment
Linux archlinux 7.1.3-arch2-2 #1 SMP PREEMPT_DYNAMIC Thu, 16 Jul 2026 17:41:28 +0000 x86_64 GNU/Linuxgfx12017.1.3-arch2-20.28.04800e78518ebb1f2a9443ea5418edbff6c3935f93.13.142.12.1+rocm7.27.2.53211torch.version.cuda:None3.7.10.2.22ComfyUI reports the device as:
Model / workflow tested
The repro workflow is a Krea2 1 MP portrait workflow using:
Krea2_Turbo_convrot_int8mixed.safetensorsqwen3vl_4b_uncensored_int8_convrot.safetensorsqwen_image_vae.safetensorseuler,simple8112:3 (Portrait Photo),1 MPThe full ComfyUI workflow uses a few custom nodes, but the backend failures below can also be reproduced with small standalone comfy-kitchen tensor calls. The custom nodes do not appear to be the root cause.
Expected behavior
On ROCm/gfx1201, comfy-kitchen should be able to use the fast INT8 ConvRot linear path without enabling unsafe global Triton/RoPE paths and without attempting the CUDA/nanobind backend path that currently fails on ROCm.
Ideally the backend dispatcher would support a narrower capability selection such as:
cudabackend disabled whentorch.version.cuda is Noneint8_linearwhen:torch.version.hip is not Nonegfx11xx/gfx12xxMinimal standalone repros
CUDA backend on ROCm: PyCapsule/nanobind argument error
This reproduces the CUDA backend binding problem without a ComfyUI workflow:
On this system that selects:
and fails with:
Selective Triton
int8_linearworks if weights are quantized through eagerThis isolates the working fast path:
Observed output:
Actual behavior
1. Clean safe fallback is stable but too slow
With the default safe behavior where comfy-kitchen
cudaandtritonbackends are disabled on ROCm, the ConvRot model is stable but very slow:For comparison, an FP8 Krea2 model in the same workflow is around:
2. Enabling the global Triton backend crashes
Starting ComfyUI with global Triton enabled for comfy-kitchen causes a process crash during the INT8 ConvRot workflow:
This is not just a Python exception; the Python process aborts.
3. Enabling/forcing the comfy-kitchen CUDA backend on ROCm hits nanobind/PyCapsule errors
If the comfy-kitchen CUDA backend is allowed/forced on ROCm, backend functions fail with argument binding errors like:
Related failures were also seen in other CUDA backend functions:
Workaround found
The following narrow patch was tested locally in
comfy_kitchen/backends/eager/quantization.py.It leaves comfy-kitchen
cudaandtritondisabled globally, but for ROCm ConvRotint8_linearonly, it directly calls the Tritonint8_linearimplementation:This is not meant as a final upstream patch because it bypasses the backend registry, but it demonstrates that the Triton INT8 linear path itself can work on this ROCm/gfx1201 system if selected narrowly.
Results with workaround
Same workflow, same model, same settings:
Sampler progress for hot runs was around
7.9s; the rest appears to be model/VAE memory movement under--reserve-vram 1.5.So the selective Triton
int8_linearworkaround is:Notes
This may overlap with native INT8 ConvRot support work in ComfyUI, but this report is specifically about current comfy-kitchen backend behavior on ROCm/gfx1201:
int8_linearimplementation itself appears usable and fast when called narrowly.@coderabbitai[bot] commented on GitHub (Jul 18, 2026):
⚠️ Possible Duplicate Issue(s)
🧪 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!
@0xDELUXA commented on GitHub (Jul 18, 2026):
I have a genuine question. Why are you using
--use-pytorch-cross-attentionon RDNA4? We have SageAttention v1, FlashAttention 2 via Triton, and even SageAttention v2 implemented with WMMA. They all perform significantly better.@Jules-A commented on GitHub (Jul 18, 2026):
I didn't have much luck with SageAttention v1 and found better results with FlashAttention v2 (at least in the ROCm fork), how do you get SageAttention v2 working and if so how come that's not available by default in that fork?
@0xDELUXA commented on GitHub (Jul 18, 2026):
Jam opened a proper Sage2 PR with WMMA kernels for RDNA4: https://github.com/thu-ml/SageAttention/pull/368.
There are also different Sage2 forks made by various community members that only have Triton backends. Based on my experience, they're not really worth using on RDNA4.
I'm not sure what you mean by "... and if so how come that's not available by default in that fork?" Which one are you referring to, ROCm/flash-attention? They're different projects.
@Jules-A commented on GitHub (Jul 18, 2026):
This fork of ComfyUI: https://github.com/patientx-cfz/comfyui-rocm
@0xDELUXA commented on GitHub (Jul 18, 2026):
Sage2 has to be built from source, and we don't plan to include things like this in
comfyui-rocm.@flexusjan commented on GitHub (Jul 19, 2026):
@0xDELUXA thanks for pointing this out. I re-tested the attention backends on the same Krea2 Turbo INT8 ConvRot workflow instead of assuming
--use-pytorch-cross-attentionwas the best choice.Setup:
torch 2.12.1+rocm7.20.28.00.2.22Krea2_Turbo_convrot_int8mixed.safetensors--reserve-vram 1.5 --disable-pinned-memory --enable-managerrocm-smiResults:
--use-sage-attentionFLASH_ATTENTION_TRITON_AMD_ENABLE=TRUE --use-flash-attention--use-pytorch-cross-attentionSo yes, that was a useful pointer for RDNA4. In this workflow, SageAttention v2 built from the gfx12/WMMA PR is the fastest option I tested, and FlashAttention 2 is also faster than PyTorch cross attention.
The original comfy-kitchen INT8 ConvRot issue still remains separate from the attention backend choice: without the local ConvRot workaround, this workflow was much slower on ROCm. With the workaround plus SageAttention v2, INT8 ConvRot is now faster than my previous FP8 baseline.
@flexusjan commented on GitHub (Aug 3, 2026):
Closing this as resolved by the official HIP backend work that has since landed in comfy-kitchen.
I re-tested the original ROCm/gfx1201 INT8 ConvRot scenario on comfy-kitchen 0.2.26 with ComfyUI 0.30.0 and torch 2.12.1+rocm7.2. With the ROCm visible device set restricted to the RX 9070 XT, the HIP backend advertises the relevant native capabilities including
int8_linearand ConvRot support, and the Krea2 INT8 ConvRot workflow is back in the expected performance range:The slow path I reproduced after updating was caused by the process exposing both
gfx1201andgfx1036. In that mixed visible-device configuration, comfy-kitchen correctly registers HIP as elementwise-only because not every visible device has WMMA, soint8_linearcan fall back to eager when Triton/CUDA are disabled by ComfyUI. Restricting ROCm visibility fixes that local setup issue, for example:I also closed #81 because it was only a pre-HIP-backend workaround. If there is still a desired upstream improvement here, I think it should be a separate issue around mixed ROCm visible-device handling or clearer diagnostics, not the old eager-to-Triton workaround.
@alecz20 commented on GitHub (Aug 9, 2026):
I haven't seen this comparison here, so here it goes:
My anecdotal evidence shows 100% speed increase in int8_convort Sampling speed between comfy-kitchen 0.2.24 and 0.2.28 with Krea2_turbo. (RX 7900XT, 1024x1024 latent):
comfy-kitchen 0.2.24: 3.76 s/it
comfy-kitchen 0.2.28: 1.84 s/it
this is only slightly faster than fp8 which takes about 1.90s/it.
Good work!
@0xDELUXA commented on GitHub (Aug 9, 2026):
Thanks! A lot has improved between 0.2.24 and 0.2.28, including the new HIP backend, so it’s not all down to that. Either way, great to see AMD getting better in ComfyUI! 🚀