Instructions to use intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound
- SGLang
How to use intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound with Docker Model Runner:
docker model run hf.co/intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound
Configuration Parsing Warning:In UNKNOWN_FILENAME: "quantization_config.config_groups.group_0.format" must be a string
Model Details
This model is an MXFP8 (W8A8, group_size 32) model of tencent/Hy4-flash-FP8 generated by intel/auto-round using RTN. Please follow the license of the original model.
- Quantized (MXFP8): routed experts, attention query up-projection, attention gate and output projections, DFly draft layers
- Kept in BF16: dense layer, attention latent projections, shared experts, expert latent projections, router, sparse-attention indexer, Engram embeddings, vision tower, embeddings, lm_head
Generate the Model
git clone https://github.com/intel/auto-round.git && cd auto-round
git checkout 1586bc6f64b4702981ff249810971c347fdc67ad
curl -L https://huggingface.co/intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound/resolve/main/autoround_hy4flash_fused_scale_inv.patch | git apply
uv pip install -e . compressed-tensors
uv pip install git+https://github.com/ManaEstras/transformers.git@c2ec850510a37978ea83df226589623d5f2be776
auto-round \
--model_name tencent/Hy4-flash-FP8 \
--scheme MXFP8 \
--model_free \
--ignore_layers q_a_proj,kv_a_proj_with_mqa,kv_b_proj,model.layers.0.self_attn,model.layers.0.mlp,shared_experts,routed_expert_down_proj,routed_expert_up_proj,compressed_indexer,engram_layer,vit.,hidden_correction,mtp_fusion,confidence_head,lm_head \
--format llm_compressor \
--output_dir Hy4-flash-FP8-MXFP8-CT-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: Sun, Xuehao xuehao.sun@intel.com
- Downloads last month
- 100
Model tree for intel-ai/Hy4-flash-FP8-MXFP8-CT-AutoRound
Base model
tencent/Hy4-flash-FP8