mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #107] Add MPS fallback for INT8 linear #148
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#148
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/107
Author: @ikeyan
Created: 8/11/2026
Status: 🔄 Open
Base:
main← Head:codex/mps-int8-bf16-fallback📝 Commits (3)
7e189d2Add MPS fallback for INT8 lineara9f8906Add fused Metal 4 INT8 linear for MPSae14ebbTune fused MPS INT8 tiles for large matrices📊 Changes
3 files changed (+543 additions, -4 deletions)
View changed files
➕
comfy_kitchen/backends/eager/mps_int8.py(+308 -0)📝
comfy_kitchen/backends/eager/quantization.py(+82 -4)➕
tests/test_int8_mps.py(+153 -0)📄 Description
Summary
int8_linearon MPS through a floating-point fallback instead ofaten::_int_mmtorch._int_mmortorch.int8_mmWhy
PyTorch does not currently implement
aten::_int_mmfor MPS. The eager backend advertisesint8_linearon MPS, so Apple Silicon fails at the first quantized linear layer. This is the failure reported in #92.Handling the fallback at the
int8_linearlevel allows ComfyUI's normal BF16 execution path to remain on MPS. CPU and CUDA behavior are unchanged.Validation
PYTHONPATH=. .venv/bin/pytest tests/test_int8_mps.py— 6 passed on Apple M5 Max / MPSPYTHONPATH=. .venv/bin/pytest tests/test_int8.py tests/test_int8_mps.py— 42 passed, 64 skippedNotImplementedError: aten::_int_mm🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.