---
library_name: speculators
base_model:
- qwen3/qwen3-30b-a3b-instruct-2507
license: apache-2.0
tags:
- speculative-decoding
- dflash
- speculators
---
# RedHatAI/Qwen3-30B-A3B-Instruct-2507-speculator.dflash
This is a DFlash speculator model for [Qwen/Qwen3-30B-A3B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-30B-A3B-Instruct-2507).
## Training Details
This model was trained using the [Speculators](https://github.com/vllm-project/speculators) library on a subset of [Magpie-Align/Magpie-Llama-3.1-Pro-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Llama-3.1-Pro-300K-Filtered) and the `train_sft` split of [HuggingFaceH4/ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k). Responses were regenerated by [Qwen/Qwen3-235B-A22B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-235B-A22B-Instruct-2507). and stored at [Dataset-Qwen3-235B-Instruct](https://huggingface.co/datasets/inference-optimization/Dataset-Qwen3-235B-Instruct/tree/main)
Commands
Using the [Speculators](https://github.com/vllm-project/speculators) library and the helper scripts provided in the repo.
### Prepare data
```bash
# In virtual environment with speculators installed
python scripts/prepare_data.py \
--model Qwen/Qwen3-30B-A3B-Instruct-2507
--data ./regenerated_data.jsonl \
--assistant-pattern "<\|im_start\|>assistant\s*([\s\S]*?)<\|im_end\|>" \
--output ./output \
--seq-length 16384
```
### Launch vLLM
```bash
# In (separate) virtual environment with vllm installed
CUDA_VISIBLE_DEVICES=0,1 vllm_venv/bin/python scripts/launch_vllm.py \
Qwen/Qwen3-30B-A3B-Instruct-2507 \
--target-layer-ids 1 12 23 34 45 \
--max-model-len 32768 \
--max-num-batched-tokens 32768\
--tensor-parallel-size 2 \
--no-enable-chunked-prefill
```
### Launch training
Must be run once vLLM has finished launching and is running in the background.
```bash
# In virtual environment with speculators installed
CUDA_VISIBLE_DEVICES=2,3 torchrun \
--standalone \
--nproc_per_node 2 \
scripts/train.py \
--verifier-name-or-path Qwen/Qwen3-30B-A3B-Instruct-2507 \
--data-path ./output \
--on-missing generate \
--on-generate delete \
--scheduler-type cosine \
--draft-vocab-size 32000 \
--max-anchors 1024 \
--target-layer-ids 1 12 23 34 45 \
--speculator-type dflash \
--num-layers 5 \
--logger trackio \
--lr 0.0006 \
--epochs 5 \
--sliding-window 2048 \
--sliding-window-indices 0 1 2 3 4 \
--draft-hidden-act silu
```







