hekmon commited on
Commit
e91bdd7
·
verified ·
1 Parent(s): fda42f3

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +76 -0
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ license_link: https://huggingface.co/Qwen/Qwen3.5-27B/blob/main/LICENSE
5
+ pipeline_tag: image-text-to-text
6
+ datasets:
7
+ - HuggingFaceH4/ultrachat_200k
8
+ - openai/gsm8k
9
+ - sahil2801/CodeAlpaca-20k
10
+ - CohereLabs/aya_dataset
11
+ base_model:
12
+ - Qwen/Qwen3.5-27B
13
+ ---
14
+
15
+ # ig1/Qwen3.5-27B-NVFP4 by IG1
16
+
17
+ ## Quantization
18
+
19
+ This model has been quantized using [llm-compressor](https://github.com/vllm-project/llm-compressor) v0.10.1.dev31+geb49917e (just after Qwen3.5 support was merged) and transformers v5.3.0.
20
+ It is based on the [official example](https://github.com/vllm-project/llm-compressor/blob/36fab734a744b4f46b7b379b7c4b4b3f47fde3bf/docs/key-models/qwen3.5/nvfp4-vl-example.md) with a few modifications (see next section).
21
+
22
+ ### Quantization particularities
23
+
24
+ The sequence length has been increased from 4096 to 8192 and the number of samples from 256 to 1024.
25
+ The 1024 samples come from 4 differents datasets:
26
+
27
+ * 256 general conversation samples ([UltraChat](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k))
28
+ * 256 math reasoning samples ([GSM8K](https://huggingface.co/datasets/openai/gsm8k))
29
+ * 256 code samples ([CodeAlpaca](https://huggingface.co/datasets/sahil2801/CodeAlpaca-20k))
30
+ * 256 multilingual samples ([Aya](https://huggingface.co/datasets/CohereLabs/aya_dataset))
31
+
32
+ You can find the quantization script [here](Qwen3.5-27B_nvfp4.py).
33
+
34
+ While the quantization needed transformers v5, the original (transformers v4) tokenizer files has been put back for simple execution on current vLLM versions. The transformers v5 tokenizer files produced by llm-compressor can be found in the `transformers_v5` folder.
35
+
36
+ ## Qwen3.5 Profiles
37
+
38
+ Alongside support for dynamic thinking and non-thinking modes, the Qwen team offers [4 sampling parameter profiles](https://huggingface.co/Qwen/Qwen3.5-27B#using-qwen35-via-the-chat-completions-api):
39
+
40
+ * Thinking General
41
+ * Thinking Coding
42
+ * Instruct General
43
+ * Instruct Reasoning (we prefer to call it Instruct Creative internally)
44
+
45
+ Manually configuring these parameters for every AI client can be difficult.
46
+ To solve this, we built a lightweight reverse proxy that exposes the 4 profiles as virtual model names.
47
+ It handles request transformation on the fly using a single inference server as backend.
48
+ View the project on [our GitHub](https://github.com/iguanesolutions/qwen35-rp).
49
+
50
+ ## Inference
51
+
52
+ We run this model with vLLM, here is a sample execution command:
53
+
54
+ ```bash
55
+ docker run --rm --name 'Qwen3.5-27B-NVFP4' \
56
+ --runtime=nvidia --gpus 'all' --ipc=host \
57
+ -e 'HF_TOKEN' \
58
+ -e 'VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1' \
59
+ -v '/srv/cache:/root/.cache' \
60
+ -p '127.0.0.1:8000:8000' \
61
+ 'vllm/vllm-openai:v0.18.0-cu130' \
62
+ 'ig1/Qwen3.5-27B-NVFP4' \
63
+ --served-model-name 'Qwen3.5-27B' \
64
+ --reasoning-parser 'qwen3' \
65
+ --enable-auto-tool-choice \
66
+ --tool-call-parser 'qwen3_coder' \
67
+ --max-model-len 'auto' \
68
+ --gpu-memory-utilization '0.9'
69
+ ```
70
+
71
+ A few notes about some of the parameters:
72
+
73
+ * Adapt the `/srv/cache:/root/.cache` mount point to your liking. It contains files you want to keep between multiples run (dynamo bytecode and AOT with torch compile but most importantly the huggingface folder for the model)
74
+ * `VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1` allows for more precise CUDA graph VRAM estimation. It should become the default once vLLM reaches v0.19.0 which at which point you can simply remove it
75
+ * If you deploy the model into several GPUs using Tensor Parallelism, be sure to check the [official recipe](https://docs.vllm.ai/projects/recipes/en/latest/Qwen/Qwen3.5.html) as others flags are needed.
76
+