Views
No views yet
vllm serve RedHatAI/Qwen3-VL-235B-A22B-Instruct-FP8-block --tensor_parallel_size 41from openai import OpenAI
2
3# Modify OpenAI's API key and API base to use vLLM's API server.
4openai_api_key = "EMPTY"
5openai_api_base = "http://<your-server-host>:8000/v1"
6
7client = OpenAI(
8 api_key=openai_api_key,
9 base_url=openai_api_base,
10)
11
12model = "RedHatAI/Qwen3-VL-235B-A22B-Instruct-FP8-block"
13
14messages = [
15 {
16 "role": "user",
17 "content": [
18 {
19 "type": "image_url",
20 "image_url": {"url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"},
21 },
22 {"type": "text", "text": "Describe this image."},
23 ],
24 }
25]
26
27outputs = client.chat.completions.create(
28 model=model,
29 messages=messages,
30)
31
32generated_text = outputs.choices[0].message.content
33print(generated_text)1from transformers import AutoProcessor, Qwen3VLMoeForConditionalGeneration
2
3from llmcompressor import oneshot
4from llmcompressor.modeling import replace_modules_for_calibration
5from llmcompressor.modifiers.quantization import QuantizationModifier
6
7MODEL_ID = "Qwen/Qwen3-VL-235B-A22B-Instruct"
8
9# Load model.
10model = Qwen3VLMoeForConditionalGeneration.from_pretrained(MODEL_ID, torch_dtype="auto")
11processor = AutoProcessor.from_pretrained(MODEL_ID)
12model = replace_modules_for_calibration(model)
13
14# Configure the quantization algorithm and scheme.
15# In this case, we:
16# * quantize the weights to fp8 with per-block quantization
17# * quantize the activations to fp8 with dynamic token activations
18recipe = QuantizationModifier(
19 targets="Linear",
20 scheme="FP8_BLOCK",
21 ignore=[
22 "re:.*lm_head",
23 "re:visual.*",
24 "re:model.visual.*",
25 "re:.*mlp.gate$",
26 ],
27)
28
29# Apply quantization.
30oneshot(model=model, recipe=recipe)
31
32# Save to disk in compressed-tensors format.
33SAVE_DIR = MODEL_ID.rstrip("/").split("/")[-1] + "-FP8-block"
34model.save_pretrained(SAVE_DIR)
35processor.save_pretrained(SAVE_DIR)lm_eval \
--model vllm \
--model_args pretrained="RedHatAI/Qwen3-VL-235B-A22B-Instruct-FP8-block",dtype=auto,add_bos_token=True,max_model_len=4096,tensor_parallel_size=4,gpu_memory_utilization=0.8,enable_chunked_prefill=True \
--tasks openllm \
--write_out \
--batch_size auto \
--output_path output_dir \
--show_config1model_parameters:
2 model_name: RedHatAI/Qwen3-VL-235B-A22B-Instruct-FP8-block
3 dtype: auto
4 gpu_memory_utilization: 0.9
5 generation_parameters:
6 temperature: 0.6
7 min_p: 0.0
8 top_p: 0.95
9 top_k: 20
10 max_new_tokens: 32768lighteval vllm \
--model_args lighteval_model_arguments.yaml \
--tasks lighteval|aime25|0 \python3 -m lmms_eval \
--model vllm \
--model_args model=RedHatAI/Qwen3-VL-235B-A22B-Instruct-FP8-dynamic,tensor_parallel_size=4,max_model_len=8192,gpu_memory_utilization=0.9 \
--tasks mmmu_val, chartqa\
--batch_size 1| Category | Metric | Qwen/Qwen3-VL-235B-A22B-Instruct | RedHatAI/Qwen3-VL-235B-A22B-Instruct-FP8-block | Recovery (%) |
|---|---|---|---|---|
| OpenLLM V1 | ARC-Challenge (Acc-Norm, 25-shot) | 76.54 | 76.19 | 99.6 |
| GSM8K (Strict-Match, 5-shot) | 90.30 | 90.07 | 99.8 | |
| HellaSwag (Acc-Norm, 10-shot) | 87.81 | 87.65 | 99.8 | |
| MMLU (Acc, 5-shot) | 87.11 | 87.21 | 100.1 | |
| TruthfulQA (MC2, 0-shot) | 63.19 | 63.41 | 100.4 | |
| Winogrande (Acc, 5-shot) | 81.61 | 82.08 | 100.6 | |
| Average Score | 81.09 | 81.10 | 100.0 | |
| Reasoning (generation) | AIME 2025 | 70.00 | 76.67 | 109.5 |
| Multi-modal | ChartQA (relaxed_overall) | 90.12 | 89.96 | 99.8 |
| MMMU (val) | 63.67 | 63.67 | 100.0 | |
| OpenLLM V2 | IFEval (Inst Level Strict Acc, 0-shot) | 91.01 | 90.29 | 99.21 |
| BBH (Acc-Norm, 3-shot) | 73.72 | 73.95 | 100.31 | |
| Math-Hard (Exact-Match, 4-shot) | 61.71 | 20.69 | 33.54 | |
| GPQA (Acc-Norm, 0-shot) | 32.13 | 32.89 | 102.35 | |
| MUSR (Acc-Norm, 0-shot) | 42.06 | 41.80 | 99.37 | |
| MMLU-Pro (Acc, 5-shot) | 65.82 | 65.65 | 99.73 | |
| Average Score | 61.07 | 54.21 | 88.77 |