mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #34] [CLOSED] Fix FP8 dequantization on MPS by falling back to CPU #91
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#91
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/34
Author: @snwchd71
Created: 4/4/2026
Status: ❌ Closed
Base:
main← Head:fix/mps-fp8-dequantize📝 Commits (1)
2d427c4Fix FP8 dequantization on MPS by falling back to CPU📊 Changes
2 files changed (+67 additions, -0 deletions)
View changed files
📝
comfy_kitchen/backends/eager/quantization.py(+18 -0)📝
tests/test_qdq.py(+49 -0)📄 Description
Summary
MPS (Apple Silicon) does not support FP8 dtype conversion, causing
dequantize_per_tensor_fp8()to crash with:This adds an explicit device + dtype guard to dequantize on CPU and transfer only the final result back to MPS. Includes a one-time
logger.warningfor visibility.torch.equalPrior work
stochastic_rounding,quant_ops.py). Both fixes are needed for end-to-end FP8 on MPS, confirmed by @vSnake87 on M3 Max.Test plan
test_dequantize_fp8_cpu_fallback_correctness— verifies fallback math is bit-identical to standard path (runs in CI, parametrized float16/bfloat16)test_dequantize_fp8_on_mps_device— end-to-end on actual MPS hardware (skipped in CI, parametrized float16/bfloat16)ruff checkclean🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.