Skip to content

fix(scripts): fix checkpoint sharding restore, precompile CLI flag, and rollout sync in grpo demo - #1962

Open
Adityakk9031 wants to merge 1 commit into
google:mainfrom
Adityakk9031:fix/grpo-demo-sharding-restore-and-precompile
Open

fix(scripts): fix checkpoint sharding restore, precompile CLI flag, and rollout sync in grpo demo#1962
Adityakk9031 wants to merge 1 commit into
google:mainfrom
Adityakk9031:fix/grpo-demo-sharding-restore-and-precompile

Conversation

@Adityakk9031

Copy link
Copy Markdown

Description

This PR addresses issues observed when running GRPO with SGLang-JAX and Pathways (#874) by fixing checkpoint restore sharding, enabling static graph precompilation by default, and ensuring restored policy weights are synchronized to the rollout worker before post-training evaluation.

Key Changes

  1. Orbax Checkpoint Sharding Restore Fix:
    • Passed sharding=getattr(x, "sharding", None) to jax.ShapeDtypeStruct during checkpoint restoration.
    • Eliminates the UserWarning: Sharding info not provided when restoring warning and eliminates redundant metadata disk inspection overhead.
  2. Rollout Policy Weight Synchronization:
    • Added rl_engine.rollout.update_params(src_filtered_params, filter_types) immediately after checkpoint restoration so that final evaluation accurately tests the trained/restored weights instead of stale initial rollout weights.
  3. Configurable JAX Precompilation (--skip-jax-precompile):
    • Replaced hardcoded os.environ["SKIP_JAX_PRECOMPILE"] = "1" with an optional CLI flag --skip-jax-precompile (defaulting to False), allowing static graph precompilation during official training/benchmarking runs to reduce step execution latency.

Closes #874

…nd rollout sync in grpo demo

- Pass target sharding to ShapeDtypeStruct in checkpoint restore to avoid Orbax disk fallback and warnings
- Synchronize restored weights to rollout worker prior to post-training evaluation
- Add --skip-jax-precompile CLI flag instead of hardcoding SKIP_JAX_PRECOMPILE=1

Closes google#874
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.

Train GRPO through SGLangJax in Single or Multi Hosts with Pathways

2 participants