sgl-project / sgl-project/SpecForge
[Feature] Support image-text multimodal input for DFlash training, similar to Eagle3
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 347
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 41
Description
Checklist
- 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/sgl-project/SpecForge/discussions/new/choose Otherwise, it will be closed.
- 2. Please use English, otherwise it will be closed.
Motivation
Checklist
- 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/sgl-project/SpecForge/discussions/new/choose Otherwise, it will be closed.
- 2. Please use English, otherwise it will be closed.
Motivation
Currently, the DFlash training pipeline in scripts/train_dflash.py is designed for text-only data. However, many real-world speculative decoding scenarios involve multimodal content (e.g., image + text). Eagle3 has demonstrated support for multimodal inputs, and it would be valuable for SpecForge's DFlash implementation to support image-text inputs as well.
Specifically, we would like to train DFlash draft models for vision-language models such as Qwen3.5/Qwen3.6, where the target model processes both images and text, and the draft model accelerates token generation by predicting future text tokens conditioned on the multimodal context.
Related resources
- Eagle3 (supports multimodal speculative decoding): https://github.com/NVlabs/Eagle
- Qwen3.5 model family (potential target models)
- Existing flexible embedding key in SpecForge:
--embedding-key(e.g.,model.language_model.embed_tokens.weight)
Proposed scope
- Data pipeline: Support loading image-text paired data in
build_eagle3_datasetor a dedicated DFlash multimodal dataset builder. - Model inputs: Allow the target model to accept pixel values / image embeddings alongside
input_idsandattention_mask. - Hidden-state capture: Correctly capture hidden states from the target multimodal language model at the specified
target_layer_ids, taking into account vision-language fusion. - Draft model alignment: Ensure the DFlash draft model can consume the multimodal context and produce block-level draft predictions.
- Example script & config: Provide an example training script and a reference config for a multimodal DFlash draft model.
Related resources
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scripts/train_dflash.py and the existing build_eagle3_dataset path, then inspect how --embedding-key and target_layer_ids are used. Compare the proposed image-text flow with Eagle3's multimodal support and determine the required target-model inputs, hidden-state capture, and draft-model handling. Done means an example script and reference config can train a DFlash draft model from image-text data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100