Skip to content

docs: Add Tutorial proposal for RLHF using genrm_compare resources server. - #1046

Closed
ffrujeri wants to merge 3 commits into
mainfrom
ffrujeri/rlhf-genrm-tutorial
Closed

ffrujeri wants to merge 3 commits into
mainfrom
ffrujeri/rlhf-genrm-tutorial

Conversation

@ffrujeri

@ffrujeri ffrujeri commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds documentation and tooling for GRPO / RLHF-style training with NeMo Gym’s GenRM compare server, HelpSteer3 → JSONL conversion, a Nemotron 3 Super NeMo RL example recipe, tests, and doc/navigation updates.

To build the docs and visualize locally please do:

cd docs
make docs-live

Issues

Closes #354

Usage

Convert HelpSteer3 (preference subset) to NeMo Gym JSONL (from repo root, with Gym dev env / uv):

uv run python resources_servers/genrm_compare/scripts/helpsteer3_to_nemo_gym_jsonl.py \
  --output-dir data/helpsteer3_gym

Run unit tests for the conversion helpers:

uv run pytest tests/test_helpsteer3_to_nemo_gym_jsonl.py -q

NeMo RL: Use or compose from the example recipe (paths relative to the bundled Gym tree):

  • examples/nemo_rl/grpo_nemotron3_super_genrm_helpsteer3_pipeclean.yaml

Set data.train.data_path / data.validation.data_path to the converted JSONL files and configure the GenRM checkpoint in env.nemo_gym.genrm_model (or your launcher’s genrm_model_name).

Docs: Build or read the tutorial:

  • Source: docs/training-tutorials/nemo-rl-grpo/rlhf-genrm-helpsteer3.md
  • After make docs-html under docs/: training-tutorials/nemo-rl-grpo/rlhf-genrm-helpsteer3.html

Additional Information

  • Tutorial (rlhf-genrm-helpsteer3.md): HelpSteer3 formatting, wiring resources_servers/genrm_compare/configs/genrm_compare.yaml + genrm_model, batch / num_rollouts_per_prompt alignment, Arena-Hard v2 evaluation pointers, Nemotron 3 Nano vs Super note.
  • Example config (examples/nemo_rl/grpo_nemotron3_super_genrm_helpsteer3_pipeclean.yaml): Pipeclean-scale NeMo RL YAML aligned with large-cluster GRPO + GenRM judge layout; policy default HF id nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16.
  • Script (resources_servers/genrm_compare/scripts/helpsteer3_to_nemo_gym_jsonl.py): Truncates context to the last user turn (GenRM requirement), HTML-unescapes content, optional --max-samples for smoke tests.
  • Tests (tests/test_helpsteer3_to_nemo_gym_jsonl.py): Covers trim, unescape, JSON-string context, and full row shape.
  • Navigation: Training tutorial index + NeMo RL GRPO toctree card; docs/conf.py redirect tutorials/nemo-rl-grpo/rlhf-genrm-helpsteer3.html; model recipes “See also”; resources_servers/genrm_compare/README.md links to the tutorial and example YAML.

@copy-pr-bot

copy-pr-bot Bot commented Apr 9, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ffrujeri
ffrujeri marked this pull request as draft April 9, 2026 21:44
@ffrujeri ffrujeri changed the title Add Tutorial proposal for RLHF using genrm_compare resources server. docs: Add Tutorial proposal for RLHF using genrm_compare resources server. Apr 9, 2026
@ffrujeri ffrujeri mentioned this pull request Apr 9, 2026
2 tasks
adil-a and others added 2 commits June 19, 2026 06:37
…RLHF run

Validated the GenRM-compare + HelpSteer3 GRPO tutorial end-to-end on H100
(Nano-30B-A3B policy + 235B Qwen3-Nemotron GenRM judge, 2 nodes, latest NeMo RL).
The pipeline reaches rollouts -> GenRM pairwise judging -> GRPO steps only after
the fixes below; this commit makes the shipped recipe runnable and documents the
remaining gotchas + one dependency-level blocker.

Recipe (examples/nemo_rl/grpo_nemotron3_super_genrm_helpsteer3_pipeclean.yaml):
- add data.use_multiple_dataloader: false (current NeMo RL setup() raises
  KeyError: 'use_multiple_dataloader' without it)
- reasoning_parser_plugin: correct the subpath and note it must be ABSOLUTE -- vLLM
  resolves it against the Ray worker CWD, so a relative path fails with
  "reasoning_parser_name='nano_v3' has not been registered"
- repoint genrm_simple_agent_reasoning_off -> policy_model; the shipped agent
  references an undefined policy_model_reasoning_off, which aborts NeMo Gym config
  validation ("Could not find ... name='policy_model_reasoning_off'")

Docs (docs/training-tutorials/nemo-rl-grpo/rlhf-genrm-helpsteer3.md):
- add a "Validated 2-node H100 smoke setup" section: container needs the nemo_gym
  extra; cap the GenRM max_model_len; allocate NUM_SLURM_NODES > NUM_ACTOR_NODES so
  the GenRM model server gets its own node; prefer loading only genrm_compare.yaml
  + genrm_model_name to avoid an inconsistent merged genrm_model block
- expand Troubleshooting with the observed failure modes, including the GenRM HTTP
  500 (prometheus_fastapi_instrumentator '_IncludedRouter' crash) that silently
  collapses rewards to default_score (constant reward_mean)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: adil-a <[email protected]>
…nRM HTTP 500s)

vLLM's in-process OpenAI API server is instrumented with
prometheus-fastapi-instrumentator, whose get_route_name() does `route.path` and
raises AttributeError on routes that lack it (e.g. vLLM's `_IncludedRouter`), turning
EVERY request into an HTTP 500. For the GenRM model server this silently collapses
genrm_compare to `default_score` (constant reward_mean, no learning signal) even
though training appears to run.

Wrap `routing.get_route_name` to catch AttributeError and return None, inside
`_vllm_asyncio_task` right before `run_server` (the process/thread that actually
serves requests); the instrumentator middleware already falls back to
`request.url.path` when route-name resolution returns None.

Validated end-to-end on 2x8xH100 (Nemotron-3-Nano-30B policy + 235B Qwen3-Nemotron
GenRM judge): 0 GenRM 500s, 0 parse failures, reward varied across GRPO steps
(Avg Reward 3.84 -> 3.52) vs the prior flat 3.0 default.

Docs: known-blocker warning -> "fixed" note; added multi-node operational notes
(shared NEMO_GYM_VENV_DIR, optimizer CPU offload for policy OOM, fresh checkpoint_dir).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: adil-a <[email protected]>
@ffrujeri ffrujeri closed this Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: reward model as verifier

2 participants