Skip to content

MLA support for titanRL w/ vllm - #5556

Merged
liangel-02 merged 1 commit into
mainfrom
vllm-native-mla
Oct 29, 2026
Merged

liangel-02 merged 1 commit into
mainfrom
vllm-native-mla

Conversation

@liangel-02

@liangel-02 liangel-02 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

adds mla support in titanrl's vllm generator. on compressed path VLLMCompressedMLAAttention wraps vllm's native mla layer and on materialized it decompresses k/v and runs the same ops as the trainer

Screenshot 2026-10-19 at 5 36 17 PM

for batch invariance we can't use the vllm native latent-space kernel so we fall back to the old path of decompressing - we use vllminnerattention and we wrap w/ mlaattention class but this actually just uses full attention. uncommented k3 batch invariant test does not test the new mla behaviour

adding deepseek v3 h100 run to test the mla path

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 20, 2026
@liangel-02 liangel-02 changed the title vllm native mla MLA support for titanRL w/ vllm Oct 20, 2026
@liangel-02
liangel-02 marked this pull request as ready for review October 20, 2026 00:36
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 20, 2026
@wwwjn

wwwjn commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

2 things needs to be fixed in this PR when I tried to run it

  1. KV-cache scale buffers in the generator state dict.
    • Problem: vLLM's MLA layer registers _k_scale, _v_scale, _q_scale and _prob_scale as persistent buffers, so they end up in the generator's state dict. When the generator loads HF weights itself, as generate.py does, K3's strict state-dict adapter rejects them. The RL loop doesn't hit this, because its generator gets weights from the trainer.
    • Fix: in VLLMMLAInnerAttention.init, re-register those four buffers as non-persistent, the same way the wrapper already handles its absorbed weights.
    • Test: a CPU test that fails without the fix. With both, test_vllm_wrapper.py passes (18 tests).
  2. Broken test. test_generator.py::test_extra_engine_args_reach_engine_args fails with AttributeError: ... no attribute 'layers'. MLA support for titanRL w/ vllm #5556's backend selection now walks cfg.layers, and the test's fake model config doesn't have that field. Adding layers=[] to _MODEL_CONFIG fixes it, and the whole file passes (53 passed, 1 skipped).

@liangel-02
liangel-02 force-pushed the vllm-native-mla branch 2 times, most recently from 65154c9 to baf20e8 Compare October 22, 2026 22:52
@liangel-02
liangel-02 marked this pull request as draft October 22, 2026 22:53
@pytorch-bot pytorch-bot Bot removed the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 22, 2026
self.v_head_dim = config.v_head_dim

layer_id = next(VLLMInnerAttention._layer_counter)
self.vllm_mla = _VLLMNativeMLAAttention(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why we use vLLM native MLA attention here? Why not torchtitan MLA

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

torchtitan mla can't cache the latent it runs wkv_b before calling inner attention so vllm's cache layer will receive the decompressed per-head kv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

torchtitan mla can't cache the latent it runs wkv_b before calling inner attention

I'm confused other attention like varlen we are using pytorch kernel for attention calculation, but there, the attention kernel is vllm native (I see FlashInfer/TRT in my test running), similar to Flex. What's your consideration on using vllm native MLA or having a MLA in attention-gym?

Does it support bitwise identical mode between trainer (torchtitan MLA https://github.com/pytorch/torchtitan/blob/refs/heads/main/torchtitan/models/deepseek_v3/attention.py#L30) vs vllm native MLA?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no for bitwise we fallback to uncompressed kv and use materialized K/V through VLLMInnerAttention (the same path as trainer). we can def explore potentially adding mla support in attention gym (maybe as a followup so we can first unblock?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we should use vllm's native MLA, can we not use torchtitan's?

I don't see how it relates to attention-gym yet -- torchtitan has its own MLA. Having torchtitan depending on atten-gym for MLA is a separate work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we can't use torchtitan's mla because it doesn't have a latent space decode kernel (which is what we can add to attention gym).

we are already using torchtitan mla for the batch invariant path where we don't compress.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah I think we should have one! just like varlen for GQA

@liangel-02
liangel-02 force-pushed the vllm-native-mla branch 3 times, most recently from 14d0b3d to 9106ca3 Compare October 23, 2026 17:01

# vLLM sets is_mla based on specific model types, and we pass in
# model_type="torchtitan", so is_mla would be False.
# TODO: Wait until the vLLM PR adding register_model_arch_config_convertor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we ping reviewers to review?

@liangel-02
liangel-02 force-pushed the vllm-native-mla branch 4 times, most recently from dd4ac7e to 1e4164a Compare October 23, 2026 18:48
@liangel-02
liangel-02 requested a review from tianyu-l October 23, 2026 18:49
@liangel-02
liangel-02 marked this pull request as ready for review October 23, 2026 18:49
@pytorch-bot pytorch-bot Bot added ciflow/b200 Trigger B200 CI ciflow/fake-pg Run 1-GPU Fake PG integration tests labels Oct 23, 2026
@liangel-02
liangel-02 force-pushed the vllm-native-mla branch 2 times, most recently from 33ee528 to fe536a5 Compare October 27, 2026 17:36
@liangel-02
liangel-02 requested a review from tianyu-l October 27, 2026 17:36
@tianyu-l
tianyu-l requested a review from acisseJZhong October 28, 2026 02:20
@tianyu-l

Copy link
Copy Markdown
Contributor

@claude review my latest comments, give suggestions

@claude

claude Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @tianyu-l's task in 2m 1s —— View job


Suggestions on @tianyu-l's latest review comments

  • Read mla.py, model_wrapper.py, registry.py, attention.py, engine.py and generate.py on the PR branch
  • Write suggestions for each of the latest review threads

I couldn't open vLLM's own MLAAttention source in this sandbox (installed packages are outside what my permissions allow). Where a point below depends on how vLLM behaves, I say so.


1. mla.py:65: keep only the plain Linear (drop MXFP8)

I agree with you. Turning MXFP8Linear back into bf16 so vLLM can absorb it gives up the reason to use MXFP8. It also makes decode and prefill run different matmuls: decode uses the probed bf16 weight, while prefill calls MXFP8Linear._linear. So it isn't the same computation as the trainer either.

Suggested cut:

  • _VLLMKVBProj: shrink it to a thin shim. weight becomes a property that returns self.linear.weight, and __call__ returns (self.linear._linear(x, self.linear.weight, None), None). Then remove:
    • refresh_weight
    • the torch.eye probe
    • the weight: Tensor | None state
    • the params_dtype assert
  • _VLLMNativeMLAAttention: remove _act_dtype and refresh_absorbed_weights.
  • model_wrapper.py:519-521: remove the loop that calls refresh_absorbed_weights() after load_state_dict, and the lazy _VLLMNativeMLAAttention import with it.
  • VLLMMLAAttention.__init__: change the check to config.wkv_b._owner is not Linear. Drop the MXFP8Linear import.
  • Error message: it currently tells users to "Enable batch invariance to use a materialized K/V cache instead". That's odd advice, because batch invariance has a large perf cost and does a different job. Better: say MXFP8/LoRA on wkv_b is not supported on the vLLM compressed-MLA path yet, and that the fix is to leave wkv_b out of the quantization converter's FQNs. Add a TODO explaining that low-precision wkv_b needs a latent-space kernel that consumes the quantized operands directly.
  • Docs: the _VLLMKVBProj docstring and the PR description should list what's supported: plain bf16 Linear only, with no LoRA, no MXFP8/NVFP4 and no bias.

Fix this →

2. mla.py:86: why _VLLMNativeMLAAttention overrides anything, and what comment to add

Once item 1 is done, what's left in this class is a workaround for one vLLM behaviour. Here is my understanding; @liangel-02, please confirm it against vLLM:

  • vLLM's MLAAttention.process_weights_after_loading splits kv_b_proj.weight into two decode-time matrices. W_UK_T folds the K up-projection into the query, so decode can take the dot product directly against the cached latent. W_UV up-projects the latent attention output to v_head_dim.
  • vLLM stores these as nn.Parameters on the attention layer. That puts them in state_dict() as ...vllm_mla.W_UK_T and ...vllm_mla.W_UV. The trainer has no such keys, so the generator's load_state_dict(strict=True) during weight sync fails. HF adapters with strict key mapping, such as K3, fail the same way.
  • VLLMInnerAttention (attention.py:393) doesn't need this, because vllm.Attention owns no weights. It only has the scale buffers, which are handled by _exclude_vllm_attn_scales_from_state_dict. That's the same kind of fix.

Suggested docstring for the class:

class _VLLMNativeMLAAttention(VLLMNativeMLAAttention, Module):
    """vLLM MLA attention that participates in the TorchTitan Module protocol.

    vLLM derives ``W_UK_T``/``W_UV`` from ``kv_b_proj.weight`` in
    ``process_weights_after_loading`` and registers them as parameters. They are
    not model weights (the trainer has no such keys), so they are moved to
    non-persistent buffers to keep the generator's state dict identical to the
    trainer's. For a bf16 ``Linear`` they are views of ``wkv_b.weight``, so weight
    sync's in-place copy updates them without re-deriving.

    TODO: upstream registering these as non-persistent buffers in vLLM, then drop
    this override.
    """

Make the "views" claim a checked invariant, not a comment. Without the refresh loop, decode is only correct if W_UK_T and W_UV share storage with wkv_b.weight. If that breaks, decode quietly keeps using step-0 weights while prefill uses the new ones, and nothing errors. It would break if, for example:

  • vLLM calls .to(act_dtype) or .contiguous(), or a backend pre-packs the weights;
  • process_weights_after_loading runs while FSDP holds the sharded param rather than the unsharded storage.

Two concrete asks:

  • Right after super().process_weights_after_loading(...), assert that W_UK_T and W_UV share storage with kv_b_proj.weight, with a clear message. CLAUDE.md allows this kind of check because the failure would otherwise be silent.
  • Add a CPU test: build the layer, run process_weights_after_loading, call VLLMModelWrapper.load_state_dict with a different wkv_b, then check that W_UK_T and W_UV match the new weight. Run it with the existing fully_shard fixture too (test_vllm_wrapper.py:185). The current test at line 351 only checks the initial derivation.

3. mla.py:144: native TorchTitan latent-space MLA kernel

+1 to having one, the way varlen does for GQA. The order I'd suggest:

  1. This PR: land the vLLM-native compressed path for plain bf16 wkv_b, scoped as described in items 1 and 2. Add a module-level TODO in mla.py pointing to the follow-up, so the dependency on vLLM's kernel is clearly temporary.
  2. Follow-up: a TorchTitan InnerAttention that takes (q_THK, kv_c_normed_TL, k_shared_TR) and does the absorbed latent decode itself, the varlen equivalent for MLA. The generator's VLLMMLAInnerAttention would then only handle the paged-cache read and write, the same way VLLMInnerAttention does today. If the same kernel ran on both trainer and generator, batch-invariant mode could keep the compressed cache too. That would remove the is_in_batch_invariant_mode() branching now in both registry.py:76 and model_wrapper.py:89.

4. Related cleanups (small)

  • Duplicated mode check: is_in_batch_invariant_mode() drives the compressed-vs-materialized decision in three places:

    • vllm_attention_backend
    • model_config_to_hf_config_dict (kv_lora_rank keys)
    • _replace_vllm_layer_configs

    If any one of them disagrees with the others, the cache gets sized for one layout while the layers use the other. I'd put the decision behind one small predicate used by all three. It should be just isinstance(..., MLAAttention.Config) and not is_in_batch_invariant_mode(), with none of the earlier dim or wkv_b checks, which matches your earlier comment.

  • Duplicated flex error: the "MLA + flex unsupported" ValueError appears twice, at registry.py:83 and model_wrapper.py:107. Keep one.

  • Scale buffers: VLLMMLAInnerAttention.__init__ still sets ShardingConfig.state_shardings for the scale buffers after making them non-persistent. That's fine, since buffers still need to be placed on devices. A one-line comment saying so would answer your earlier "why vllm makes them persistent" question at the call site.


I only reviewed the code; no files were changed. I didn't run the tests, and I couldn't read vLLM's source here, so the claims about vLLM's internals (item 2) still need checking.

@liangel-02
liangel-02 force-pushed the vllm-native-mla branch 3 times, most recently from 3743251 to e56ad19 Compare October 28, 2026 15:50
raise ValueError("No full attention layer found in the model spec.")
kernel_config = attention.inner_attention
if uses_compressed_mla_cache(kernel_config):
return None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

None lets vLLM select a native MLA backend for compressed MLA caches

is this what we defines in titan? what if we add more attn backends in the future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no this is for vllm we want to let vllm auto select mla backend


class TorchTitanModelArchConfigConvertor(ModelArchConfigConvertorBase):
def is_deepseek_mla(self) -> bool:
return getattr(self.hf_text_config, "kv_lora_rank", None) is not None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about kimik3 mla?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes this works for both this is just overriding the vllm function that decides is_mla

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

give it a more general name then?


# vLLM sets is_mla based on specific model types, and we pass in
# model_type="torchtitan", so is_mla would be False.
# TODO: Wait until the vLLM PR adding register_model_arch_config_convertor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we ping reviewers to review?

return getattr(self.hf_text_config, "kv_lora_rank", None) is not None

# vLLM sets is_mla based on specific model types, and we pass in
# model_type="torchtitan", so is_mla would be False.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought this makes is_mla = True?

linear applies.
"""

quant_method = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yea we want to select unquantized branch

scale: float

@property
def is_full_attention(self) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't be always true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is always true but InnerAttention.Config.is_full_attention defaults to false

Comment thread torchtitan/rl/generator/vllm/mla.py Outdated
attention_metadata: None = None,
**kwargs,
) -> torch.Tensor:
"""Run vLLM MLA attention on local (non-DTensor) tensors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we don't have Dtensor anymore during runtime?

"converter's FQNs."
)
self.wkv_b = config.wkv_b.build()
self.inner_attention = config.inner_attention.build(kv_b_proj=self.wkv_b)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

qq: why do we need to pass in kv_b_proj=self.wkv_b?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

compressed cache needs wkv_b inside the attention kernel cus the cache holds the latent from before wkv_b is applied so the kernel has to apply it itself

@tianyu-l tianyu-l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

please merge after @acisseJZhong approves

Comment on lines +70 to +71
trainer's. For a bf16 ``Linear`` they are views of ``wkv_b.weight``, so weight
sync's in-place copy updates them without re-deriving.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting ... the name w_uk and w_uv suggest to me that they are for k and v, respectively. But it looks like it's not the case, at least for bf16.

).view(num_tokens, -1, self.v_head_dim)


class VLLMMLAAttention(MLAAttention):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

will generator CP work under this design(right now we don't support generator CP)? do we replace VLLMMLAAttention with CP variant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no need to replace rn vllm will handle but also after i land this pr i plan to implement a solution in attention-gym/flash attn so that kernel will need to handle cp

@acisseJZhong acisseJZhong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need to address #5556 (comment)

@liangel-02
liangel-02 merged commit ddbea8b into main Oct 29, 2026
30 of 31 checks passed
@liangel-02
liangel-02 deleted the vllm-native-mla branch October 29, 2026 15:08
fegin added a commit that referenced this pull request Oct 30, 2026
)

## Summary (human-written)

Merge conflicts from the previous PRs cause CI failing.
`disable_cuda_graph`->`disable_accelerator_graphs`

## Why
CPU Unit Test fails on main:
https://github.com/pytorch/torchtitan/actions/runs/40973844709/job/123796998693

#5353 renamed `training.disable_cuda_graphs` to
`training.disable_accelerator_graphs`. #4920 and #5556 landed after it
and still use the old name.
`TestShippedCpRecipes::test_every_cp_recipe_passes_the_gate` builds
`deepseek_v4_debugmodel_fsdp4_ep4` and fails:

AttributeError: 'TrainingConfig' object has no attribute
'disable_cuda_graphs'

`rl_grpo_deepseek_v3_debug_varlen` in `alphabet_sort.py` has the same
stale keyword. No CPU test builds it, but it raises `TypeError` when
run.

## What changed
- Mechanical rename in two places: `tests/integration_tests/models.py`
and `torchtitan_recipes/tests/rl/alphabet_sort.py`.

## Testing
- `git grep disable_cuda_graphs` returns nothing.
- Expect the CPU Unit Test job on this PR to pass
`test_every_cp_recipe_passes_the_gate`.
wwwjn added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 10, 2026
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 added a commit that referenced this pull request Nov 11, 2026
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 added a commit that referenced this pull request Nov 11, 2026
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 added a commit that referenced this pull request Nov 18, 2026
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)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
     this approach, and what you checked yourself. -->

## Why

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

- DeepSeek V3 and Kimi K3 have run RL end to end in CI since #5556
(2026-10-29) and #4680 (2026-10-02), but are listed as "Not supported"
and "Support coming soon". Their tests, `rl_grpo_deepseek_v3_debug` and
`rl_grpo_kimi_k3_debug_batch_invariant`, run in the RL H100 Integration
Tests on every push to main and every 12 hours.
- Muse Spark and Qwen 3.5/3.6/3.8 are listed as "text only", but both
run image prompts end to end with the image RL stack:
`rl_grpo_qwen3_5_0_8b_geometry3k` (Qwen3.5-0.8B on Geometry3K, #5825)
and `rl_muse_spark_816b_a42b_slake_lora_gb300` (Muse Spark 816B-A42B on
SLAKE, 32 GB300 GPUs, #6025).

**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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/b200 Trigger B200 CI 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.

4 participants