Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
nvfp4
modelopt
fp4
dense
multimodal
gated-deltanet
hybrid
mtp
speculative-decoding
conversational
8-bit precision
Instructions to use vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt") model = AutoModelForMultimodalLM.from_pretrained("vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt
- SGLang
How to use vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt with Docker Model Runner:
docker model run hf.co/vroomfondel/Qwen3.8-27B-NVFP4-ModelOpt
Upload NVFP4 (ModelOpt) quantization
Browse files
README.md
CHANGED
|
@@ -1,18 +1,87 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
license: apache-2.0
|
|
|
|
| 4 |
base_model: Qwen/Qwen3.8-27B
|
| 5 |
base_model_relation: quantized
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
-
- modelopt
|
| 9 |
- nvfp4
|
|
|
|
| 10 |
- fp4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
NVFP4 quantization of [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
<!-- BEGIN quant:preview -->
|
| 18 |
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
license: apache-2.0
|
| 4 |
+
license_link: https://huggingface.co/Qwen/Qwen3.8-27B/blob/main/LICENSE
|
| 5 |
base_model: Qwen/Qwen3.8-27B
|
| 6 |
base_model_relation: quantized
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
tags:
|
|
|
|
| 9 |
- nvfp4
|
| 10 |
+
- modelopt
|
| 11 |
- fp4
|
| 12 |
+
- dense
|
| 13 |
+
- multimodal
|
| 14 |
+
- gated-deltanet
|
| 15 |
+
- hybrid
|
| 16 |
+
- mtp
|
| 17 |
+
- speculative-decoding
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# Qwen3.8-27B NVFP4 (ModelOpt, uniform W4A4)
|
| 21 |
+
|
| 22 |
+
NVFP4 (W4A4) quantization of [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B),
|
| 23 |
+
produced with the NVIDIA TensorRT Model Optimizer (ModelOpt). This is a derivative
|
| 24 |
+
checkpoint; see the [base model card](https://huggingface.co/Qwen/Qwen3.8-27B) for the
|
| 25 |
+
model's capabilities and general usage.
|
| 26 |
+
|
| 27 |
+
| | |
|
| 28 |
+
|---|---|
|
| 29 |
+
| **Base model** | [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B) (Qwen3.8 dense, multimodal, apache-2.0) |
|
| 30 |
+
| **Architecture** | `Qwen3_5ForConditionalGeneration`, Gated-DeltaNet hybrid (64 layers: 48 linear-attention, 16 full-attention), dense FFN, 27B |
|
| 31 |
+
| **Precision** | uniform W4A4 NVFP4 across dense FFN, full attention and the Gated-DeltaNet path; FP8 KV cache with baked scales. Vision tower, embeddings, `lm_head` and the NEXTN/MTP head kept BF16. |
|
| 32 |
+
| **Size** | 55.6 GB BF16 source, 20.6 GB quantized (2.7x): 12.2 GB packed NVFP4 weights, 6.9 GB BF16 (embeddings, `lm_head`, vision, MTP), 1.5 GB FP8 block scales |
|
| 33 |
+
| **Context** | 262144 native (1M needs YaRN RoPE scaling, not configured here) |
|
| 34 |
+
| **GSM8K** | 97.42% (1285/1319), zero errors, zero empty responses. See the benchmark table. |
|
| 35 |
+
| **Producer** | NVIDIA ModelOpt via the kikube single-node quant driver |
|
| 36 |
+
|
| 37 |
+
> **Serving note:** this is a *uniform* W4A4 build, i.e. attention is quantized too.
|
| 38 |
+
> NVIDIA's own Qwen3.5/3.6 NVFP4 checkpoints are MoE/FFN-only and leave attention in
|
| 39 |
+
> BF16, so SGLang's stock `qwen3_5` path has never had to handle this. See the
|
| 40 |
+
> requirements below before serving.
|
| 41 |
+
|
| 42 |
+
### Speculative decoding
|
| 43 |
+
|
| 44 |
+
Use **DSPARK** with the external drafter
|
| 45 |
+
[RadixArk/Qwen3.8-27B-DSpark](https://huggingface.co/RadixArk/Qwen3.8-27B-DSpark)
|
| 46 |
+
(1.36B BF16, 2.6 GB). **NEXTN on this checkpoint's built-in MTP head crashes the SGLang
|
| 47 |
+
scheduler** on the first request (FlashInfer `fast_prefill_plan`); DSPARK does not.
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
--speculative-algo DSPARK \
|
| 51 |
+
--speculative-draft-model-path <drafter> \
|
| 52 |
+
--speculative-draft-model-quantization unquant \
|
| 53 |
+
--speculative-dspark-block-size 7 \
|
| 54 |
+
--speculative-num-draft-tokens 8 \
|
| 55 |
+
--speculative-num-steps 1 \
|
| 56 |
+
--speculative-eagle-topk 1 \
|
| 57 |
+
--mamba-scheduler-strategy extra_buffer \
|
| 58 |
+
--attention-backend flashinfer
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Three of these are not optional:
|
| 62 |
+
|
| 63 |
+
- `--speculative-draft-model-quantization unquant` — SGLang otherwise inherits this
|
| 64 |
+
target's `modelopt_fp4` for the BF16 drafter and the load dies on a state-dict shape
|
| 65 |
+
mismatch.
|
| 66 |
+
- `--speculative-num-draft-tokens 8` — must equal `dspark_block_size + 1`; SGLang asserts
|
| 67 |
+
it. The drafter's `config.json` declares `block_size: 7`.
|
| 68 |
+
- `--mamba-scheduler-strategy extra_buffer` — required for correct Gated-DeltaNet state
|
| 69 |
+
rollback when draft tokens are rejected.
|
| 70 |
+
|
| 71 |
+
`--attention-backend triton` is not a substitute for `flashinfer` here: it hits a
|
| 72 |
+
forward-time crash in `RadixLinearAttention.forward` for this architecture
|
| 73 |
+
([sgl-project/sglang#29577](https://github.com/sgl-project/sglang/issues/29577)).
|
| 74 |
+
DSPARK pins `num_steps` and `eagle_topk` to 1 itself. `SGLANG_ENABLE_SPEC_V2` is a no-op on
|
| 75 |
+
SGLang 0.5.17 (the V2 worker always runs); the corresponding knob is
|
| 76 |
+
`--disable-overlap-schedule`.
|
| 77 |
+
|
| 78 |
+
**Measured throughput** on one DGX Spark (GB10, sm121), SGLang 0.5.17, over 415 decode
|
| 79 |
+
batches during the GSM8K run: **~186 tok/s aggregate** at 11-13 concurrent requests
|
| 80 |
+
(roughly 15 tok/s per stream), mean accept len **3.77** of a ceiling of 8, accept rate
|
| 81 |
+
0.38-0.42. No same-settings run without speculation was measured, so this is not a speedup
|
| 82 |
+
factor. Note the Mamba state cache, not the GPU, is what caps concurrency here: state usage
|
| 83 |
+
sat at 0.68-0.80 with requests queued, and speculation consumes more state slots than plain
|
| 84 |
+
decoding.
|
| 85 |
|
| 86 |
<!-- BEGIN quant:preview -->
|
| 87 |
|