Skip to content

[recipe, doc] feat: add Qwen-Image DPO v1 sync recipe - #536

Merged
knlnguyen1802 merged 2 commits into
verl-project:mainfrom
knlnguyen1802:feat/v1-sync-qwen-image-dpo
Sep 7, 2026
Merged

[recipe, doc] feat: add Qwen-Image DPO v1 sync recipe#536
knlnguyen1802 merged 2 commits into
verl-project:mainfrom
knlnguyen1802:feat/v1-sync-qwen-image-dpo

Conversation

@knlnguyen1802

@knlnguyen1802 knlnguyen1802 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add examples/dpo_trainer/qwen_image/run_qwen_image_online_dpo_lora_v1.sh, the CUDA v1 sync counterpart of run_qwen_image_online_dpo_lora.sh.
  • Mechanical trainer switch only: main_diffusionmain_diffusion_v1, trainer.use_v1=true, trainer.v1.trainer_mode=sync, and trainer.experiment_name=qwen_image_online_dpo_lora_v1. Model, LoRA, reward, pipeline, batch, and GPU layout are unchanged from v0.
  • Document the recipe in examples/dpo_trainer/README.md. The NPU script stays on v0 (same split as Wan2.2 [3/N][recipe] feat: add Wan2.2 DanceGRPO v1 sync recipe #466).
  • No adapter, loss, or trainer-infra changes. Adapters remain in verl_omni/pipelines/qwen_image_dpo/.

This claims the Qwen-Image + online DPO · sync first row on #389. GPU layout is a mechanical clone of the v0 4-GPU colocated actor/rollout/reward recipe (REWARD_TP=4 on NUM_GPUS_ACTOR_ROLLOUT_REWARD=4). A separate_async recipe is not included: that would need a dedicated rollout pool and is not a mechanical clone.

Cloned from the landed diffusion v1 sync pattern in examples/flowgrpo_trainer/sd35/run_sd35_medium_ocr_lora_v1.sh and examples/dancegrpo_trainer/wan22/run_wan22_5b_t2v_hpsv3_v1.sh (#466).

Note: main_diffusion_v1 selects PolicyGradientDiffusionTrainerV1Sync. The v0 online DPO path uses DirectPreferenceRayTrainer for top/bottom pairing and trainer-side ref_noise_pred. This PR does not add a second trainer; it is the recipe-only switch requested by #389. Please treat a first GPU smoke as the check that pairing / ref-noise still flow through the shared DPO loss on v1.

Checklist Before Starting

Why this is not duplicating an existing PR

Test plan

  • python tests/special_sanity/check_pr_title.py with PR_TITLE='[recipe] feat: add Qwen-Image online DPO v1 sync recipe' — valid (modules: recipe; type: feat).
  • bash -n examples/dpo_trainer/qwen_image/run_qwen_image_online_dpo_lora_v1.sh — OK.
  • Script review vs run_qwen_image_online_dpo_lora.sh: only header, entrypoint, v1 flags, and experiment_name suffix differ.
  • GPU training was not run (no GPU / full Qwen-Image weights in this environment). Please run bash examples/dpo_trainer/qwen_image/run_qwen_image_online_dpo_lora_v1.sh on a 4-GPU node before merge.

AI assistance

AI assistance (Cursor) was used to draft the recipe clone, README mention, and this PR. A human submitter has reviewed every changed line and is responsible for the change.

knlnguyen1802 and others added 2 commits September 3, 2026 14:38
Add a mechanical CUDA v1 sync recipe so online DPO can opt into
TransferQueue without changing adapters or losses.

AI assistance (Cursor) was used for this change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: knlnguyen1802 <knlnguyen1802@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… path

The v1 PG loop recomputed old_log_probs, but DPO infer returns
noise_pred (log_probs=None). Route trainer_type=direct_preference
through pairing + ref noise pred, matching v0.

AI assistance (Cursor) was used for this change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: knlnguyen1802 <knlnguyen1802@gmail.com>

@AndyZhou952 AndyZhou952 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@knlnguyen1802 knlnguyen1802 added the ready-for-ci read for running CI label Sep 7, 2026
@knlnguyen1802

Copy link
Copy Markdown
Collaborator Author

Reward curve
qwen_image_dpo_v1

@knlnguyen1802
knlnguyen1802 merged commit ae7e19d into verl-project:main Sep 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ci read for running CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants