[GH-ISSUE #38] FP8 E4M3 quantized models inference is slower than same model quantized in MXFP8 #18

Open
opened 2026-10-26 22:19:10 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @matalama80td3l on GitHub (May 18, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/38

It's quite weird. I think mxfp8 inference is a bit more complex than the legacy fp8e4m3. So does it mean we still have some potential in legacy fp8 inference?

Originally created by @matalama80td3l on GitHub (May 18, 2026). Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/38 It's quite weird. I think mxfp8 inference is a bit more complex than the legacy fp8e4m3. So does it mean we still have some potential in legacy fp8 inference?
Author
Owner

@matalama80td3l commented on GitHub (May 18, 2026):

Hardware: 5060ti
sageattn2
qwen-edit in mxfp8
Image

qwen-edit in fp8

Image
<!-- gh-comment-id:4474092644 --> @matalama80td3l commented on GitHub (May 18, 2026): Hardware: 5060ti sageattn2 qwen-edit in mxfp8 <img width="2702" height="134" alt="Image" src="https://github.com/user-attachments/assets/06b17c88-0e13-4e76-ae53-bd9bcbcb7891" /> qwen-edit in fp8 <img width="2610" height="86" alt="Image" src="https://github.com/user-attachments/assets/74e78a69-b2a2-434c-949f-cecf52aa1626" />
Author
Owner

@contentis commented on GitHub (May 20, 2026):

The speed of FP8 and MXFP8 should be more or less the same - for the FP8 run, did you use a PTQ checkpoint or does this use some sort of dynamic scaling as this is where FP8 can get slow.

<!-- gh-comment-id:4498735778 --> @contentis commented on GitHub (May 20, 2026): The speed of FP8 and MXFP8 should be more or less the same - for the FP8 run, did you use a PTQ checkpoint or does this use some sort of dynamic scaling as this is where FP8 can get slow.
Author
Owner

@matalama80td3l commented on GitHub (May 22, 2026):

The speed of FP8 and MXFP8 should be more or less the same - for the FP8 run, did you use a PTQ checkpoint or does this use some sort of dynamic scaling as this is where FP8 can get slow.

I'm using this qwen-image-edit checkpoint, and it used fp8 without per-tensor scale factor. I wrote a script to transfer all diffusion fp8 tensors to mxfp8 by making all E8M0 block-scale factors equals 0 so I get a same mxfp8 model.

<!-- gh-comment-id:4516783242 --> @matalama80td3l commented on GitHub (May 22, 2026): > The speed of FP8 and MXFP8 should be more or less the same - for the FP8 run, did you use a PTQ checkpoint or does this use some sort of dynamic scaling as this is where FP8 can get slow. I'm using this [qwen-image-edit checkpoint](https://huggingface.co/Phr00t/Qwen-Image-Edit-Rapid-AIO/blob/main/v16/Qwen-Rapid-AIO-NSFW-v16.safetensors), and it used fp8 without per-tensor scale factor. I wrote a script to transfer all diffusion fp8 tensors to mxfp8 by making all E8M0 block-scale factors equals 0 so I get a same mxfp8 model.
Author
Owner

@contentis commented on GitHub (Jun 2, 2026):

The speed of FP8 and MXFP8 should be more or less the same - for the FP8 run, did you use a PTQ checkpoint or does this use some sort of dynamic scaling as this is where FP8 can get slow.

I'm using this qwen-image-edit checkpoint, and it used fp8 without per-tensor scale factor. I wrote a script to transfer all diffusion fp8 tensors to mxfp8 by making all E8M0 block-scale factors equals 0 so I get a same mxfp8 model.

If you don't use a calibrated checkpoint (no scales) I would assume that it will do dynamic quantization which results in an all-reduce operations that can be very costly.

Btw, for MXFP8 there is a sample here https://github.com/Comfy-Org/comfy-kitchen/blob/main/samples/mxfp8_model_patcher.py that can patch the model on the fly.

<!-- gh-comment-id:4599567930 --> @contentis commented on GitHub (Jun 2, 2026): > > The speed of FP8 and MXFP8 should be more or less the same - for the FP8 run, did you use a PTQ checkpoint or does this use some sort of dynamic scaling as this is where FP8 can get slow. > > I'm using this [qwen-image-edit checkpoint](https://huggingface.co/Phr00t/Qwen-Image-Edit-Rapid-AIO/blob/main/v16/Qwen-Rapid-AIO-NSFW-v16.safetensors), and it used fp8 without per-tensor scale factor. I wrote a script to transfer all diffusion fp8 tensors to mxfp8 by making all E8M0 block-scale factors equals 0 so I get a same mxfp8 model. If you don't use a calibrated checkpoint (no scales) I would assume that it will do dynamic quantization which results in an all-reduce operations that can be very costly. Btw, for MXFP8 there is a sample here https://github.com/Comfy-Org/comfy-kitchen/blob/main/samples/mxfp8_model_patcher.py that can patch the model on the fly.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-kitchen#18
No description provided.