Repository navigation
🖼️ Headline: Vision-Language Model (VLM) support
FeynRL now trains vision-language models with the same SFT and RL recipes as LLMs.
- New
model.model_class: "llm" | "vlm"config, with VLM-specific options:data.image_key,data.max_image_pixels,model.max_images_per_prompt, and per-submoduleattn_implementationdicts (e.g. different attention backends for the vision tower vs. the language model). - New multimodal data feeds:
ImagePairedFeed(SFT),ImagePreferenceFeed(DPO/CL),ImagePromptsFeed(RL rollouts), plus shared image loading/resizing utilities. Multimodal kwargs are plumbed end-to-end through the replay buffer and both vLLM rollout engines. - Unified model loading (
misc/model_loading.py):build_hf_model,load_tokenizer_or_processor, andensure_pad_tokenhandle LLM vs. VLM differences (AutoProcessor,text_configpad-token nesting) in one place. - Generic VLM ↔ vLLM weight-sync key remapping: RL weight sync now remaps state-dict keys via the model's own
_checkpoint_conversion_mapping, so newertransformersVLM layouts (Qwen2.5-VL, Gemma, and others) sync correctly into vLLM without per-model hacks. - New VLM data prep (
data_prep/mm_math.py) and reward (rewards/mathvista_reward_func.py); config validation guards Gemma-3 VLM against the incompatiblebatch_invariantattention backend.
📚 New examples & results
The examples/ folder is reorganized by model type (llm/, vlm/) with full configs, reproduction commands, and results for every experiment:
- VLM · MM-Math (Qwen2.5-VL-3B-Instruct) — SFT and GRPO recipes, evaluated on MM-Math, Geometry3K, and MathVista (GRPO: +11.0 pp on MM-Math over base).
- VLM · Snake 🐍 (SmolVLM2-500M-Video-Instruct) — a 500M VLM learns to play Snake from pixels via supervised imitation; includes data generation, rollout script, and an interactive UI.
- LLM · GSM8K SFT (Gemma-2-2B-it) — new SFT example, 21.81% → 32.59% pass@1. Community contribution — thanks @nstranges! (#89)
- Existing LLM GRPO examples (Qwen2.5-1.5B-Instruct, Qwen3-4B-Thinking) moved under
examples/llm/rl/, and all commands now showCUDA_VISIBLE_DEVICESand--experiment_idexplicitly.
💾 Checkpointing & resume
- New
run.enable_saving_resume_state(defaulttrue): checkpoints include DeepSpeed optimizer/scheduler/RNG state (ds_engine/) for exact training resume; resuming from a checkpoint saved without it now fails fast with a clear error. (#59) - Checkpoint saving handles the VLM processor alongside the tokenizer so saved checkpoints are complete for inference and resume.
⚙️ Other improvements & fixes
- Stricter eval config validation
- Fixed async config
weight_sync_methodhandling. (#69) - Docs: README rewritten around LLM + VLM support, added acknowledgements (Open-Instruct, PipelineRL) and a citation entry; Python version consistency (#78) and Qwen3 example config fixes (#72).
🧪 Testing
Expanded unit-test suites covering VLM weight remapping, multimodal preference feeds, mm-kwargs extraction, model loading, replay buffer, DPO loss, and config validation.
Full Changelog: v0.1.0...v0.2.0
What's Changed
- add vlm experiments by @murdock-aubry in #86
- snake gif by @murdock-aubry in #87
- fixed proken links by @murdock-aubry in #88
- Added Gemma2 training example by @nstranges in #89
New Contributors
- @nstranges made their first contribution in #89
Full Changelog: v0.1.0...v0.2.0
What's Changed
- VLM support: multimodal data feeds, model loading, and vLLM weight-sync remapping by @rasoolfa (#82, #83, #84, #85)
- Checkpoint resume state and weight-sync config fixes by @rasoolfa (#59, #69)
- add vlm experiments by @murdock-aubry in #86
- snake gif by @murdock-aubry in #87
- fixed proken links by @murdock-aubry in #88
- Added Gemma2 training example by @nstranges in #89
New Contributors
- @nstranges made their first contribution in #89
Full Changelog: v0.1.0...v0.2.0