Add Qwen3-VL training adaptation for DFlash
Motivation
This PR adds training adaptation support for Qwen3-VL in the DFlash framework. #461
The goal is to enable end-to-end DFlash draft model training and integration with Qwen3-VL target models under the SpecForge training pipeline.
Modifications
Added Qwen3-VL online DFlash training support. Added multimodal position id handling for DFlash, including Qwen3-VL mRoPE alignment. Enabled HF target-side hidden state and position id extraction for VLM inputs. add sglang support for qwen3-vl dflash. Added qwen3-vl chat template, draft config, and example training script.
Accuracy Test
coming soon
Benchmark & Profiling
Checklist
- [x] Format your code according to the Code Formatting with Pre-Commit.
- [x] Add unit tests as outlined in the Running Unit Tests.
- [x] Update documentation / docstrings / example tutorials as needed, according to Writing Documentation.
- [x] Provide throughput / latency benchmark results and accuracy evaluation results as needed, according to Benchmark and Profiling and Accuracy Results.
- [x] For reviewers: If you haven't made any contributions to this PR and are only assisting with merging the main branch, please remove yourself as a co-author when merging the PR.
- [x] Please feel free to join our Slack channel at https://sgl-fru7574.slack.com/archives/C09784E3EN6 to discuss your PR.
[!WARNING] You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!
Great. Can you help resolve the conflicts? We upgrade sglang==0.5.9 recently. If you have trained the corresponding Qwen-VL model‘s DFlash, please feel free to share your results.
Got it, I’ll update the code later.
@gq112 Hello, I was wondering if you have any test results for DFlash specifically on Qwen-VL?
Can you show the accuracy of your draft model of VLM?
Can you show the accuracy of your draft model of VLM?
hi~, Some other tasks have delayed this, but I’ll share the draft model’s accuracy once I’ve got the latest numbers
Can you show the accuracy of your draft model of VLM?
hi~, Some other tasks have delayed this, but I’ll share the draft model’s accuracy once I’ve got the latest numbers
Great!
hi @jiapingW ,The Qwen3-VL-8B-DFlash draft model is trained on the Allava4V 30K dataset. I evaluated it on MMStar (50 samples) setup:
python benchmarks/bench_dflash.py \
--model-path /models/Qwen/Qwen3-VL-8B-Instruct \
--speculative-draft-model-path ./outputs/qwen3-vl-8b-dflash-30k \
--port 30000 \
--trust-remote-code \
--config-list 1,16 \
--benchmark-list mmstar:10 \
--dtype bfloat16
results:
{
"model": "./outputs/qwen3-vl-8b-dflash-30k",
"mmstar": [
{
"batch_size": 1,
"dflash_block_size": 16,
"metrics": [
{
"latency": 120.50732253491879,
"output_throughput": 77.95376913529839,
"accept_length": 2.1605335786568536,
"accuracy": 0.44,
"num_questions": 50,
"num_valid_predictions": 49,
"categorical_performance": null
}
],
"num_samples": 50
}
]
}