Skip to content
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

Avoid querying metadata query to check if it's GCE if TPU_SKIP_MDS_QUERY is set. #24394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jax/_src/clusters/cloud_tpu_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def is_env_present(cls) -> bool:
if not running_in_cloud_tpu_vm:
logger.debug("Did not detect cloud TPU VM")
return False
if os.environ.get("TPU_SKIP_MDS_QUERY") is not None:
logger.debug("TPU_SKIP_MDS_QUERY is set to True, so it's probably not a GCE TPU cluster.")
return False
metadata_response, metadata_code = get_metadata('agent-worker-number')
if metadata_code == metadata_response_code_success:
logger.debug("Gce Tpu Cluster detected for Jax Distributed System")
Expand Down
Loading