Views
No views yet
1vllm serve RedHatAI/Qwen3.5-4B-FP8-dynamic \
2 --reasoning-parser qwen3 \
3 --max-model-len 2621441vllm serve RedHatAI/Qwen3.5-4B-FP8-dynamic \
2 --reasoning-parser qwen3 \
3 --max-model-len 262144 \
4 --language-model-only1from openai import OpenAI
2
3openai_api_key = "EMPTY"
4openai_api_base = "http://localhost:8000/v1"
5
6client = OpenAI(
7 api_key=openai_api_key,
8 base_url=openai_api_base,
9)
10
11model = "RedHatAI/Qwen3.5-4B-FP8-dynamic"
12
13messages = [
14 {"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
15]
16
17outputs = client.chat.completions.create(
18 model=model,
19 messages=messages,
20)
21
22generated_text = outputs.choices[0].message.content
23print(generated_text)1from compressed_tensors.utils import save_mtp_tensors_to_checkpoint
2from llmcompressor import oneshot
3from llmcompressor.modifiers.quantization import QuantizationModifier
4from transformers import AutoProcessor, AutoTokenizer, Qwen3_5ForConditionalGeneration
5
6MODEL_ID = "Qwen/Qwen3.5-4B"
7
8IGNORE_LAYERS = [
9 "re:.*lm_head",
10 "re:.*embed_tokens$",
11 "re:.*visual.*",
12 "re:.*model.visual.*",
13 "re:.*linear_attn.*",
14]
15
16model = Qwen3_5ForConditionalGeneration.from_pretrained(MODEL_ID, dtype="auto")
17tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
18processor = AutoProcessor.from_pretrained(MODEL_ID)
19
20recipe = QuantizationModifier(
21 targets="Linear",
22 scheme="FP8_DYNAMIC",
23 ignore=IGNORE_LAYERS,
24)
25
26oneshot(model=model, recipe=recipe)
27
28model.save_pretrained("Qwen3.5-4B-FP8-dynamic", save_compressed=True)
29processor.save_pretrained("Qwen3.5-4B-FP8-dynamic")
30save_mtp_tensors_to_checkpoint(source_model=MODEL_ID, dest_dir="Qwen3.5-4B-FP8-dynamic")llm-compressor==0.10.1.dev44+g437f8afecompressed-tensors==0.14.1a20260325transformers==5.3.0vllm==0.18.1lm-eval — neuralmagic/lm-evaluation-harness@741f1d8 (branch: mmlu-pro-chat-variant)lighteval — neuralmagic/lighteval@6f0f351 (branch: eldar-fix-litellm)| Category | Benchmark | Qwen/Qwen3.5-4B | RedHatAI/Qwen3.5-4B-FP8-dynamic | Recovery |
|---|---|---|---|---|
| Instruction Following | GSM8k-Platinum (0-shot) | 94.2% | 94.5% | 100.3% |
| MMLU-Pro (0-shot) | 79.3% | 79.1% | 99.9% | |
| IFEval — prompt strict (0-shot) | 88.0% | 88.4% | 100.5% | |
| IFEval — instruction strict (0-shot) | 91.2% | 91.6% | 100.4% | |
| Reasoning | Math 500 (0-shot) | 84.6% | 84.7% | 100.2% |
| AIME 2025 (0-shot) | 85.0% | 85.0% | 100.0% | |
| GPQA Diamond (0-shot) | 76.8% | 76.3% | 99.3% |
--language-model-only for all evaluations.1lm_eval --model local-chat-completions \
2 --tasks gsm8k_platinum_cot_llama \
3 --model_args "model=RedHatAI/Qwen3.5-4B-FP8-dynamic,max_length=96000,base_url=http://0.0.0.0:8000/v1/chat/completions,num_concurrent=100,max_retries=3,tokenized_requests=False,tokenizer_backend=None,timeout=3600" \
4 --num_fewshot 0 \
5 --apply_chat_template \
6 --output_path results_gsm8k_platinum.json \
7 --seed <SEED> \
8 --gen_kwargs "do_sample=True,temperature=1.0,top_p=0.95,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0,max_gen_toks=65536,seed=<SEED>"1lm_eval --model local-chat-completions \
2 --tasks mmlu_pro_chat \
3 --model_args "model=RedHatAI/Qwen3.5-4B-FP8-dynamic,max_length=96000,base_url=http://0.0.0.0:8000/v1/chat/completions,num_concurrent=100,max_retries=3,tokenized_requests=False,tokenizer_backend=None,timeout=3600" \
4 --num_fewshot 0 \
5 --apply_chat_template \
6 --output_path results_mmlu_pro.json \
7 --seed <SEED> \
8 --gen_kwargs "do_sample=True,temperature=1.0,top_p=0.95,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0,max_gen_toks=65536,seed=<SEED>"1lm_eval --model local-chat-completions \
2 --tasks ifeval \
3 --model_args "model=RedHatAI/Qwen3.5-4B-FP8-dynamic,max_length=96000,base_url=http://0.0.0.0:8000/v1/chat/completions,num_concurrent=100,max_retries=3,tokenized_requests=False,tokenizer_backend=None,timeout=3600" \
4 --num_fewshot 0 \
5 --apply_chat_template \
6 --output_path results_ifeval.json \
7 --seed <SEED> \
8 --gen_kwargs "do_sample=True,temperature=1.0,top_p=0.95,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0,max_gen_toks=65536,seed=<SEED>"1lighteval endpoint litellm \
2 "model_name=hosted_vllm/RedHatAI/Qwen3.5-4B-FP8-dynamic,provider=hosted_vllm,base_url=http://0.0.0.0:8000/v1,timeout=3600,concurrent_requests=100,generation_parameters={temperature:1.0,max_new_tokens:65536,top_p:0.95,top_k:20,min_p:0.0,presence_penalty:1.5,repetition_penalty:1.0,seed:<SEED>}" \
3 "math_500@k=1@n=1|0" \
4 --output-dir results_math500 \
5 --save-details1lighteval endpoint litellm \
2 "model_name=hosted_vllm/RedHatAI/Qwen3.5-4B-FP8-dynamic,provider=hosted_vllm,base_url=http://0.0.0.0:8000/v1,timeout=3600,concurrent_requests=100,generation_parameters={temperature:1.0,max_new_tokens:65536,top_p:0.95,top_k:20,min_p:0.0,presence_penalty:1.5,repetition_penalty:1.0,seed:<SEED>}" \
3 "aime25@k=1@n=1|0" \
4 --output-dir results_aime25 \
5 --save-details1lighteval endpoint litellm \
2 "model_name=hosted_vllm/RedHatAI/Qwen3.5-4B-FP8-dynamic,provider=hosted_vllm,base_url=http://0.0.0.0:8000/v1,timeout=3600,concurrent_requests=100,generation_parameters={temperature:1.0,max_new_tokens:65536,top_p:0.95,top_k:20,min_p:0.0,presence_penalty:1.5,repetition_penalty:1.0,seed:<SEED>}" \
3 "gpqa:diamond@k=1@n=1|0" \
4 --output-dir results_gpqa_diamond \
5 --save-details