๐ A Vision-Language Model (VLM) Learning Project
A minimal implementation of Molmo2 VLM from scratch for educational purposes.
nanoMolmo2 is an educational reimplementation of the Molmo2 Vision-Language Model, designed to help developers learn and understand modern VLM architectures from the ground up. This hands-on project uses Qwen3-0.6B as the base language model while following Molmo2's architecture and training methodology.
๐ฏ Primary Goal: Provide a clear, educational implementation for learning how Vision-Language Models work - from architecture design to multimodal training.
โ ๏ธ Note: This is a learning-focused educational project, not intended for production use.
nanoMolmo2: Educational VLM with frozen vision encoder for efficiency
Why frozen vision encoder?
Total trainable: ~501M parameters
Hardware: Runs on 2-4 A100 40GB GPUs
See MODEL_ARCHITECTURE.md for complete details.
pip install -r requirements.txt
# Stage 1 pre-training only (~80GB, 5 datasets)
python scripts/download_datasets.py --stage pretrain
# Stage 2 & 3 SFT datasets (~500GB, 29 datasets)
python scripts/download_datasets.py --stage sft
# All stages
python scripts/download_datasets.py --stage all
# Useful options:
python scripts/download_datasets.py --list # See all datasets
python scripts/download_datasets.py --check # Check download status
python scripts/download_datasets.py --dry-run # Preview without downloading
Storage by Stage (based on Molmo2 tech report):
See DATASETS_BY_STAGE.md for complete breakdown.
# Stage 1: Pre-training
python examples/train_with_stage_dataloaders.py --stage 1
# Stage 2: SFT
python examples/train_with_stage_dataloaders.py --stage 2
# Stage 3: Long-context (same data, longer sequences)
python examples/train_with_stage_dataloaders.py --stage 3
nanoMolmo2/
โโโ config/
โ โโโ model_config.yaml # Model architecture config
โ โโโ train_config.yaml # Training parameters
โโโ data/
โ โโโ dataloaders/ # Dataset implementations
โ โ โโโ base.py # Base classes
โ โ โโโ image_datasets.py # Image dataset loaders
โ โ โโโ video_datasets.py # Video dataset loaders
โ โ โโโ utils.py # Utilities (packing, weighting)
โ โโโ stage_dataloaders.py # Stage-specific data modules
โโโ examples/
โ โโโ minimal_pure_pytorch.py # Minimal VLM implementation
โ โโโ train_with_stage_dataloaders.py # Training example
โโโ scripts/
โ โโโ download_datasets.py # Dataset downloader
โ โโโ inspect_molmo2_data.py # Data inspection tool
โ โโโ verify_model_setup.py # Setup verification
โโโ tests/
โ โโโ test_dataloaders.py # Unit tests
โโโ DATASETS_BY_STAGE.md # Dataset breakdown by stage
โโโ MODEL_ARCHITECTURE.md # Architecture details
โโโ MOLMO2_TECH_REPORT_SUMMARY.md # Tech report summary
โโโ PURE_PYTORCH_GUIDE.md # Pure PyTorch implementation
โโโ QUICKSTART.md # Quick start guide
โโโ TRAINING_PIPELINE.md # Training pipeline details
โโโ YOUR_SETUP.md # Your specific setup
โโโ requirements.txt # Full dependencies
โโโ requirements_minimal.txt # Minimal dependencies
Based on Molmo2's 3-stage approach:
Stage 1: Pre-training (5 datasets, ~80GB)
โโโ 60% Dense captioning (PixMo-Cap)
โโโ 30% Image pointing (PixMo-Points, PixMo-Count, CoSyn-Point)
โโโ 10% NLP data (Tulu)
โ
Stage 2: Supervised Fine-Tuning (100+ datasets)
โโโ Molmo2 datasets (video cap, QA, pointing, tracking)
โโโ PixMo datasets (image cap, QA, pointing)
โโโ Academic datasets (VQA, DocVQA, ChartQA, ...)
โ
Stage 3: Long-Context SFT (same datasets as Stage 2)
โโโ Longer sequences: 36,864 tokens (vs 4,096)
โโโ More frames: 384 (vs 128)
MIT License - See LICENSE file for details.
Educational Use Only | Built with โค๏ธ for learning VLM architectures
16 commits
Python
100.0%
๐ A Vision-Language Model (VLM) Learning Project
A minimal implementation of Molmo2 VLM from scratch for educational purposes.
nanoMolmo2 is an educational reimplementation of the Molmo2 Vision-Language Model, designed to help developers learn and understand modern VLM architectures from the ground up. This hands-on project uses Qwen3-0.6B as the base language model while following Molmo2's architecture and training methodology.
๐ฏ Primary Goal: Provide a clear, educational implementation for learning how Vision-Language Models work - from architecture design to multimodal training.
โ ๏ธ Note: This is a learning-focused educational project, not intended for production use.
nanoMolmo2: Educational VLM with frozen vision encoder for efficiency
Why frozen vision encoder?
Total trainable: ~501M parameters
Hardware: Runs on 2-4 A100 40GB GPUs
See MODEL_ARCHITECTURE.md for complete details.
pip install -r requirements.txt
# Stage 1 pre-training only (~80GB, 5 datasets)
python scripts/download_datasets.py --stage pretrain
# Stage 2 & 3 SFT datasets (~500GB, 29 datasets)
python scripts/download_datasets.py --stage sft
# All stages
python scripts/download_datasets.py --stage all
# Useful options:
python scripts/download_datasets.py --list # See all datasets
python scripts/download_datasets.py --check # Check download status
python scripts/download_datasets.py --dry-run # Preview without downloading
Storage by Stage (based on Molmo2 tech report):
See DATASETS_BY_STAGE.md for complete breakdown.
# Stage 1: Pre-training
python examples/train_with_stage_dataloaders.py --stage 1
# Stage 2: SFT
python examples/train_with_stage_dataloaders.py --stage 2
# Stage 3: Long-context (same data, longer sequences)
python examples/train_with_stage_dataloaders.py --stage 3
nanoMolmo2/
โโโ config/
โ โโโ model_config.yaml # Model architecture config
โ โโโ train_config.yaml # Training parameters
โโโ data/
โ โโโ dataloaders/ # Dataset implementations
โ โ โโโ base.py # Base classes
โ โ โโโ image_datasets.py # Image dataset loaders
โ โ โโโ video_datasets.py # Video dataset loaders
โ โ โโโ utils.py # Utilities (packing, weighting)
โ โโโ stage_dataloaders.py # Stage-specific data modules
โโโ examples/
โ โโโ minimal_pure_pytorch.py # Minimal VLM implementation
โ โโโ train_with_stage_dataloaders.py # Training example
โโโ scripts/
โ โโโ download_datasets.py # Dataset downloader
โ โโโ inspect_molmo2_data.py # Data inspection tool
โ โโโ verify_model_setup.py # Setup verification
โโโ tests/
โ โโโ test_dataloaders.py # Unit tests
โโโ DATASETS_BY_STAGE.md # Dataset breakdown by stage
โโโ MODEL_ARCHITECTURE.md # Architecture details
โโโ MOLMO2_TECH_REPORT_SUMMARY.md # Tech report summary
โโโ PURE_PYTORCH_GUIDE.md # Pure PyTorch implementation
โโโ QUICKSTART.md # Quick start guide
โโโ TRAINING_PIPELINE.md # Training pipeline details
โโโ YOUR_SETUP.md # Your specific setup
โโโ requirements.txt # Full dependencies
โโโ requirements_minimal.txt # Minimal dependencies
Based on Molmo2's 3-stage approach:
Stage 1: Pre-training (5 datasets, ~80GB)
โโโ 60% Dense captioning (PixMo-Cap)
โโโ 30% Image pointing (PixMo-Points, PixMo-Count, CoSyn-Point)
โโโ 10% NLP data (Tulu)
โ
Stage 2: Supervised Fine-Tuning (100+ datasets)
โโโ Molmo2 datasets (video cap, QA, pointing, tracking)
โโโ PixMo datasets (image cap, QA, pointing)
โโโ Academic datasets (VQA, DocVQA, ChartQA, ...)
โ
Stage 3: Long-Context SFT (same datasets as Stage 2)
โโโ Longer sequences: 36,864 tokens (vs 4,096)
โโโ More frames: 384 (vs 128)
MIT License - See LICENSE file for details.
Educational Use Only | Built with โค๏ธ for learning VLM architectures
16 commits
Python
100.0%