mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #113] [CLOSED] Fix Triton HIP backend crash: libdevice.rint missing on ROCm #155
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#155
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/113
Author: @wlkns-dev
Created: 8/12/2026
Status: ❌ Closed
Base:
main← Head:fix/hip-libdevice-rint📝 Commits (1)
d9882a5Fix Triton HIP backend crash: libdevice.rint missing on ROCm📊 Changes
2 files changed (+26 additions, -3 deletions)
View changed files
📝
comfy_kitchen/backends/triton/quantization.py(+12 -1)📝
comfy_kitchen/backends/triton/w4a8_int8.py(+14 -2)📄 Description
Summary
triton.language.extra.hip.libdevicehas norint()(round-half-to-even), onlynearbyint()with equivalent rounding semantics (differs only in floating-point exception flags, irrelevant for these int8 quantization kernels). The CUDAlibdevicedoes haverint().triton.language.extra.libdevicedispatcher module always exposesrintas an attribute regardless of the active backend — it resolves the concrete implementation at kernel trace/compile time, not at Python import time. So a naivehasattr(libdevice, "rint")check on that dispatcher is alwaysTrueand can't be used to detect the missing symbol; the concrete backend submodule (triton.language.extra.hip.libdevice) must be checked instead.AsymW4A8Int8model (e.g. quantized diffusion models loaded viaUNETLoader) crashes on the first sampling step on ROCm with:Test plan
gfx1200, ROCm 6.4, PyTorch2.8.0+rocm6.4, Triton3.4.0).AttributeErrorabove.torch.version.hip is Noneon CUDA systems, so thecuda.libdevicebranch (unchanged behavior, still usesrint) is taken.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.