Instructions to use intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model Details
This model is an MXFP4 (W4A4, group_size 32) model of black-forest-labs/FLUX.2-klein-4B generated by intel/auto-round using RTN. Please follow the license of the original model.
- Quantized (MXFP4): transformer blocks
- Kept in BF16: text encoders / VAE
How to Use
Environment
uv pip install vllm==0.28.0
uv pip install git+https://github.com/lkk12014402/vllm-omni.git@5aa7e3d9c84a5e450aa037e142a7df1bfc9addb5
uv pip install flashinfer-python==0.6.18
vLLM Usage
vllm serve intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound \
--omni
Evaluation
| Benchmark | BF16 | MXFP4 | Recovery |
|---|---|---|---|
| CLIP | 32.07 | 32.44 | 101.15% |
| CLIP-IQA | 69.87 | 66.97 | 95.85% |
| ImageReward | 104.00 | 100.00 | 96.15% |
| GenEval | 82.19 | 79.97 | 97.30% |
| Average | 72.03 | 69.84 | 96.96% |
Generate the Model
auto-round \
--model_name black-forest-labs/FLUX.2-klein-4B \
--scheme MXFP4 \
--iters 0 \
--format auto_round \
--output_dir FLUX.2-klein-4B-MXFP4-RTN-AutoRound
Ethical Considerations and Limitations
The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs. Therefore, before deploying any applications of the model, developers should perform safety testing.
Caveats and Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. Here are a couple of useful links to learn more about Intel's AI software:
Disclaimer
The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
Cite
@article{cheng2023optimize,
title={Optimize weight rounding via signed gradient descent for the quantization of llms},
author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},
journal={arXiv preprint arXiv:2309.05516},
year={2023}
}
Signed-off-by: Lv, Kaokao kaokao.lv@intel.com
Model tree for intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound
Base model
black-forest-labs/FLUX.2-klein-4B