Skip to content

Add a new goodput elastic utils function record_slice_state()#4111

Merged
YixuanWang-99 merged 1 commit into
mainfrom
yixuann-dev-goodput
Jun 30, 2026
Merged

Add a new goodput elastic utils function record_slice_state()#4111
YixuanWang-99 merged 1 commit into
mainfrom
yixuann-dev-goodput

Conversation

@YixuanWang-99

@YixuanWang-99 YixuanWang-99 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Update MaxText's utils/elastic_utils.py to add a new record_slice_state helper that queries live slice counts and logs them to the GoodputRecorder. This helper maps the core metrics directly from Pathways and JAX states.

Tests

Passed synthetic tests in tests/unit/elastic_utils_test.py.

Screenshot 2026-06-09 at 9 05 00 PM

Test with a small synthetic workflow and the logs are good:

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

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.63158% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/common/goodput.py 33.33% 13 Missing and 3 partials ⚠️
src/maxtext/utils/elastic_utils.py 85.71% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/maxtext/utils/elastic_utils.py Outdated
Comment thread src/maxtext/utils/elastic_utils.py Outdated
Comment thread src/maxtext/utils/elastic_utils.py Outdated
Comment thread src/maxtext/utils/elastic_utils.py Outdated
Comment thread src/maxtext/utils/elastic_utils.py Outdated
Comment thread src/maxtext/utils/elastic_utils.py Outdated
Comment thread src/maxtext/common/goodput.py Outdated
@YixuanWang-99 YixuanWang-99 requested a review from xibinliu as a code owner June 30, 2026 18:01
@YixuanWang-99 YixuanWang-99 force-pushed the yixuann-dev-goodput branch 6 times, most recently from 2b11855 to f444a0e Compare June 30, 2026 20:49
@YixuanWang-99 YixuanWang-99 merged commit 7538cd4 into main Jun 30, 2026
45 of 46 checks passed
@YixuanWang-99 YixuanWang-99 deleted the yixuann-dev-goodput branch June 30, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants