You signed in with another tab or window
8000
. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify differences between examples/rl/grpo GSM8K recipes and scripts/grpo_demo_llama3_qwen2.py #939
I’m a bit confused about the two GRPO entry points that seem to cover similar use cases:
Shell scripts under examples/rl/grpo/gsm8k (e.g. run_llama3.2_1b.sh, run_gemma3_1b.sh), which call python -m tunix.cli.grpo_main ... with a base_config.yaml, dataset_name="gsm8k", reward_functions="['tunix/cli/reward_fn/gsm8k.py']", and various overrides for steps, LR, checkpointing, etc.
The Python demo scripts/grpo_demo_llama3_qwen2.py, which sets up GRPO for Llama 3 / Qwen 2 with its own argument parser (e.g. --model-version) .
So what is the main difference? When should I choose this one instead of the other?
The shell scripts are designed for launching GRPO training jobs using the tunix.cli.grpo_main entry point. They are made to be highly configurable, using the base_config.yaml and providing numerous command-line overrides for specific parameters. These scripts are used to set up the entire training environment, including model paths, tokenizer settings, dataset name, batch sizes,optimizer configurations, and GRPO specific hyperparameters.
The Python demo scripts serve as more self-contained, illustrative examples. While they also set up GRPO, they offer a more simplified or specialized interface, abstracting away some of the detailed configuration found in the shell scripts.
Choose shell scripts (python -m tunix.cli.grpo_main) when you:
Need full, fine-grained control over GRPO training (models, optimizers, logging, checkpoints, distributed/mesh configs).
Are running real training jobs on clusters (e.g., TPUs) that require robust, scalable configuration.
Are modifying examples or porting new models into the Tunix GRPO framework.
Are doing production-like runs where precise hyperparameter tuning and resource management matter.
Choose the Python demo scripts ('scripts/grpo_demo_llama3_qwen2.py'):
When you want a quicker, possibly more user-friendly way to get started with GRPO for a specific model without diving deep into all the configuration details.
For demonstrating the core GRPO workflow or for quick tests and development.
If the demo script specifically targets a use case or model combination (e.g., Llama 3 and Qwen 2) that aligns with your immediate needs and offers a simplified setup for that purpose.
If you prefer to define and launch your experiments entirely within a Python environment, potentially allowing for more programmatic control over the setup in a script rather than relying heavily on command-line overrides.
Hi! I would like to work on a small documentation improvement addressing this confusion.
am planning to add a concise comparison of the GRPO CLI-based recipes and the Python demo scripts, including their intended use cases, configuration differences, and supported rollout options based on the current implementation.
I shall keep the change documentation-only and focused on helping new contributors choose the appropriate entry point.
Would this be a useful addition to the existing documentation?
Activity
SarveshMahalingam commentedon Dec 31, 2025
The shell scripts are designed for launching GRPO training jobs using the tunix.cli.grpo_main entry point. They are made to be highly configurable, using the base_config.yaml and providing numerous command-line overrides for specific parameters. These scripts are used to set up the entire training environment, including model paths, tokenizer settings, dataset name, batch sizes,optimizer configurations, and GRPO specific hyperparameters.
The Python demo scripts serve as more self-contained, illustrative examples. While they also set up GRPO, they offer a more simplified or specialized interface, abstracting away some of the detailed configuration found in the shell scripts.
Choose shell scripts (
python -m tunix.cli.grpo_main) when you:Choose the Python demo scripts ('scripts/grpo_demo_llama3_qwen2.py'):
Hope this helps
zyh1999 commentedon Dec 31, 2025
Thanks for your answer! Is the Python demo version currently the only one that supports sglang rollout?
shreya-mishra325 commentedon Oct 24, 2026
Hi! I would like to work on a small documentation improvement addressing this confusion.
am planning to add a concise comparison of the GRPO CLI-based recipes and the Python demo scripts, including their intended use cases, configuration differences, and supported rollout options based on the current implementation.
I shall keep the change documentation-only and focused on helping new contributors choose the appropriate entry point.
Would this be a useful addition to the existing documentation?