Skip to content

Abhinav/elastic snapshot#4449

Open
abhinavclemson wants to merge 104 commits into
lukebaumann/elastic-checkpointfrom
abhinav/elastic-snapshot
Open

Abhinav/elastic snapshot#4449
abhinavclemson wants to merge 104 commits into
lukebaumann/elastic-checkpointfrom
abhinav/elastic-snapshot

Conversation

@abhinavclemson

Copy link
Copy Markdown
Collaborator

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456

You can also provide a comma-separated list. If you don't want to close a bug but
simply to reference it, use BUGS, e.g.:
BUGS: b/123456

Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.

Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.

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.

Pooya Moradi and others added 30 commits June 15, 2026 18:19
…ards

Currently the reward stack is hardcoded to a 3-fn list:
[match_format_exactly, match_format_approximately, check_numbers].
Replacing it requires editing train_rl.py.

Add two new config fields:
  - reward_functions_path: path to a user Python file
  - reward_functions: comma-separated list of function names to import

When both are set, the built-in reward stack is REPLACED entirely by the
user-provided functions (so users can pin a single VTC-style partial-credit
reward, swap in a math_verify-based scorer, etc., without editing maxtext).

Each user function must accept (prompts, completions, tmvp_config, **kwargs)
and return a list of floats.

Default (both empty) keeps existing behavior unchanged.

Reuses `_load_custom_callable` helper added in the previous commit.
- Fixes shape mismatch issues on tail batches in GRPO training by enabling drop_remainder=True on training and test datasets.
- Updates unit tests (train_rl_test.py) to mock configurations compatible with drop_remainder=True and specific batch sizes.
- Prevents host CPU OOM by keeping the pool size of math_verify_pool constant.
- Includes a template gpt_oss_rl.json for RL chat.
hlo_diff_test loaded each model yml directly as the top-level config, which
skips base.yml and leaves pure_nnx at its pydantic schema default (False), so
the test kept silently compiling the Linen path even after the NNX defaults
were flipped to True in base.yml. Its reference HLOs are therefore still Linen.

Compile via base.yml + model_name (the normal training path) so the config
inherits base.yml's logical_axis_rules and exercises the NNX path. The three
reference HLOs are regenerated for NNX via the Update HLO References workflow.

Also flip the enable_nnx/pure_nnx/pure_nnx_decoder pydantic schema defaults to
True so a config built without base.yml no longer silently falls back to the
Linen path.
This avoids compilation OOM on TPU7x-8 slices by reducing the number of layers from 5 and 4 to 3. The skip guard for TPU7x is also removed.
Co-authored-by: Xibin Liu <xibin@google.com>
…-nnx-restore

PiperOrigin-RevId: 941369401
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.