Skip to content

Pathways: reuse setup_spmd for pathways init #1248

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

samos123
Copy link
Contributor

@samos123 samos123 commented Jun 9, 2025

No description provided.

Comment on lines 51 to 52
pathwaysutils.initialize()
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do a return here to avoid the else and extra nesting below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

jax_backend=FLAGS.jax_backend,
initialization_timeout=FLAGS.initialization_timeout,
)
setup_spmd(
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose setup_spmd isn't the most appropriate name anymore given pathways, but this seems OK for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setup_controller? but happy to stick with setup_spmd for now too. I'm afraid of breaking others by renaming setup functions like these. Not sure if people have custom launch.py functions.

@samos123 samos123 marked this pull request as ready for review June 10, 2025 18:04
@samos123 samos123 requested review from ruomingp and a team as code owners June 10, 2025 18:04
@samos123 samos123 requested a review from markblee June 10, 2025 18:18
@@ -44,6 +44,13 @@ def setup(
# Use a GSPMD-friendly PRNG implementation.
jax.config.update("jax_default_prng_impl", "rbg")

if jax_backend == "proxy":
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the docstring for jax_backend?

Also clarify the expected inputs for the other args in this case? Should they always be None like in the TPU case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the docstring to explicitely call out that the other args will be ignored. They don't have to be None though.

@samos123 samos123 requested review from Ethanlm and markblee June 23, 2025 15:33
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.

3 participants