[PR #81] [CLOSED] Support ROCm INT8 ConvRot without CUDA backend #128

Closed
opened 2026-10-26 22:20:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/81
Author: @flexusjan
Created: 7/20/2026
Status: ❌ Closed

Base: main ← Head: fix/rocm-int8-convrot


📝 Commits (1)

  • af080b5 Support ROCm INT8 ConvRot without CUDA backend

📊 Changes

7 files changed (+309 additions, -81 deletions)

View changed files

📝 comfy_kitchen/backends/cuda/__init__.py (+76 -49)
📝 comfy_kitchen/backends/eager/quantization.py (+26 -4)
📝 tests/conftest.py (+20 -0)
📝 tests/test_backends.py (+36 -0)
📝 tests/test_convrot_w4a4.py (+10 -16)
📝 tests/test_int8.py (+138 -9)
📝 tests/test_integration.py (+3 -3)

📄 Description

Summary

  • skip NVIDIA CUDA backend registration when running under non-CUDA PyTorch builds, including ROCm and CPU-only PyTorch
  • keep ROCm ConvRot INT8 eager dispatch fast by routing only convrot=True int8_linear calls to the Triton fused implementation when Triton is importable
  • update CUDA-extension-specific tests so ROCm systems skip native CUDA extension coverage instead of aborting

Fixes #78.

Why this shape

Issue #78 shows that global Triton is unsafe on gfx1201/ROCm, while the narrow Triton int8_linear path is stable and fast for ConvRot INT8. This keeps cuda and global triton disabled in ComfyUI on ROCm, but preserves the one fast path needed by the reported workflow.

This is intentionally smaller than #74, which adds a full HIP backend and wheel packaging. It may overlap mechanically with #56 in eager/quantization.py, but it does not conflict conceptually: #56 improves the generic eager RDNA fallback, while this PR handles ROCm ConvRot INT8 by using the measured Triton fast path.

Tested

  • ruff check .
  • pytest tests/test_backends.py -q
  • HIP_VISIBLE_DEVICES=0 ROCR_VISIBLE_DEVICES=0 pytest tests/test_int8.py -q -> 68 passed, 39 skipped
  • HIP_VISIBLE_DEVICES=0 ROCR_VISIBLE_DEVICES=0 pytest tests/test_convrot_w4a4.py tests/test_integration.py -q -> 41 passed, 49 skipped
  • Local ComfyUI reproduction for #78 on RX 9070 XT / gfx1201 / ROCm 7.2 / PyTorch 2.12.1+rocm7.2, using a user-created Krea2 Turbo ConvRot INT8 workflow with this branch loaded via PYTHONPATH:
    • cold: 27.30s API / 26.98s ComfyUI log
    • warm: 8.01s API / 7.88s ComfyUI log

For comparison, the same local workflow with the previously installed workaround measured 28.35s API / 28.01s log cold and 8.01s API / 7.86s log warm.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-kitchen/pull/81 **Author:** [@flexusjan](https://github.com/flexusjan) **Created:** 7/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rocm-int8-convrot` --- ### 📝 Commits (1) - [`af080b5`](https://github.com/Comfy-Org/comfy-kitchen/commit/af080b5fcc054618d9966d5b603115d4383e184f) Support ROCm INT8 ConvRot without CUDA backend ### 📊 Changes **7 files changed** (+309 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `comfy_kitchen/backends/cuda/__init__.py` (+76 -49) 📝 `comfy_kitchen/backends/eager/quantization.py` (+26 -4) 📝 `tests/conftest.py` (+20 -0) 📝 `tests/test_backends.py` (+36 -0) 📝 `tests/test_convrot_w4a4.py` (+10 -16) 📝 `tests/test_int8.py` (+138 -9) 📝 `tests/test_integration.py` (+3 -3) </details> ### 📄 Description ## Summary - skip NVIDIA CUDA backend registration when running under non-CUDA PyTorch builds, including ROCm and CPU-only PyTorch - keep ROCm ConvRot INT8 eager dispatch fast by routing only `convrot=True` `int8_linear` calls to the Triton fused implementation when Triton is importable - update CUDA-extension-specific tests so ROCm systems skip native CUDA extension coverage instead of aborting Fixes #78. ## Why this shape Issue #78 shows that global Triton is unsafe on gfx1201/ROCm, while the narrow Triton `int8_linear` path is stable and fast for ConvRot INT8. This keeps `cuda` and global `triton` disabled in ComfyUI on ROCm, but preserves the one fast path needed by the reported workflow. This is intentionally smaller than #74, which adds a full HIP backend and wheel packaging. It may overlap mechanically with #56 in `eager/quantization.py`, but it does not conflict conceptually: #56 improves the generic eager RDNA fallback, while this PR handles ROCm ConvRot INT8 by using the measured Triton fast path. ## Tested - `ruff check .` - `pytest tests/test_backends.py -q` - `HIP_VISIBLE_DEVICES=0 ROCR_VISIBLE_DEVICES=0 pytest tests/test_int8.py -q` -> 68 passed, 39 skipped - `HIP_VISIBLE_DEVICES=0 ROCR_VISIBLE_DEVICES=0 pytest tests/test_convrot_w4a4.py tests/test_integration.py -q` -> 41 passed, 49 skipped - Local ComfyUI reproduction for #78 on RX 9070 XT / gfx1201 / ROCm 7.2 / PyTorch 2.12.1+rocm7.2, using a user-created Krea2 Turbo ConvRot INT8 workflow with this branch loaded via `PYTHONPATH`: - cold: 27.30s API / 26.98s ComfyUI log - warm: 8.01s API / 7.88s ComfyUI log For comparison, the same local workflow with the previously installed workaround measured 28.35s API / 28.01s log cold and 8.01s API / 7.86s log warm. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:20:39 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-kitchen#128
No description provided.