Repository navigation
Add a LoRA notebook to the async GRPO math example - #8686
behroozazarkhalili wants to merge 1 commit into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. Pages changed in this PR: |
qgallouedec
left a comment
There was a problem hiding this comment.
Thanks! I'm not sure a notebook adds much here: async_grpo_lora_math.py in the same folder already runs LoRA AsyncGRPO on GSM8K, and since AsyncGRPO needs a separate vLLM server, the notebook can't be the Colab-ready version either. I feel like someone landing in this folder wouldn't understand why we have both. @sergiopaniego wdyt?
If we keep it, a few things to bring it closer to the other notebooks:
- Pass the arguments to
AsyncGRPOConfigdirectly, likegrpo_qlora.ipynb, instead of the config dataclasses and the smoke-test mode. - Section 7 retells the trainer's source and the defaults cell will drift; a link to the AsyncGRPO docs is enough.
hub_model_idpoints to your account.- The notebook says it needs two GPUs, but the committed run shared one 10 GB slice, so the outputs don't come from the setup it describes.
|
Thanks for the review! I'm happy to change whatever you want here. If you and Sergio decide to keep it, I'll make all four changes:
If you'd rather not have a notebook next to |
|
One more option, in case it is more useful than a second GSM8K example: I can move the notebook off GSM8K and into its own folder, so it no longer sits next to For example, the BioGRID task from |
|
Thanks for putting these notebooks together! After going through all five, I'll close them, with the reason for each in its PR. Mostly they overlap with existing examples or docs, or show a single feature in isolation. The direction we're taking with examples is a task told end to end, with a measured before and after, like the chess example in #8085. For this one: I agree with Quentin, As Quentin mentioned, updating the existing notebooks would be very welcome: one PR per example, run end to end. Maybe start with one, so we can align on the format before the rest. Thanks! |
This adds
examples/async_grpo_math/async_grpo_math.ipynbnext to the two scripts, and updates the example's row in the overview.The notebook starts a vLLM server, trains a LoRA adapter on GSM8K with
AsyncGRPOTrainer, and reads the trainer's metrics. The server and the trainer share one GPU. In the committed run, 200 steps take 43 minutes on a 10 GB slice of an H100; correct answers on the GSM8K test set go from 39.9% to 50.2%, and answers in the requested format from 3.5% to 97.0%. It needs a vLLM server, so it does not run on free Colab.The outputs come from one end-to-end run.
Note
Low Risk
Documentation and example-only changes; no TRL trainer or library code is modified.
Overview
Adds
examples/async_grpo_math/async_grpo_math.ipynb, a tutorial that walks through LoRAAsyncGRPOTraineron GSM8K with Qwen2.5-0.5B-Instruct: vLLM server setup, importable GSM8K reward module, training, trainer metrics, and greedy test-set evaluation against the base model. The committed run shows ~200 steps on a shared 10 GB H100 slice (39.9% → 50.2% correct, 3.5% → 97.0% format).Updates the
async_grpo_mathrow indocs/source/example_overview.mdto mention the notebook, single-GPU co-location, and that it requires a vLLM server (not free Colab).Reviewed by Cursor Bugbot for commit 72880a2. Bugbot is set up for automated code reviews on this repo. Configure here.