Training engine: implement eval_step API - #5097
Open
SurbhiJainUSC wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements evaluation functionality in the MaxText training engine, introducing an evaluation context, an evaluation step, and separate metrics recording and logging for training and evaluation modes. The review feedback highlights two key improvement opportunities: safely retrieving metrics in _log_metrics to prevent potential KeyError exceptions while also adding console logging for the evaluation mode, and ensuring that _eval_metrics_recorder is properly cleaned up alongside other recorders in the engine's close method.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
SurbhiJainUSC
force-pushed
the
feat/engine-eval-step
branch
8 times, most recently
from
September 2, 2026 05:24
a59e9e6 to
5025681
Compare
SurbhiJainUSC
force-pushed
the
feat/engine-eval-step
branch
from
September 2, 2026 05:26
5025681 to
e746b23
Compare
SurbhiJainUSC
marked this pull request as ready for review
September 2, 2026 05:35
SurbhiJainUSC
requested review from
A9isha,
NuojCheng,
RissyRan,
abhinavclemson,
aireenmei,
bvandermoon,
darisoy,
dipannita08,
gagika,
gobbleturk,
hengtaoguo,
igorts-git,
jiangjy1982,
khatwanimohit,
richjames0,
shralex and
vipannalla
as code owners
September 2, 2026 05:35
SurbhiJainUSC
requested review from
huytransformer,
shuningjin and
xibinliu
as code owners
September 2, 2026 05:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
eval_step()API inMaxTextTrainingEnginemirroring tunix's peft_trainer_v2.modeargument and the engine owns a second mode="eval" instance, keeping eval numbers out of the train buffer and out of the checkpoint; MetricsBuffer.mode then flows through write_metrics into both the console line and the TensorBoard tag, which becomes {mode}/{name}.Tests
CI tests
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.