Text Generation
Transformers
Safetensors
qwen3
dflash
dflash2
speculative-decoding
block-diffusion
draft-model
sglang
text-generation-inference
Instructions to use incoai/GLM-5.3-Flash-DFlash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use incoai/GLM-5.3-Flash-DFlash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="incoai/GLM-5.3-Flash-DFlash2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("incoai/GLM-5.3-Flash-DFlash2") model = AutoModel.from_pretrained("incoai/GLM-5.3-Flash-DFlash2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use incoai/GLM-5.3-Flash-DFlash2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "incoai/GLM-5.3-Flash-DFlash2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "incoai/GLM-5.3-Flash-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/incoai/GLM-5.3-Flash-DFlash2
- SGLang
How to use incoai/GLM-5.3-Flash-DFlash2 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 "incoai/GLM-5.3-Flash-DFlash2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "incoai/GLM-5.3-Flash-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "incoai/GLM-5.3-Flash-DFlash2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "incoai/GLM-5.3-Flash-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use incoai/GLM-5.3-Flash-DFlash2 with Docker Model Runner:
docker model run hf.co/incoai/GLM-5.3-Flash-DFlash2
Checkpoint update
Browse files- README.md +6 -56
- assets/dflash2-figure.png +3 -0
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -30,6 +30,10 @@ Two-tap dynamic convolutions in the backbone keep the draft from decaying
|
|
| 30 |
toward the end of the block. Decoding is lossless: greedy output
|
| 31 |
matches the target model exactly, and sampling preserves its distribution.
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
## Quick Start
|
| 34 |
|
| 35 |
Serve with [SGLang](https://github.com/sgl-project/sglang):
|
|
@@ -49,62 +53,8 @@ See the [blog post](https://inco.ai/blog/dflash2/) for more details.
|
|
| 49 |
|
| 50 |
## Evaluation
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
- Sampling: GLM-5.3-Flash's officially recommended parameters (temperature 1.0, top-p 0.95), with the default `Max` reasoning effort
|
| 55 |
-
- Maximum new tokens: 4096
|
| 56 |
-
- Samples: 128 at concurrency 1; 1,024 at concurrency 8 and 32
|
| 57 |
-
|
| 58 |
-
We compare autoregressive decoding, GLM-5.3-Flash's native MTP, and DFlash 2.
|
| 59 |
-
All speculative methods propose seven draft tokens per verification step.
|
| 60 |
-
|
| 61 |
-
### Acceptance Length
|
| 62 |
-
|
| 63 |
-
Acceptance length is the per-request mean of completion tokens divided by verification steps.
|
| 64 |
-
Higher is better.
|
| 65 |
-
|
| 66 |
-
| Task | MTP | DFlash 2 |
|
| 67 |
-
| :--- | ---: | ---: |
|
| 68 |
-
| GSM8K | 5.06 | **5.78** |
|
| 69 |
-
| MATH-500 | 4.95 | **5.86** |
|
| 70 |
-
| HumanEval | 4.70 | **5.32** |
|
| 71 |
-
| MBPP | 4.26 | **4.85** |
|
| 72 |
-
| MT-Bench | 3.71 | **4.03** |
|
| 73 |
-
|
| 74 |
-
### Throughput
|
| 75 |
-
|
| 76 |
-
Throughput is total output tokens divided by end-to-end wall time.
|
| 77 |
-
Each cell shows `output tok/s (speedup vs. autoregressive)`.
|
| 78 |
-
|
| 79 |
-
#### Concurrency 1
|
| 80 |
-
|
| 81 |
-
| Task | Autoregressive | MTP | DFlash 2 |
|
| 82 |
-
| :--- | ---: | ---: | ---: |
|
| 83 |
-
| GSM8K | 146.8 | 282.6 (1.93×) | **355.4 (2.42×)** |
|
| 84 |
-
| MATH-500 | 157.5 | 323.2 (2.05×) | **438.9 (2.79×)** |
|
| 85 |
-
| HumanEval | 166.6 | 323.5 (1.94×) | **436.8 (2.62×)** |
|
| 86 |
-
| MBPP | 168.2 | 299.5 (1.78×) | **402.2 (2.39×)** |
|
| 87 |
-
| MT-Bench | 169.3 | 231.1 (1.36×) | **293.2 (1.73×)** |
|
| 88 |
-
|
| 89 |
-
#### Concurrency 8
|
| 90 |
-
|
| 91 |
-
| Task | Autoregressive | MTP | DFlash 2 |
|
| 92 |
-
| :--- | ---: | ---: | ---: |
|
| 93 |
-
| GSM8K | 582.6 | 825.5 (1.42×) | **922.9 (1.58×)** |
|
| 94 |
-
| MATH-500 | 794.9 | 1,267.8 (1.59×) | **1,552.3 (1.95×)** |
|
| 95 |
-
| HumanEval | 897.4 | 1,533.1 (1.71×) | **1,943.5 (2.17×)** |
|
| 96 |
-
| MBPP | 895.8 | 1,428.0 (1.59×) | **1,821.8 (2.03×)** |
|
| 97 |
-
| MT-Bench | 864.0 | 1,084.5 (1.26×) | **1,303.2 (1.51×)** |
|
| 98 |
-
|
| 99 |
-
#### Concurrency 32
|
| 100 |
-
|
| 101 |
-
| Task | Autoregressive | MTP | DFlash 2 |
|
| 102 |
-
| :--- | ---: | ---: | ---: |
|
| 103 |
-
| GSM8K | 917.3 | 1,203.1 (1.31×) | **1,318.3 (1.44×)** |
|
| 104 |
-
| MATH-500 | 1,635.6 | 2,362.7 (1.44×) | **2,717.0 (1.66×)** |
|
| 105 |
-
| HumanEval | 2,089.8 | 3,511.4 (1.68×) | **4,198.4 (2.01×)** |
|
| 106 |
-
| MBPP | 2,102.0 | 3,168.5 (1.51×) | **3,791.4 (1.80×)** |
|
| 107 |
-
| MT-Bench | 1,831.5 | 2,317.0 (1.27×) | **2,675.0 (1.46×)** |
|
| 108 |
|
| 109 |
## License
|
| 110 |
|
|
|
|
| 30 |
toward the end of the block. Decoding is lossless: greedy output
|
| 31 |
matches the target model exactly, and sampling preserves its distribution.
|
| 32 |
|
| 33 |
+
<div align="center">
|
| 34 |
+
<img src="assets/dflash2-figure.png" alt="DFlash 2: parallel block drafting with a candidate path selector" width="100%">
|
| 35 |
+
</div>
|
| 36 |
+
|
| 37 |
## Quick Start
|
| 38 |
|
| 39 |
Serve with [SGLang](https://github.com/sgl-project/sglang):
|
|
|
|
| 53 |
|
| 54 |
## Evaluation
|
| 55 |
|
| 56 |
+
Benchmark numbers for this checkpoint are being re-measured and will be
|
| 57 |
+
published here once final.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
## License
|
| 60 |
|
assets/dflash2-figure.png
ADDED
|
Git LFS Details
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2342169800
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b038e1d9d1e7833fa3880c2c0135ba9b673013f03da1b29fb831931584759dac
|
| 3 |
size 2342169800
|