mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[GH-ISSUE #2] Bug: Scales do not persist in fp32 when LoRA is applied. #3
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#3
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?
Originally created by @silveroxides on GitHub (Jan 5, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/2
I am on ops-changes branch of ComfyUI.
There was no issues when no LoRA was being Loaded.
Model loaded: https://huggingface.co/silveroxides/Chroma1-HD-fp8-scaled/blob/main/Chroma1-HD-fp8matmulmixed_large_rev2.safetensors
LoRA used: https://huggingface.co/silveroxides/Chroma-LoRAs/blob/main/flash-heun-pruned/chroma-flash-heun_r01-fp32-pruned.safetensors
workflow: comfy-kitchen-test.json
@silveroxides commented on GitHub (Jan 5, 2026):
SideNote. My triton should be able to so something is not correct with how triton backend is done.
@contentis commented on GitHub (Jan 6, 2026):
There are two errors here.
1. comfy_kitchen.exceptions.NoCapableBackendError: No backend can handle 'dequantize_per_tensor_fp8': triton: scale: dtype torch.float16 not in {torch.float32}; eager: scale: dtype torch.float16 not in {torch.float32}
This is trying to use the DQ + BF16 GEMM fallback. The constraint for DQ occurs from here: https://github.com/Comfy-Org/comfy-kitchen/blob/main/comfy_kitchen/backends/triton/init.py#L42 For triton and eager we can loosen this requirement by adding bf16/f16 as scale dtypes.
2. FP8 _scaled_mm failed: Invalid scaling configuration.
For running the actual FP8 GEMM there is a strict requirement for having FP32 scales when doing per-tensor scaling. We can either have an implicit cast, which isn't super clean IMO as this can induce an additional kernel launch for a singular value, or resolve it at load time, which I would prefer.
@silveroxides commented on GitHub (Jan 6, 2026):
There were never anything other than FP32 scales. Also seems that triton was disabled anyway making even testing it hard. Would also prefer implementing int8 triton kernel as in this PR https://github.com/comfyanonymous/ComfyUI/pull/10864. I have had to workaround the sudden deprecations of fp8_scaled and figuring out how to best handle this throughtout my custom nodes and quantization tool.
Pre-deprecation node
ComfyUI_Hybrid-Scaled_fp8-Loader
Post-deprecation node
ComfyUI-QuantOps
Fully featured Quantization toolkit with CLI and implements LearnedRounding and bias correction for tensor-wise which allowed me to quantize all linear layers in Flux2-dev model with absolute minimal loss in accuracy.
convert_to_quant
They were FP32. Did you actually look at the state dict of the model loaded?
@isaac-mcfadyen commented on GitHub (Jan 6, 2026):
The linked PR that addresses this is only present in
0.2.2which was just released:github.com/Comfy-Org/comfy-kitchen@2e15fc3562