Skip to content

[RL] Name the varlen attention backend after TorchTitan - #4786

Merged
drisspg merged 1 commit into
mainfrom
drisspg/rl-attention-backend-name
Sep 21, 2026
Merged

drisspg merged 1 commit into
mainfrom
drisspg/rl-attention-backend-name

Conversation

@drisspg

@drisspg drisspg commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rename PyTorchVarlenInnerAttentionBackend to TorchTitanVarlenInnerAttentionBackend, following the naming feedback on #4738. This is a class-name-only change; vLLM's CUSTOM registration and implementation remain unchanged.

Validation

  • Verified AttentionBackendEnum.CUSTOM.get_class() resolves to the renamed class and its registry name remains CUSTOM.
  • Scoped pre-commit passed; the global mutating Pyrefly hook was skipped.

@drisspg
drisspg added this pull request to stack #4788 September 18, 2026 19:19
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 18, 2026
@drisspg
drisspg marked this pull request as ready for review September 18, 2026 19:29
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Sep 18, 2026

@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.

see inline

Comment thread torchtitan/rl/model/attention.py Resolved
Comment thread torchtitan/rl/model/attention.py Resolved
@drisspg
drisspg force-pushed the drisspg/rl-attention-backend-name branch from 2a3bf6f to f253f8f Compare September 18, 2026 21:52
@drisspg
drisspg force-pushed the drisspg/rl-attention-backend-name branch from f253f8f to 872fbb2 Compare September 21, 2026 23:27
@drisspg
drisspg merged commit e9956a3 into main Sep 21, 2026
19 checks passed
drisspg added a commit that referenced this pull request Sep 22, 2026
## Summary

Restore the declared model sharding after Hugging Face format
conversion, before extracting plain local tensors.

Qwen3.5's QKV fuse/split operations can change DTensor placements: a TP2
projection expected as `Shard(0)` became `Shard(1)`, producing local
`[2048, 512]` instead of `[1024, 1024]`. Convolution and vision weights
were affected too. The RL checkpoint adapter now redistributes to each
parameter's existing layout before `to_local()`; it does not reshape
incorrect shards or change CUDA-graph behavior.

Adds a two-rank CPU/Gloo regression with independent expected local
slices and runs it in RL CI. Naming-only follow-up #4786 is the lower
stack layer.

## Validation

- New regression reproduces the original failure on both ranks and
passes with the fix.
- Six focused wrapper/GDN metadata tests passed on this stack; scoped
pre-commit passed. Scoped Pyrefly retains five verified preexisting
errors in unchanged all-reduce code; no new errors.
- Before stacking, the same adapter fix passed regular Qwen3.5-0.8B TP2
eager/FULL inference on two GB200s: exact rank-local weights, 96
tokens/logprobs, 44 state records, and 43 native FULL replays per rank.
- **GPU-run caveat:** both runs completed inference artifacts but hit
the 60-second deadline during shutdown. Clean shutdown and
batch-invariant TP2 remain unvalidated. Runtime used Torch/vLLM Sep13
nightlies, FA4 b31, and Gym commit `4ac49088a`, not a clean release-pin
install.

```sh
.venv/bin/python -m pytest -v -ra tests/unit_tests/rl/test_vllm_wrapper.py tests/unit_tests/rl/test_gdn_graph_metadata.py
```
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