1. Model introduction
Qwen-Image is Alibaba’s MMDiT text-to-image model. In miles-diffusion it is the reference image recipe: the launcher is aligned flag-for-flag with flow_grpo’spickscore_qwenimage config, so a run here is directly comparable to the published
baseline.
Key highlights for RL training:
- flow_grpo-aligned. Per-prompt reward mean with a batch-wide std (
--globalize-reward-stdalone) is exactly flow_grpo’sPerPromptStatTrackerwithglobal_std=True;gaussianLoRA init andadam-beta2 0.999match likewise. - RoPE caches rebuilt on CUDA. diffusers builds
QwenEmbedRope’s frequency tables on CPU while sglang-d builds them on CUDA; the fp32 ULP difference drifts every block. In one frozen-weight comparison,noise_predmean |Δ| was approximately2e-2.postprocess_model_after_materializerebuilds the caches on device after FSDP wrapping. - Variable-length text. Conditioning is padded per batch with the attention mask derived
from
txt_seq_lens— the mask itself is never transmitted from rollout.
2. Supported variants
Any checkpoint whose name matches
qwen-image resolves to the same config. For a
differently-named local directory — the usual case — add --diffusion-model-family qwen_image.
3. Family config
Registered inmiles/backends/fsdp_utils/configs/qwen_image.py:
4. Launch
Canonical recipe:scripts/run_diffusion_grpo_pickscore_5gpu_flowgrpo_aligned.py — 4 colocate
GPUs + 1 PickScore GPU, 512×512, PickScore reward.
Status: 📈 V — Verified
--num-rollout 50 --extra-args "--diffusion-kl-beta 0.02".
5. Recipe notes
- Of the 10 denoising steps, only steps 3-4 are trained:
--diffusion-sde-window-range 3,5with--diffusion-num-sde-steps 2leaves the window nowhere to move, so every sample trains the same two mid-schedule steps as SDE while the rest run ODE. - Batch arithmetic: 32 prompts × 16 samples = 512 samples per rollout, split into two optimizer steps of 256 samples; the 2 trained SDE steps expand those to 1024 train pairs.
--rollout-patch-group sgldapplies the diffusers-op-parity patches on the engine. It costs a little rollout throughput and buys a much smallertrain/log_prob_mean_abs_diff.
6. Pairs well with
- LoRA weight sync —
--lora-ipc-weight-syncis on in this recipe. - Dtype Control — why fp32 master + bf16 forward.
- Deterministic Training —
--deterministic-modeis on.

