Skip to content

[rl] support short --module names for RL examples - #3691

Merged
yichuan-w merged 1 commit into
pytorch:mainfrom
yichuan-w:yichuan/module-shortname
Jun 17, 2026
Merged

yichuan-w merged 1 commit into
pytorch:mainfrom
yichuan-w:yichuan/module-shortname

Conversation

@yichuan-w

Copy link
Copy Markdown
Member

Follow-up to #3684. Now that each RL example owns its config_registry under rl/examples/<name>, running one meant typing the full --module torchtitan.experiments.rl.examples.alphabet_sort. This lets ConfigManager resolve the short name like it does for models/experiments.

What changed:

  • config/manager.py: when resolving a short --module name, also search torchtitan.experiments.rl.examples.<name>.config_registry (after torchtitan.models and torchtitan.experiments).
  • experiments/__init__.py: register alphabet_sort and search_r1 as supported shorthands.
  • Switch the integration tests, READMEs, train/example docs and loss_compare.py back to the short names (e.g. --module alphabet_sort).

So --module alphabet_sort --config rl_grpo_qwen3_0_6b_varlen now works like --module llama3.

Verified locally:

  • --module llama3 --config llama3_debugmodel still builds (no regression).
  • --module alphabet_sort --config rl_grpo_qwen3_0_6b_varlen and --module search_r1 --config rl_grpo_qwen3_1_7b_search_r1 resolve and build.
  • unknown short name still errors, now listing the rl-examples search path.
  • added a CPU unit test for the shorthand registration (full resolution is exercised by the RL integration tests, which run --module alphabet_sort and pull in vLLM).

cc @tianyu-l — this is the manager.py change you sketched.

After #3684 each RL example owns its config_registry under
rl/examples/<name>, so they had to be run with the full
--module torchtitan.experiments.rl.examples.<name>. Let ConfigManager also
search torchtitan.experiments.rl.examples when resolving a short --module name,
and register alphabet_sort / search_r1 as shorthands, so --module alphabet_sort
works like --module llama3.

Switch the integration tests, READMEs, train/generate docs and loss_compare back
to the short names.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 16, 2026
@yichuan-w
yichuan-w merged commit d7f468c into pytorch:main Jun 17, 2026
24 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl ciflow/8gpu 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