Skip to content

Conversation

@SamuelMarks
Copy link
Collaborator

Description

A large number of arguments for a function is a code smell. Additionally, usage of Pydantic enables future interesting use-cases like providing all the parameters in, e.g., REST APIs, SQL models, CLIs. And reused across the codebase without duplication. By centralising it to the class, it also enables future extensibility and refactoring.

If the change fixes a bug or a Github issue, please include a link, e.g.,:
N/A

Tests

CI

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

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 52.85714% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/MaxText/elastic_train.py 0.00% 18 Missing ⚠️
src/MaxText/sft_trainer.py 0.00% 10 Missing ⚠️
src/MaxText/train.py 72.22% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@SamuelMarks SamuelMarks force-pushed the train-pydantic branch 4 times, most recently from c1dae75 to 87ac5f0 Compare January 17, 2026 04:40
@SamuelMarks SamuelMarks marked this pull request as ready for review January 17, 2026 06:03
…ontext`, a new pydantic class for defining training context (as opposed to the old 11-arity solution) ; [src/MaxText/{elastic_train,max_utils_test,sft_trainer,train,train_utils}.py,tools/gcs_benchmarks/standalone_dataloader.py] Percolate usage of new `TrainContext`
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