Skip to content
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

[Feat] Adding minimal training for multimodal model #136

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

kcz358
Copy link

@kcz358 kcz358 commented Jan 31, 2025

This PR integrates the training of Qwen2-VL into the open-r1. Due to the implementation of the current GRPO trainer, I have to hack the loading and processing logic of the model inside the trainer and create a trainer class.

The original training code is in :
https://github.com/EvolvingLMMs-Lab/open-r1-multimodal

The logs, checkpoints, and dataset used are available as follows:

Logs : Wandb Logs
Models : 🤗 Models
Datasets : 🤗 Datasets

The runs of the train can be done by torchrun

torchrun --nproc_per_node="8" \
    --nnodes="1" \
    --node_rank="0" \
    --master_addr="127.0.0.1" \
    --master_port="12345" \
    src/open_r1/grpo.py \
    --deepspeed scripts/zero3.json \
    --output_dir checkpoints/Qwen2-VL-2B-GRPO-8k \
    --model_name_or_path Qwen/Qwen2-VL-2B-Instruct \
    --dataset_name lmms-lab/multimodal-open-r1-8k-verified \
    --max_prompt_length 8192 \
    --per_device_train_batch_size 1 \
    --gradient_accumulation_steps 1 \
    --logging_steps 1 \
    --bf16 \
    --report_to wandb \
    --gradient_checkpointing true \
    --attn_implementation flash_attention_2 \
    --max_pixels 2359296 \
    --save_total_limit 8 \
    --num_train_epochs 1 \
    --run_name Qwen2-VL-2B-GRPO-8k

@Luodian
Copy link

Luodian commented Feb 2, 2025

@qgallouedec @lewtun

We truly appreciate this project. Thanks for your efforts!

We are wondering if you could consider adding multimodal models training to the project. It would be exciting to see the multimodal reasoning research derived from this project. We’d love to hear your thoughts on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants