Skip to content

[rl][docs] README: bring the RL model support table up to date - #6016

Merged
wwwjn merged 1 commit into
mainfrom
wwwjn/image-rl/4c-rl-readme-image-support
Nov 18, 2026
Merged

wwwjn merged 1 commit into
mainfrom
wwwjn/image-rl/4c-rl-readme-image-support

Conversation

@wwwjn

@wwwjn wwwjn commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Based on main, outside the image RL stack. The image rows name recipes from #5825 and #6025, so merge it after those.

Summary (human-written)

Why

The Model support table in torchtitan/rl/README.md lags behind main and the image RL stack:

Example.

Model Before After
Muse Spark ✅ Supported (text only) ✅ Supported (text and image)
Qwen 3.5/3.6/3.8 ✅ Supported (text only) ✅ Supported (text and image)
DeepSeek V3 Not supported ✅ Supported (SM90+)
Kimi K3 Support coming soon ✅ Supported (SM90+)

What changed

  • The four rows above.
  • The intro says how DeepSeek V3 and Kimi K3 were tested, since it differs from the other entries (generator DP and TP at degree 2, EP at degree 4): 3 steps with a debug model on H100, trainer FSDP=2, two generators at TP=1, no EP. Their MLA decode and KDA kernels need SM90+. It also names the two image recipes.
  • Qwen 3.6 and 3.8 build Qwen35Model and share Qwen3.5's vision processor config, so they take the same image path; the image recipe runs Qwen3.5.
  • The CI table gets the RL H100 Integration Tests badge, the workflow that runs the DeepSeek V3 and Kimi K3 tests.
  • Unchanged: GPT-OSS (supported; debug RL recipe and bitwise parity test), DeepSeek V4 (no RL code yet), FLUX (diffusion model, no generator path), Kimi K2.7 (no RL recipe or test).

Testing

Docs only. pre-commit run --files torchtitan/rl/README.md passes locally without the lychee link check, which needs GitHub access; CI runs it. The new badge points at the existing integration_test_rl_h100.yaml workflow.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 10, 2026
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from f36c11c to eadf8c6 Compare November 10, 2026 20:22
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from db036a8 to 6ca906c Compare November 10, 2026 20:23
@wwwjn wwwjn changed the title [rl][docs] README: list image support for Muse Spark and Qwen 3.5/3.6/3.8 [rl][docs] README: bring the RL model support table up to date Nov 10, 2026
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from 6ca906c to ddeaf59 Compare November 10, 2026 21:03
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from eadf8c6 to 9fe5bfa Compare November 10, 2026 21:03
@wwwjn
wwwjn added this pull request to stack #5900 November 10, 2026 21:03
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from 9fe5bfa to 3f72d8c Compare November 10, 2026 22:36
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from ddeaf59 to 1165ce9 Compare November 10, 2026 22:36
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from 3f72d8c to d7861f8 Compare November 10, 2026 23:20
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from 1165ce9 to 92e9c8b Compare November 10, 2026 23:20
wwwjn added a commit that referenced this pull request Nov 10, 2026
## Summary (human-written)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
     this approach, and what you checked yourself. -->

**Stack** (image RL; review bottom up, each PR is one commit on the one
below):
0. #5873 [multimodal] VisionProcessor: one per-model image and video
processor (merged)
1. #5823 [multimodal] Image-reference Qwen3.5 renderer and shared M-RoPE
positions (merged)
2. **→** #5824 [rl] Image prompts through rollouts and the vLLM
generator
3. #5825 [rl] Train on image prompts, with a Geometry3K recipe
4. #5844 [rl] LoRA RL: generators load the base checkpoint, weight syncs
carry only the adapters
5. #5845 [rl] CUDA graphs for the generator's vision encoder
6. #5998 [rl] Muse Spark image prompts and a SLAKE LoRA GRPO recipe for
Muse Spark 816B
7. #6016 [rl][docs] README: bring the RL model support table up to date

## Why

RL prompts are token ids only: the rollout worker, the router, the
generator and vLLM pass a bare `prompt_token_ids`, so an image prompt
from #5823's renderer has nowhere to carry its images, and the generator
has no way to run the TorchTitan vision encoder. This PR carries image
prompts from the renderer to vLLM (Qwen3.5); text runs are unchanged
apart from the `Prompt` wrapper.

**Example.** Before: `generate(prompt_token_ids=[...])`. After, an image
travels as file bytes plus where its placeholder run sits:

```
rollout worker                         generator (every TP rank)                    vLLM
--------------                         -------------------------                    ----
render() -> Prompt                     VisionProcessor (CPU):                       embed_multimodal: vision encoder,
  token_ids (placeholder runs)  -----> resize_and_normalize + patchify     ----->    once per mm hash while cached
  images: PromptImage(hash_value,      LRU cache of pixel values by hash            embed_input_ids: image embeddings
          grid_thw, data=file bytes)   image_prompt_to_engine_input -> mm_input       over the placeholders
  image_placeholders                                                                forward(3D M-RoPE positions)
```

## What changed

**One generation input.** `Prompt(token_ids, images=(),
image_placeholders=())` replaces the bare `prompt_token_ids` everywhere
a prompt travels: `TokenEnvOutput.next_prompt`, `GenerateFn`, the
router, `Generator.generate` and `EngineRequest`. An image is a run of
placeholder tokens in `token_ids`; `Prompt.image_placeholders` says
where each run is, and its `PromptImage(hash_value, source_path,
grid_thw, data)` carries the image file's bytes (Geometry3K median 15
KB), so no process past the rollout worker needs the dataset's file
system. This is the shape vLLM (`mm_input`), SGLang and HF processors
take at the engine boundary, so no layer converts it.

**Rollouts store deltas.** A `RolloutTurn` stores only the images after
its shared prefix (`prompt_delta_images`,
`prompt_delta_image_placeholders`), like its tokens. `split_prompt` ends
the shared prefix at the first image that differs from the previous
turn's (another file with the same placeholder count, or a moved image),
so every changed image is in the delta. TokenEnv always calls
`render()`, passes the previous prompt's `multi_modal_data` to the
bridge when it has images, and reads the image files in a worker thread.

**One image preprocessing config.** `Controller.Config.vision_processor`
(the model's `VisionProcessor.Config` from #5873, next to `tokenizer`;
None = text only) is the only place image preprocessing is configured.
The controller and the rollout workers pass it to
`renderer.build(tokenizer=..., vision_processor=...)` (#5823), and the
generator takes it as a build argument. The controller requires a
generator model that is a `MultimodalModel` with a vision encoder. It
stays a config and not a property of the model type: every real Qwen3.5
flavor ships the vision encoder, and text RL recipes use them without
serving images.

**Generator.** With a vision processor, `VLLMEngine` turns each image
file into pixel values on the CPU, as the SFT dataloader does, keeps
them in an LRU cache by image hash (vLLM's `LRUCache`, 1 GiB:
preprocessing takes 6.5 ms per Geometry3K image on the engine loop
thread, and every sample of a group carries the same images), and
submits vLLM's `mm_input` directly, so vLLM's Hugging Face processor
never runs. vLLM still requires a registered multimodal processor for
the model class; it only sizes the encoder budget and profiles memory
with the vision processor's largest image (`_largest_patch_grid`, which
is not always square). A request whose image file does not decode is
rejected at admission like any request vLLM rejects: its rollout fails
and the engine keeps serving.

**Model wrapper.** `VLLMMultimodalModelWrapper` runs the model's
`get_vision_embeds` (made public) on the packed pixel values, writes the
image embeddings over the placeholder tokens, and computes M-RoPE
positions with `get_mrope_positions`, as the trainer does.
`model_config_to_hf_config_dict(serves_images=True)` declares M-RoPE to
vLLM and rejects a model whose attention is not `MRoPE.Config`. The
generator forward now returns plain tensors (spmd_types), so the DTensor
unwrap after it is gone. The generator's shared model build
(`build_inference_model`, #5811) drops the vision encoder unless the
wrapper serves images (`keep_vision_encoder`).

**Stale embeddings.** vLLM keeps an image's encoder output after its
requests finish (only `reset_encoder_cache` clears it), and the vision
weights train. Image mm hashes are therefore salted like the prefix
cache with the request's pinned policy version (`hash@version`). With
`reset_kv_cache_on_model_state_dict_load`, hashes are bare and the
engine resets the encoder cache on every load.

Until the trainer takes image inputs (next PR), the controller rejects
`vision_processor`, so image prompts never train on their placeholder
tokens alone. Verifiers environments reject it too (their env server
builds its own renderer).

### Why the deltas are safe

The generator always gets the full prompt; only stored turns are deltas,
and the trainer rebuilds exactly the input the generator saw:

1. Image offsets are full-prompt positions from the renderer
(`render()`; the Qwen3.5 bridge seeds its tokens with the previous
prompt, so its offsets are absolute too). TokenEnv copies them into the
delta unchanged: no offset arithmetic anywhere.
2. `split_prompt` keeps an image in the shared prefix only if it equals
the previous turn's image at the same index (hash, offset and length);
otherwise the prefix ends at its first placeholder. An identical image
has the same pad tokens at the same place, so the prefix never ends
inside an image.
3. So the previous turn's images inside the prefix are exactly this
turn's prefix images, and (previous images with offset < prefix) + delta
= the turn's full images, by induction from turn 0 (prefix 0). #5825's
`TrainingSampleBuilder` rebuilds them this way.
4. A training sample starts at a full prompt's first token, so
full-prompt offsets are sample offsets, and M-RoPE positions come from
the same `get_mrope_positions` over identical content on both sides.
5. A turn extends a training sample only when its prefix covers the
previous prompt + completion. A changed image shortens the prefix, so a
completion is never trained with an image it was not generated from.

Two things could break this, and each is caught: a rollout producer that
builds turns without TokenEnv (#5825's builder rejects a delta image
outside its delta), and a renderer bridge with tail-relative offsets
(generator and trainer would be wrong together; each image renderer
needs a multi-turn test like #5825's real-renderer
`test_multiturn_images.py` for Qwen3.5).

## Numerics / performance

- Text path: RL loss guard (`rl_grpo_qwen3_0_6b_varlen_batch_invariant`,
seed 42, deterministic, trainer TP4 + one generator TP4, on-policy, 10
steps) gives `loss/mean`, `trainer/grad_norm/mean` and the
generator-vs-trainer logprob diff (max 0) bitwise equal to the PR below
at all 10 steps (TensorBoard values, `scripts/rl/loss_compare.py`; on
b9b3620, this PR before the rename to `VisionProcessor`, which changes
no computation). This covers the `Prompt` wrapper and the generator
forward without the DTensor unwrap.
- Image path, measured on an earlier revision of this PR (SLAKE medical
VQA, Qwen3.5-0.8B): generator-only accuracy with images 0.81 vs 0.51
text-only (TP1 and TP2 identical); generator vs TorchTitan forward
logprobs on image prompts mean abs diff 0.0166 vs 0.0150 for the text
control; 128 requests over 4 images ran the vision encoder 4 times. The
end-to-end image run comes with #5825.

## Testing

- `test_vllm_multimodal_wrapper.py`: the engine input places each image
on its placeholders, with the pixel values whose patch count matches the
renderer's grid; M-RoPE input positions; the largest patch grid (square,
non-square, NaViT); profiling inputs; the HF config declares M-RoPE only
when serving images; the controller rejects a vision processor for a
model without a vision encoder; image embeddings land on the placeholder
tokens vLLM's mask marks, in order (`masked_scatter_`, which never syncs
the host).
- `test_generator.py`: admission salts image hashes with the pinned
version (bare in reset mode), preprocesses each file once while cached,
rejects image requests without a vision processor, and rejects only the
request whose image file does not decode; the encoder cache resets with
the KV cache.
- `test_token_env.py`, `test_rollout_utils.py`: images across turns, the
bridge extends earlier images, delta images, `split_prompt` ends the
prefix at a changed or moved image, rejection of pixels and non-image
modalities, a changed file.
- `test_rollout_worker.py`, `test_rollout_recorder.py`: the rollout
sends and records delta images, without their bytes.
- `pytest tests/rl/unit_tests/cpu`: 575 passed, 8 skipped.
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch 2 times, most recently from 7d8e4f7 to 2f36b0e Compare November 10, 2026 23:35
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from 6bfe553 to 1206012 Compare November 10, 2026 23:35
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from 2f36b0e to 8780014 Compare November 10, 2026 23:55
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from 1206012 to 2b3952b Compare November 10, 2026 23:55
wwwjn added a commit that referenced this pull request Nov 11, 2026
## Summary (human-written)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
     this approach, and what you checked yourself. -->

**Stack** (image RL; review bottom up, each PR is one commit on the one
below):
0. #5873 [multimodal] VisionProcessor: one per-model image and video
processor (merged)
1. #5823 [multimodal] Image-reference Qwen3.5 renderer and shared M-RoPE
positions (merged)
2. #5824 [rl] Image prompts through rollouts and the vLLM generator
(merged)
3. **→** #5825 [rl] Train on image prompts, with a Geometry3K recipe
4. #5844 [rl] LoRA RL: generators load the base checkpoint, weight syncs
carry only the adapters
5. #5845 [rl] CUDA graphs for the generator's vision encoder
6. #5998 [rl] Muse Spark image prompts and a SLAKE LoRA GRPO recipe for
Muse Spark 816B
7. #6016 [rl][docs] README: bring the RL model support table up to date

## Why

After #5824, rollouts carry image prompts and the generator serves them,
but the trainer cannot train on them: training samples have the
placeholder tokens without the images, so the controller rejects
`Controller.Config.vision_processor`. Training on image prompts needs
each sample's full images rebuilt from the turns' deltas, the images
moved from the batcher to the trainer and encoded there, and, for GRPO,
not encoding one image once per sample: the samples of a group show the
same images.

**Example.** Before: setting `vision_processor` raises at controller
setup. After:

```
RolloutTurn deltas --TrainingSampleBuilder--> TrainingSample(token_ids, images, image_placeholders)
   --Batcher--> microbatches: each distinct image file once, every placeholder token's embedding row
   --trainer, TrainingMicrobatch.preprocess_images--> pixel_values -> vision encoder -> embedding rows
```

How the same image is encoded once: 2 groups x 2 samples on 2 DP ranks,
image k in group g0 and image m in group g1, each placeholder token
drawn as its image's letter (also in `Batcher._pack_image_inputs`'s
docstring):

```
samples       a0: t k k k t t     a1: t k k k t t t      (group g0)
              b0: t m m t t       b1: t m m t t t        (group g1)

1. Batcher._pack_with_lpt picks each sample's microbatch, preferring one that already holds
   the sample's image:
              rank 0: [a0 a1]  rank 1: [b0 b1]     k and m each encoded once
   instead of rank 0: [a0 b0]  rank 1: [a1 b1]     k and m each encoded on both ranks

2. Batcher._pack_image_inputs builds rank 0's image inputs. The image embeddings (the model's
   "vision bank") are the vision encoder's output for the microbatch's distinct images,
   stacked in order, one row per image token; each token gets its row:
              tokens       t  k k k  t  t | t  k k k  t  t  t | pad
              rows        -1  0 1 2 -1 -1 |-1  0 1 2 -1 -1 -1 |  -1   image_vision_bank_indices_T
              image_files  [file k]    each distinct image (by hash) once, ~15 KB
              grid_thw     [grid of k]

3. TrainingMicrobatch.preprocess_images, on the trainer: file k -> resize_and_normalize
   -> patchify_all -> pixel_values (~2.4 MB of float32), once per distinct image.

4. The model encodes k once into embedding rows [e0 e1 e2], and each placeholder token
   takes its row: tokens 1 and 7 both take e0 (gather_vision_embeds, already on main).
   In the backward, both runs' gradients add up into the one encoding.
```

## What changed

- **Training samples carry their images** (`TrainingSample.images` and
`image_placeholders`, aligned like `Prompt`'s). Rollout turns store only
their new images (#5824), so `TrainingSampleBuilder` rebuilds each
turn's full images like its tokens: the previous prompt's images inside
the shared prefix, then the turn's own. A turn that swaps an image in
place branches like a token edit, because `split_prompt` ends the shared
prefix at the changed image. The builder rejects a delta image outside
its delta (placeholders are full-prompt positions); otherwise a producer
that stored delta-relative offsets would put image embeddings on other
tokens without an error. Why the rebuild is exact: #5824, "Why the
deltas are safe".
- **The batcher ships files, the trainer preprocesses.** Per microbatch,
the batcher ships each distinct image file once (`image_files` +
`image_file_sizes`), each placeholder token's row in the image
embeddings (`image_vision_bank_indices_T`), `grid_thw`, and, with
`Batcher.Config.build_mrope_positions`, 3D M-RoPE positions from
`get_mrope_positions`, as the generator computes them. The recipe sets
the flag, as SFT's `MultiModalCollator.Config.build_mrope_positions`
does (Geometry3K: True); `Controller.Config` raises unless it matches
the trainer model's RoPE (`get_mrope_config`), since a Qwen3.5 run
without it would train image tokens on 1D positions while the generator
used M-RoPE. Packing prefers a microbatch that already holds a sample's
image. On the trainer, `TrainingMicrobatch.preprocess_images` (named
after the generator's `_preprocess_images`) turns each file into pixel
values on the CPU before the engine sees the microbatch, so
`as_input_dict` holds model inputs as for any other microbatch; with
RDMA it runs on the read-ahead thread, hidden behind training.
Placeholder counts are checked against the grids, and the decoded images
against the prompts' grids.
- **One config.** The batcher gets `Controller.Config.vision_processor`
at build time, as the renderer and the generator do (#5824), so all
three use one config and nothing has to be kept equal. This replaces the
previous PR's guard.
- **Qwen3.5 under CP** keeps the embedding rows the batch provides
(`image_vision_bank_indices_T`) instead of counting placeholder tokens:
several placeholder runs can share one encoded image, and a placeholder
id sampled in a completion is text.
- **Recipe.** `rl/examples/geometry3k` (Hugging Face
`hiyouga/geometry3k`; the dataset writes the parquet's images to files
once, since rendering reads image files) and
`torchtitan_recipes/rl/geometry3k.py::rl_grpo_qwen3_5_0_8b_geometry3k`
(4 GPUs), with
`vision_processor=VisionProcessor.Config(**QWEN3_5_VISION_PROCESSOR_KWARGS)`
next to the tokenizer. Rewards reuse the DAPO math Math-Verify grader on
the last `\boxed{}`.
- Mechanical: `VisionProcessor.patchify_all` (patchify and pack items)
is extracted from the SFT collator, which now calls it; the trainer uses
it too.
- CI: the RL CPU job fetches the Qwen3.5 tokenizer next to the Muse
Glimmer one; the RL multi-GPU job runs `test_cp_images.py` (fetches
Qwen3.5-0.8B).

## Alternatives considered

- Ship pixel values instead of files: ~2.4 MB instead of ~15 KB per
Geometry3K image over RPC or RDMA.
- Find images by scanning token ids for placeholder runs, as the SFT
collator does: the policy can sample the placeholder id in a completion.
- No dedup: simpler, but the trainer then encodes every sample's copy of
an image; on SLAKE (Qwen3.5-0.8B) packing by image cut the images
encoded per step from 109-128 to 26-48 (of 128) and the median step time
from 16.9 s to 14.9 s. The share is smaller for larger language models
(the vision encoder stays the same size).

## Numerics / performance

On 8e8950a93 (this PR before the rename to `VisionProcessor`, which
changes no computation), `rl_grpo_qwen3_5_0_8b_geometry3k` on 4 A100
(trainer FSDP=2 + 2 generators at TP=1, 16 prompts x 8 samples per
step), 30 steps:

- validation reward on the 601 test problems 0.285 -> 0.358 (truncation
rate 0.56 -> 0.18);
- rollout reward, mean of steps 1-10 vs 21-30: 0.15 -> 0.28;
- mean trainer-generator logprob difference -0.0003 to -0.0018 per
token;
- the trainer encoded 35-98 images per step for the samples' 128
(packing by image);
- the trainer waited ~7 ms per step for its batch; 30 steps plus both
validations took 14.5 min.

Measured on earlier revisions of this stack (same preprocessing
placement and packing):

- SLAKE (medical VQA): Qwen3.5-0.8B on-policy GRPO, reward 0.008 -> 0.85
in 12 steps; Qwen3.5-35B-A3B on 8 GB300, reward 0.31 -> 0.94 in 30
steps.
- Geometry3K on 4 GB300, 30 steps: validation reward 0.270 -> 0.361 with
the default RPC batcher path and 0.271 -> 0.351 with
`Batcher.Config(rdma_min_tensor_bytes=1024)` +
`preprocess_microbatch_groups_lazily=True`; steady-state step ~10 s.

## Testing

- `test_rollout_utils.py`: training samples rebuild their full images
from the turns' deltas (extend, then a new branch); an image swapped in
place branches; a delta image outside its delta raises.
- `test_multiturn_images.py`: a two-turn image rollout through the real
`Qwen35ImageRefRenderer`, TokenEnv, the rollout worker and
`TrainingSampleBuilder` (with and without thinking): the turns store [a]
then [b], the samples carry [a, b] (or [a] and [a, b]), and every image
sits on its placeholder run.
- `test_batcher.py`: embedding rows, one file per distinct image, pixel
values equal to `patchify(resize_and_normalize(file))`, packing by
image, placeholder and grid checks, text samples with a vision
processor.
- `test_trainer.py` / `test_rdma_microbatch.py`: the trainer
preprocesses images before training, on the read-ahead thread with RDMA.
- `test_qwen3_5_vision_bank.py`: the batch's rows place one encoding on
two placeholder runs, and both runs' gradients add up into it (equal to
encoding the image twice; fails if a run's gradient is dropped).
- `test_cp_images.py` (GPU, RL multi-GPU CI): Qwen3.5-0.8B through
`Trainer.forward_backward` without CP (FSDP=2) and with CP=2
(AllGatherKV with head-tail balancing, and Ulysses), on microbatches
with an image split by the CP boundary, one image shared by samples on
both ranks, an image longer than a head-tail chunk, sampled placeholder
ids and a text sample. The decoder's input embeddings and M-RoPE
positions must equal the no-CP ones bit for bit, and the vision
encoder's gradient must match (norm ratio 0.85-1.15, cosine > 0.98).
Catches a CP shard that puts image rows or positions on the wrong
tokens, or a vision gradient not summed over the CP ranks (half the norm
at CP=2).
- `test_geometry3k.py`: dataset, env, grading, and the recipe's vision
processor matches the generator's and the trainer's vision encoder.
- Broader CP check run locally on the same trainer path (bf16,
deterministic; seven microbatches, adding an image longer than a CP=4
shard and DP ranks where one trains images and the other text): CP=2
(AllGatherKV contiguous and head-tail, Ulysses), CP=4 (contiguous and
head-tail), CP=2 x FSDP=2, and mixed DP ranks. Input embeddings and
positions are bitwise equal to no CP everywhere; the vision gradient's
norm ratio is 0.91-1.08 and its cosine >= 0.987. With one image's rows
reversed (a negative control), the embeddings differ by 1.6-2.8 and the
cosine drops to 0.08-0.96.
- `pytest tests/rl/unit_tests/cpu tests/unit_tests/cpu/components
tests/unit_tests/cpu/models/qwen3_5/test_qwen3_5_vision_bank.py`: 1129
passed, 9 skipped; 1 failed
(`test_lora_head_only_matches_cross_entropy`, a local Inductor C++ build
error that main has too). `pytest
tests/rl/unit_tests/gpu/test_cp_images.py` on 2 A100: 4 passed (2m43s);
with this PR's Qwen3.5 CP change reverted, its launches fail
(`pixel_values require special_tokens with an 'image_id' entry`).

## Known issues / follow-ups

- Rank balancing counts attention work, not vision-encoder work, which
packing by image concentrates (TODO in `Batcher._attention_workload`).
- Images are deduplicated within a microbatch only; a group split across
microbatches encodes its image once per microbatch.
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from 8780014 to 24599ca Compare November 11, 2026 00:30
The Model support table in torchtitan/rl/README.md lags behind main and the
image RL stack:

- DeepSeek V3 ("Not supported") and Kimi K3 ("Support coming soon") have run
  RL end to end in CI since #5556 and #4680: `rl_grpo_deepseek_v3_debug` and
  `rl_grpo_kimi_k3_debug_batch_invariant` in the RL H100 Integration Tests
  (3 steps, debug model, trainer FSDP=2, two generators at TP=1, no EP). Their
  MLA decode and KDA kernels need SM90+, so both rows say "SM90+", and the
  intro says how they were tested.
- Muse Spark and Qwen 3.5/3.6/3.8 ("text only") run image prompts end to end:
  `rl_grpo_qwen3_5_0_8b_geometry3k` (Qwen3.5-0.8B, Geometry3K, #5825) and
  `rl_muse_spark_816b_a42b_slake_lora_gb300` (Muse Spark 816B-A42B, SLAKE).
  Qwen 3.6 and 3.8 build `Qwen35Model` and share Qwen3.5's vision processor
  config, so they take the same image path.
- The CI table gets the RL H100 Integration Tests badge, the workflow that
  runs the DeepSeek V3 and Kimi K3 tests.

Unchanged: GPT-OSS (supported), DeepSeek V4 (no RL code yet), FLUX (diffusion,
no generator path), Kimi K2.7 (no RL recipe or test).
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4c-rl-readme-image-support branch from 24599ca to ddae2e4 Compare November 11, 2026 01:17
@wwwjn
wwwjn force-pushed the wwwjn/image-rl/4b-muse-slake-recipe branch from c32038d to 2d61d33 Compare November 11, 2026 01:17
@wwwjn
wwwjn removed this pull request from stack #5900 November 11, 2026 01:18
@wwwjn
wwwjn changed the base branch from wwwjn/image-rl/4b-muse-slake-recipe to main November 11, 2026 01:27
@wwwjn
wwwjn marked this pull request as ready for review November 18, 2026 19:42
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Nov 18, 2026
@github-actions
github-actions Bot requested a review from pzhan9 November 18, 2026 19:42
@wwwjn
wwwjn merged commit af12faa into main Nov 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants