Skip to content

Add validation to block unsupported parameters in post-training SFT, …#4097

Open
shralex wants to merge 1 commit into
mainfrom
shralex_ux1
Open

Add validation to block unsupported parameters in post-training SFT, …#4097
shralex wants to merge 1 commit into
mainfrom
shralex_ux1

Conversation

@shralex
Copy link
Copy Markdown
Collaborator

@shralex shralex commented Jun 6, 2026

…RL, and DPO

  • SFT, RL, and DPO trainers now error out on optimizer_memory_host_offload=True since the underlying Tunix trainers do not support host offloading.
  • DPO and RL trainers now error out on num_vocab_tiling > 1 since they require full vocabulary projections to compute preference/policy log-probabilities, which is incompatible with vocabulary tiling.
  • Created unit tests for SFT, RL, and DPO validation functions to verify these restrictions.

FIXES: b/520780393

Tests

Added unit tests

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/trainers/post_train/dpo/train_dpo.py 83.33% 1 Missing ⚠️
src/maxtext/trainers/post_train/rl/train_rl.py 83.33% 0 Missing and 1 partial ⚠️
src/maxtext/trainers/post_train/sft/train_sft.py 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…RL, and DPO

- SFT, RL, and DPO trainers now error out on optimizer_memory_host_offload=True since the underlying Tunix trainers do not support host offloading.
- DPO and RL trainers now error out on num_vocab_tiling > 1 since they require full vocabulary projections to compute preference/policy log-probabilities, which is incompatible with vocabulary tiling.
- Created unit tests for SFT, RL, and DPO validation functions to verify these restrictions.
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