SpecForge icon indicating copy to clipboard operation
SpecForge copied to clipboard

Add Qwen3-VL training adaptation for DFlash

Open gq112 opened this issue 9 months ago • 7 comments

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.

gq112 avatar Feb 28 '26 03:02 gq112

[!WARNING] You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

gemini-code-assist avatar Feb 28 '26 03:02 gemini-code-assist

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.

jiapingW avatar Mar 24 '26 08:03 jiapingW

Got it, I’ll update the code later.

ggg-s avatar Mar 24 '26 09:03 ggg-s

@gq112 Hello, I was wondering if you have any test results for DFlash specifically on Qwen-VL?

fousdfrf avatar Mar 24 '26 14:03 fousdfrf

Can you show the accuracy of your draft model of VLM?

jiapingW avatar Jun 10 '26 03:06 jiapingW

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

ggg-s avatar Jun 10 '26 03:06 ggg-s

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!

jiapingW avatar Jun 10 '26 03:06 jiapingW

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
        }
    ]
}

gq112 avatar Jun 18 '26 10:06 gq112