FP8-Dynamic quant for Idefics2-8B-Llama3, requires about ~12 GB

vLLM usage

vllm serve leon-se/Idefics3-8B-Llama3-FP8-Dynamic --trust-remote-code

Code used for quantization

from transformers import AutoProcessor, AutoModelForVision2Seq
from llmcompressor.modifiers.quantization import QuantizationModifier
from llmcompressor.transformers import oneshot

model_name = "HuggingfaceM4/Idefics3-8B-Llama3"

processor = AutoProcessor.from_pretrained(model_name)
model = AutoModelForVision2Seq.from_pretrained(model_name, device_map="cuda", torch_dtype="auto", trust_remote_code=True)

recipe = QuantizationModifier(
    targets="Linear",
    scheme="FP8_DYNAMIC",
    ignore=["re:.*lm_head", "re:model.vision_model.*", "re:model.connector.*"],
)

SAVE_DIR = model_name.split("/")[1] + "-FP8-Dynamic"
oneshot(model=model, recipe=recipe, output_dir=SAVE_DIR)
processor.save_pretrained(SAVE_DIR)
Downloads last month
36
Safetensors
Model size
8.46B params
Tensor type
BF16
·
F8_E4M3
·
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and HF Inference API was unable to determine this model's library.

Model tree for leon-se/Idefics3-8B-Llama3-FP8-Dynamic

Quantized
(3)
this model