Support Online FP8 & NF4 Weight Quantization#14
Closed
Uxito-Ada wants to merge 0 commit into
Closed
Conversation
Uxito-Ada
force-pushed
the
support_torchao_fp8_int4
branch
from
July 22, 2026 08:02
e0f074a to
05d8b6b
Compare
Uxito-Ada
force-pushed
the
support_torchao_fp8_int4
branch
from
July 22, 2026 08:36
228080c to
f52846c
Compare
Collaborator
Author
|
WIP on documents |
Uxito-Ada
force-pushed
the
support_torchao_fp8_int4
branch
from
July 23, 2026 02:28
c4136cb to
5848332
Compare
Uxito-Ada
force-pushed
the
support_torchao_fp8_int4
branch
from
July 23, 2026 02:30
5848332 to
c0b277e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add online FP8 & NF4 weight-only quantization for DiT pipelines with torchao and bitsandbytes backend:
QuantType.TORCHAO_FP8andQuantType.BNB_NF4Motivation
Online weight-only quantization is necessary especially for models not natively providing quantized checkpoints:
Detailed data and comparison can be found in the following.
Type of Change
Changes Made
QuantType.TORCHAO_FP8,QuantType.BNB_NF4,QuantKernelBackend.TORCHAOandQuantKernelBackend.BITSANDBYTEStelefuser.ops.torchao_fp8_linearandtelefuser.ops.bnb_nf4_linearqwen_image_t2i_torchao_fp8_h100.pyandqwen_image_t2i_bnb_nf4_h100.py, as well as according documentsBenchmark Setup
A cat playing pianoPerformance Results
Image Quality Comparison
Testing
pytest tests/)Test commands:
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \ python examples/qwen_image/qwen_image_t2i_torchao_fp8_h100.py \ --model_root Qwen/Qwen-Image-2512 \ --prompt "A cat playing piano" \ --aspect_ratio 1:1 \ --num_inference_steps 16 \ --seed 42Checklist
ruff)pre-commit run --all-files)pytest tests/)[TYPE] Brief descriptionGPU Architecture Support