Instructions to use intel-ai/HunyuanImage-3.0-Instruct-Distil-MXFP4-BF16Attn-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/HunyuanImage-3.0-Instruct-Distil-MXFP4-BF16Attn-AutoRound with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("intel-ai/HunyuanImage-3.0-Instruct-Distil-MXFP4-BF16Attn-AutoRound", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model Details
This model is an MXFP4 (mixed MXFP4 experts / MXFP8 shared, attention kept in BF16) model of tencent/HunyuanImage-3.0-Instruct-Distil generated by intel/auto-round using RTN. Please follow the license of the original model.
- Quantized (MXFP4): routed experts, shared MLP (MXFP8)
- Kept in BF16: attention, router, vision tower, embeddings, norms
How to Use
Environment
pip install vllm==0.29.0
uv pip install git+https://github.com/vllm-project/vllm-omni.git@1c7476ec19899f1e61838e23e9fad3505403b9b9
uv pip install flashinfer-python==0.6.18
vLLM Usage
vllm serve intel-ai/HunyuanImage-3.0-Instruct-Distil-MXFP4-BF16Attn-AutoRound \
--omni
Evaluation
DiT-Only Image Fidelity (TP2)
| Candidate | Topology | PSNR (dB) | SSIM@1 | SSIM@1/8 |
|---|---|---|---|---|
| BF16 (Reference) | 2 GPUs TP2 | Baseline | 1.0000 | 1.0000 |
| MXFP8 (all 8-bit, INC) | 2 GPUs TP2 | 32.77 | 0.9760 | 0.9813 |
| MXFP4-ar (attention MXFP8) | 2 GPUs TP2 | 19.51 | 0.8421 | 0.6627 |
| This build (attention BF16) | 2 GPUs TP2 | 19.60 | 0.8494 | 0.6699 |
Visual Comparisons
DiT-Only Pipeline Comparison (Figure A)
AR+DiT Pipeline Branches (Figure B)
| Build | AR output (conditioning text) | Tokens | Conditioning aspect |
|---|---|---|---|
| MXFP8 | It's a<boi><img_size_1024><img_ratio_14> |
6 | 896×1152 |
| MXFP4-ar | It's a warm and healing style<boi><img_size_1024><img_ratio_14> |
10 | 896×1152 |
| This build | sitting upright on a light-colored wooden floor.<boi><img_size_1024><img_ratio_9> |
12 | 576×1472 |
Weight-Space Relative L2 Deviation vs BF16 Base
| Module | Scheme | rel. L2 vs BF16 | MXFP4-ar (attn@MXFP8) |
|---|---|---|---|
| self_attn.qkv_proj (L0) / self_attn.o_proj (L31) | BF16 | 0.0000 | 0.0267 |
| mlp.shared_mlp.gate_and_up_proj (L0) / down_proj (L31) | MXFP8 | 0.0267 | 0.0267 |
| mlp.experts.* (sampled: L0/L15/L31) | MXFP4 | 0.1113 – 0.1125 | 0.1113 – 0.1125 |
| mlp.gate.wg router | BF16 | 0.0000 | 0.0000 |
Generate the Model
auto-round \
--model_name tencent/HunyuanImage-3.0-Instruct-Distil \
--model_free \
--scheme MXFP8 \
--layer_config "{.mlp.experts.:{bits:4,data_type:mx_fp}}" \
--ignore_layers "vision,guidance_emb,timestep_emb,timestep_r_emb,final_layer,wte,self_attn.qkv_proj,self_attn.o_proj" \
--format auto_round \
--output_dir HunyuanImage-3.0-Instruct-Distil-MXFP4-BF16Attn-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
- Downloads last month
- 44
Model tree for intel-ai/HunyuanImage-3.0-Instruct-Distil-MXFP4-BF16Attn-AutoRound
Base model
tencent/HunyuanImage-3.0-Instruct-Distil




