mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #205] Fall back to eager when a one-element INT8 scale adds leading dims #219
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#219
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/205
Author: @arcusbuilds
Created: 9/26/2026
Status: 🔄 Open
Base:
main← Head:fix/int8-one-element-scale-broadcast-main📝 Commits (1)
03847beFall back to eager when a one-element INT8 scale adds leading dims📊 Changes
4 files changed (+15 additions, -2 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/__init__.py(+1 -1)📝
comfy_kitchen/backends/hip/__init__.py(+1 -1)📝
tests/test_hip_wmma.py(+1 -0)📝
tests/test_int8.py(+12 -0)📄 Description
Fixes #204.
cuda and hip used scalar mode for any one-element scale. When that scale has more dims than
q, eager broadcasting adds leading dims, so the GPU backends returned a different shape. Scalar mode now also requiresscale.dim() <= q.dim(); other shapes go to the existing eager fallback.Tests
test_dequantize_one_element_scale_with_extra_dims_matches_eagerintests/test_int8.py. Fails without the fix ((3, 4, 32)vs eager(1, 3, 4, 32)), passes with it.pytest tests/test_int8.py -k dequantize: 8 passed (RTX 2000 Ada, sm_89).(1, 1, 1, 1)case totest_dequantize_int8_simple_dtype_matches_eagerintests/test_hip_wmma.py. Not run locally (no AMD GPU); the change is the same one-line guard as cuda.ruff checkclean on all changed files.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.