Repository navigation
[rl] GQA attention enablement in torchtitan vllm wrapper - #2299
Merged
Merged
Conversation
fix comments remove tests add enable_gqa flag [ghstack-poisoned]
Contributor
Author
| for layer in self.model.layers.values(): | ||
| h = layer(h, rope_cache, attention_masks=None, positions=positions) | ||
|
|
||
| h = self.model.norm(h) |
Contributor
There was a problem hiding this comment.
so norm is not included in self.model and we need to manually apply outside?
Contributor
Author
There was a problem hiding this comment.
We are manually calling forward for each module within self.model. Previously the norm layer is in compute_logits, but now I moved it to forward function similiar to vllm's native qwen3 implementation. From the numerics test, I don't see these change affecting final results
Following #2259 Context: Fix RL attention implementation, add numerics check scripts comparing torchtitan Qwen3 model (with vllm wrapper) and vllm native Qwen3 model NOTE: I tried enabling CI for this work, but need more efforts install vllm from source code (need to build vllm from scratch). Will enable CI in later PRs [ghstack-poisoned]
tianyu-l
approved these changes
Feb 2, 2026
TXacs
pushed a commit
to McmillanTAC/torchtitan
that referenced
this pull request
Apr 13, 2026
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * pytorch#2300 * __->__ pytorch#2299 Following pytorch#2259 Context: Fix RL attention implementation, add numerics check scripts comparing torchtitan Qwen3 model (with vllm wrapper) and vllm native Qwen3 model NOTE: I tried enabling CI for this work, but need more efforts install vllm from source code (need to build vllm from scratch). Will enable CI in later PRs
ACharacterInASimulation
pushed a commit
to ACharacterInASimulation/torchtitan
that referenced
this pull request
Apr 21, 2026
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * pytorch#2300 * __->__ pytorch#2299 Following pytorch#2259 Context: Fix RL attention implementation, add numerics check scripts comparing torchtitan Qwen3 model (with vllm wrapper) and vllm native Qwen3 model NOTE: I tried enabling CI for this work, but need more efforts install vllm from source code (need to build vllm from scratch). Will enable CI in later PRs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Following #2259
Context: Fix RL attention implementation, add numerics check scripts comparing torchtitan Qwen3 model (with vllm wrapper) and vllm native Qwen3 model
NOTE: I tried enabling CI for this work, but need more efforts install vllm from source code (need to build vllm from scratch). Will enable CI in later PRs