-
Notifications
You must be signed in to change notification settings - Fork 147
feat: add MiniCPM-V-4 VLM support for EAGLE3 training #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add complete MiniCPM-V-4 vision-language model support for EAGLE3 speculative decoding training. ## New Features - Add MiniCPMVLOnlineEagle3Model class for MiniCPM-V target model integration - Add VLM Template architecture (ms-swift style) for VLM data preprocessing - VLMTemplate base class with encode() and collate() methods - MiniCPMVTemplate for MiniCPM-V-4 specific processing - QwenVLTemplate for Qwen2.5-VL models - Add LongRoPE positional embedding support in draft model - Add multi-node training script for distributed training ## Changes - Refactor VLM support: move VLM-specific logic to dedicated model classes - Add new data processing functions: build_vlm_dataset_with_template(), generate_vocab_mapping_for_vlm() - Add minicpm-v chat template - Add configs and example scripts for MiniCPM-V-4 training ## Files Added - specforge/data/vlm_template/ (new module) - specforge/data/dataset.py (VLMDataset) - configs/minicpm-v4-eagle3.json - examples/run_minicpm_v4_eagle3_*.sh - scripts/convert_sft_data.py
Summary of ChangesHello @Lollipop, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces robust support for the MiniCPM-V-4 vision-language model into the EAGLE3 speculative decoding training system. It achieves this by implementing a new, modular VLM template architecture for data preprocessing, integrating LongRoPE for improved long-context handling in draft models, and providing dedicated training scripts for both single and multi-node environments. The changes streamline the integration of diverse VLM models and enhance the training capabilities of the framework. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces comprehensive support for MiniCPM-V-4 VLM training within the EAGLE3 framework. The changes are well-structured, incorporating a new VLM Template architecture for flexible data preprocessing, specific model integration for MiniCPM-V-4, and LongRoPE support for enhanced context handling. The addition of dedicated training scripts and a data conversion utility streamlines the workflow. Robustness improvements, such as lazy processor loading and handling of empty batches, are also commendable. Overall, this is a significant and well-executed feature addition.
Summary
Add complete MiniCPM-V-4 vision-language model support for EAGLE3 speculative decoding training, including:
VLMTemplatebase class and model-specific implementations (MiniCPMVTemplate, QwenVLTemplate)LlamaLongRopeRotaryEmbeddingfor long-context positional embeddings in draft modelChanges
New Files
specforge/data/vlm_template/- VLM template modulespecforge/data/dataset.py- VLMDataset classconfigs/minicpm-v4-eagle3.json- MiniCPM-V-4 configexamples/run_minicpm_v4_eagle3_online.sh- Single-node trainingexamples/run_minicpm_v4_eagle3_multinode.sh- Multi-node trainingscripts/convert_sft_data.py- Data conversion utilityModified Files
specforge/core/eagle3.py- AddMiniCPMVLOnlineEagle3Modelspecforge/data/preprocessing.py- Add VLM dataset building functionsspecforge/modeling/draft/llama3_eagle.py- Add LongRoPE embeddingscripts/train_eagle3.py- Integrate VLM template support