Skip to content

Linting low-hanging fruit across MaxText, MaxText/input_pipeline, MaxText/layers #1457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025

Conversation

SamuelMarks
Copy link
Collaborator

@SamuelMarks SamuelMarks commented Mar 26, 2025

Description

For commentary see #1108

EDIT0: Hmm this has 194 files… can think about how to split it out smaller, maybe per folder rather than per module?

EDIT1: Here we go again

fd -Ftd -j1 -x bash -c 'd=${0:2}; d=${d//\//.}; git switch main && 
if ! git rev-parse --verify &>/dev/null; then git checkout -b "PKG-FIX_${d}" && git checkout test-fixer "${0}" && git commit -S -am "[${d}] Python package layout support and minor other fixes" && git push mine "PKG-FIX_${d}" && gh pr create --title "[${d}] Python package layout support and minor other fixes" --body "
For commentary see #1108"; fi' {//}

EDIT2: Merge this before #1108 then #1108 might be small-enough to merge. Just tell me and I'll squash and remove any reference to constants.py.

Tests

N/A

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code.
  • 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.

@SamuelMarks SamuelMarks changed the title Python package layout support and minor other fixes [MaxText] Python package layout support and minor other fixes Mar 26, 2025
@SamuelMarks SamuelMarks marked this pull request as draft March 26, 2025 01:50
@SamuelMarks SamuelMarks changed the title [MaxText] Python package layout support and minor other fixes <DO NOT MERGE> [MaxText] Python package layout support and minor other fixes Mar 26, 2025
@SamuelMarks SamuelMarks changed the title <DO NOT MERGE> [MaxText] Python package layout support and minor other fixes Linting low-hanging fruit across MaxText, MaxText/input_pipeline, MaxText/layers Apr 22, 2025
@SamuelMarks SamuelMarks marked this pull request as ready for review April 22, 2025 15:08
@SamuelMarks
Copy link
Collaborator Author

@shralex The new argument so that inference_metadata can make it all the way into main otherwise it's lost (and that's a bug I assume?)

Copy link
Collaborator

@bvandermoon bvandermoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @SamuelMarks. Generally LGTM, just a couple comments/questions

from MaxText import max_utils
from absl import app

from MaxText import max_utils, prefix_cache
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the location of prefix_cache changing from jetstream.core to MaxText? Also a minor nit: If you are going to inline some of the MaxText imports like max_utils, prefix_cache, it might be good to also inline maxengine and pyconfig

Copy link
Collaborator Author

@SamuelMarks SamuelMarks Apr 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bvandermoon Oh my earlier code-base wide find/replace looks at the file hierarchy as the module hierarchy so MaxText/prefix_cache.py means that import prefix_cache became from MaxText import prefix_cache. I can change this one to jetstream.core. - What about MaxText/inference_microbenchmark.py and MaxText/tests/prefix_cache_test.py? - I assume they stay as is.

EDIT: #1643 asked more broadly

@copybara-service copybara-service bot merged commit 291b912 into AI-Hypercomputer:main Apr 26, 2025
45 of 61 checks passed
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.

3 participants