Skip to content

Add RL GRPO gemma4-26b tutorial and fix doc conversion links#4580

Open
dasoto wants to merge 1 commit into
mainfrom
davidsotomora/gemma4-26b-grpo-tutorial
Open

Add RL GRPO gemma4-26b tutorial and fix doc conversion links#4580
dasoto wants to merge 1 commit into
mainfrom
davidsotomora/gemma4-26b-grpo-tutorial

Conversation

@dasoto

@dasoto dasoto commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds a Reinforcement Learning (GRPO) tutorial and launch script for gemma4-26b (26B-A4B MoE) on Ironwood (Cloud TPU v7x), following the same format as the existing gemma4-e4b recipe. It also fixes several broken documentation links in the existing RL tutorials and registers the per-model Gemma RL tutorials in the docs table of contents.

What's added

  • docs/tutorials/posttraining/rl_gemma4_26b.md — step-by-step tutorial to run gemma4-26b GRPO on the OpenMathInstruct-2 dataset on a tpu7x-4x4x4 (64-chip) slice. Mirrors the gemma4-e4b tutorial structure: prerequisites, HF auth, checkpoint conversion, chat-template setup, workload submission, monitoring, and export back to HF.
  • src/maxtext/trainers/post_train/rl/scripts/run_gemma4_26b_rl.sh — XPK/Pathways launch script for the recipe. Mirrors run_gemma4_e4b_rl.sh and applies the 26B-specific configuration (model gemma4-26b, base tokenizer google/gemma-4-26B-A4B, MoE rollout expert-parallelism, tpu7x-4x4x4 slice, pinned Pathways images, etc.).

Docs housekeeping (fixes to existing RL tutorials)

  • Registered rl_gemma4_26b.md and the previously-orphaned rl_gemma4_e4b.md in post_training_index.md (RL list + toctree).
  • Fixed a broken relative link to the build guide (../../build_maxtext.md../build_maxtext.md).
  • Fixed broken MyST cross-references: the bare [...](hf-to-maxtext) / [...](maxtext-to-hf) links did not resolve. Replaced them with the working file+anchor form (../../guides/checkpointing_solutions/convert_checkpoint.md#hugging-face-to-maxtext and #maxtext-to-hugging-face), matching the pattern already used in dpo.md / lora.md / rl_on_multi_host.md.
  • These link fixes were applied across rl.md, rl_gemma4_e4b.md, rl_gptoss_20b.md, and rl_qwen3_30b.md (scoped to the RL tutorials only).

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@dasoto
dasoto force-pushed the davidsotomora/gemma4-26b-grpo-tutorial branch from d715bf6 to 1c20e9c Compare July 23, 2026 19:38
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dasoto
dasoto marked this pull request as ready for review July 23, 2026 19:52
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

1 participant