mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #155] [CLOSED] [Feat][Ascend] Add fused RotateQuant backend #181
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#181
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/155
Author: @Big2Wheel
Created: 9/4/2026
Status: ❌ Closed
Base:
main← Head:codex/ascend-rotate-quant📝 Commits (7)
5942faefeat(npu): add Ascend quantization backend1ecb943test(npu): include NPU in supported devices0bccee7refactor(ascend): clarify backend naming6ab910afeat(ascend): add INT8 linear backend91a5a3ftest(ascend): handle optional quant matmul8651a6dfeat(ascend): add fused rotate quant backendd8dd6d8fix(ascend): handle zero quantization scales📊 Changes
7 files changed (+956 additions, -41 deletions)
View changed files
📝
README.md(+66 -38)📝
comfy_kitchen/__init__.py(+1 -0)➕
comfy_kitchen/backends/ascend/__init__.py(+445 -0)📝
comfy_kitchen/registry.py(+1 -1)📝
tests/conftest.py(+2 -2)➕
tests/test_ascend_backend.py(+424 -0)📝
tests/test_backends.py(+17 -0)📄 Description
What this PR does / why we need it
Adds an optional Huawei Ascend implementation of
quantize_and_rotate_rowwiseusingtorch_npu.npu_rotate_quantand integrates it into the Ascend ConvRot INT8 linear path.The backend:
npu_rotate_quantis available;_rotate_activation+npu_dynamic_quantpath for unsupported runtimes or shapes;Relationship to the other Ascend PRs
Once #151 and #153 are merged, this PR can be rebased onto
main, leaving only the RotateQuant-specific commits.Performance and memory
Measured on one Ascend 910B3 with real Z-Image activation shapes:
[32, 3840][8192, 3840][32, 10240][8192, 10240]NPU profiling at
[8192, 3840]confirms thataclnnMatmul + aclnnDynamicQuantV2is replaced byaclnnRotateQuant, reducing the combined device time by 18.05% across ten iterations.An alternating AB/BA Z-Image INT8 workflow test found no statistically meaningful end-to-end latency change; generated PNGs were pixel-identical. The fused operator uses additional temporary workspace: approximately 60 MiB at
[8192, 3840]and 160 MiB at[8192, 10240]relative to the separate path.Does this PR introduce any user-facing change?
Yes. Eligible
quantize_and_rotate_rowwisecalls and ConvRot Ascend INT8 linear calls automatically use the fused NPU operator. Unsupported configurations retain the existing fallback behavior.How was this patch tested?
npu_rotate_quantcalls.55 passed.660 passed, 1603 skipped, 1 warning.ruff check,ruff format --check, andgit diff --checkpassed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.