[feat] multiplex trainer token export and agg to prime monitor on orch side#2641
Open
Jackmin801 wants to merge 6 commits into
Open
[feat] multiplex trainer token export and agg to prime monitor on orch side#2641Jackmin801 wants to merge 6 commits into
Jackmin801 wants to merge 6 commits into
Conversation
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.
Note
Medium Risk
Changes distributed export layout, cross-rank STABLE coordination, and orchestrator filesystem metrics; low production impact but affects multi-run debugging and monitoring correctness.
Overview
Multi-run token exports now land under each run’s directory (
output_dir/<run_id>/token_exports/step_<run_step>/) instead of only the trainer root, withrun_id/run_stepstamped on micro-batches in the packer and carried through transport and the data loader.The trainer marks export steps complete via a distributed
STABLEfile after each step (mark_stableat end of forward/backward), and export records gainexport_stepandrun_id. Non-exporting CP ranks still participate in stable marking.The orchestrator reads stable
token_exportsJSONL and logs aggregated entropy and mismatch_kl (mean/max over loss-masked tokens) to the monitor, one stable step at a time. Docs and unit/integration tests cover run-local paths and metrics.Reviewed by Cursor Bugbot for commit d6bb6bb. Bugbot is set up for automated code reviews on this repo. Configure here.