Views
No views yet
1from transformers import AutoModelForCausalLM
2from llmcompressor import oneshot
3from llmcompressor.modifiers.quantization import QuantizationModifier
4
5
6MODEL_ID = "mistralai/Devstral-Small-2507"
7model = AutoModelForCausalLM.from_pretrained(MODEL_ID, torch_dtype="auto")
8recipe = QuantizationModifier(
9 targets="Linear", scheme="FP8_DYNAMIC", ignore=["lm_head"]
10)
11oneshot(model=model, recipe=recipe)
12SAVE_DIR = MODEL_ID.rstrip("/").split("/")[-1] + "-FP8-Dynamic"
13model.save_pretrained(SAVE_DIR)vllm serve RedHatAI/Devstral-Small-2507-FP8-Dynamic --tensor-parallel-size 1 --tokenizer_mode mistral1evalplus.evaluate --model "RedHatAI/Devstral-Small-2507-FP8-Dynamic" \
2 --dataset [humaneval|mbpp] \
3 --base-url http://localhost:8000/v1 \
4 --backend openai --greedy| Recovery (%) | mistralai/Devstral-Small-2507 | RedHatAI/Devstral-Small-2507-FP8-Dynamic (this model) | |
|---|---|---|---|
| HumanEval | 100.67 | 89.0 | 89.6 |
| HumanEval+ | 102.22 | 81.1 | 82.9 |
| MBPP | 97.29 | 77.5 | 75.4 |
| MBPP+ | 98.03 | 66.1 | 64.8 |
| Average Score | 99.68 | 78.43 | 78.18 |