Repository navigation
[Experimental][rl][unified] Update infer.py example to work with vLLM nightly - #2226
Conversation
|
cc @wwwjn @acisseJZhong for review :) |
|
LGTM! thanks for the fix. Curious why vllm's Attention requires batch and seq_len dim flattened? Is attention input shape (batch, seq_len, num_heads, head_dim) no longer working? |
Yes I got this particular error: Let me see if I can link the actual pr doing the attention change on vLLM side |
|
Ah sorry - that actually seems like just an output issue, probably doesn't need the input reshape let me see if I can refactor it simpler |
|
I took a look, and seems that this refactor (vllm-project/vllm#31596) caused the 4d input to not be handled correctly - only 2d and 3d input is handled so this change seems necessary |
looks like there's an ongoing fix for 4d input vllm-project/vllm#32274 |
812a781 to
11a8810
Compare
11a8810 to
7204c09
Compare
|
Thanks for patience - the lintrunner signal seems preexisting :) ready for re-review |
… nightly (pytorch#2226) NOTE: This PR should be landed on top of pytorch#2219 Few changes seem to be needed to get working; namely: 1) Update to use `spawn` method for CUDA fork 2) Modify attention import to be correct after refactor 3) Modify attention dimensions to be correct after refactor Follow steps in the readme then run ``` python torchtitan/experiments/rl/unified/infer.py --model-ckpt-path torchtitan/experiments/rl/example_checkpoint/Qwen3-0.6B ``` ``` [2026-01-13 15:20:58] INFO infer.py:113: Generation complete Prompt: Hello, my name is Generated text: " Josh and I'm in the middle of a project to develop a hybrid mobile app. I'm looking for guidance on how to go about using modular frameworks. I want to use React and Vue. I need to decide on the framework to use. Can you help me choose the right framework and suggest some best practices for using them?\n\nAdditionally, I want to know what are the best practices for using a modular framework in the context of a web application? Also, what are the best practices for using a" ```
… nightly (pytorch#2226) NOTE: This PR should be landed on top of pytorch#2219 Few changes seem to be needed to get working; namely: 1) Update to use `spawn` method for CUDA fork 2) Modify attention import to be correct after refactor 3) Modify attention dimensions to be correct after refactor ### Test Plan Follow steps in the readme then run ``` python torchtitan/experiments/rl/unified/infer.py --model-ckpt-path torchtitan/experiments/rl/example_checkpoint/Qwen3-0.6B ``` ### Output ``` [2026-01-13 15:20:58] INFO infer.py:113: Generation complete Prompt: Hello, my name is Generated text: " Josh and I'm in the middle of a project to develop a hybrid mobile app. I'm looking for guidance on how to go about using modular frameworks. I want to use React and Vue. I need to decide on the framework to use. Can you help me choose the right framework and suggest some best practices for using them?\n\nAdditionally, I want to know what are the best practices for using a modular framework in the context of a web application? Also, what are the best practices for using a" ```
… nightly (pytorch#2226) NOTE: This PR should be landed on top of pytorch#2219 Few changes seem to be needed to get working; namely: 1) Update to use `spawn` method for CUDA fork 2) Modify attention import to be correct after refactor 3) Modify attention dimensions to be correct after refactor ### Test Plan Follow steps in the readme then run ``` python torchtitan/experiments/rl/unified/infer.py --model-ckpt-path torchtitan/experiments/rl/example_checkpoint/Qwen3-0.6B ``` ### Output ``` [2026-01-13 15:20:58] INFO infer.py:113: Generation complete Prompt: Hello, my name is Generated text: " Josh and I'm in the middle of a project to develop a hybrid mobile app. I'm looking for guidance on how to go about using modular frameworks. I want to use React and Vue. I need to decide on the framework to use. Can you help me choose the right framework and suggest some best practices for using them?\n\nAdditionally, I want to know what are the best practices for using a modular framework in the context of a web application? Also, what are the best practices for using a" ```
… nightly (pytorch#2226) NOTE: This PR should be landed on top of pytorch#2219 Few changes seem to be needed to get working; namely: 1) Update to use `spawn` method for CUDA fork 2) Modify attention import to be correct after refactor 3) Modify attention dimensions to be correct after refactor ### Test Plan Follow steps in the readme then run ``` python torchtitan/experiments/rl/unified/infer.py --model-ckpt-path torchtitan/experiments/rl/example_checkpoint/Qwen3-0.6B ``` ### Output ``` [2026-01-13 15:20:58] INFO infer.py:113: Generation complete Prompt: Hello, my name is Generated text: " Josh and I'm in the middle of a project to develop a hybrid mobile app. I'm looking for guidance on how to go about using modular frameworks. I want to use React and Vue. I need to decide on the framework to use. Can you help me choose the right framework and suggest some best practices for using them?\n\nAdditionally, I want to know what are the best practices for using a modular framework in the context of a web application? Also, what are the best practices for using a" ```
NOTE: This PR should be landed on top of #2219
Few changes seem to be needed to get working; namely:
spawnmethod for CUDA forkTest Plan
Follow steps in the readme then run
Output