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

Fix health check after https://github.com/apple/axlearn/pull/848 #852

Merged
merged 1 commit into from
Dec 2, 2024
Merged
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
10 changes: 5 additions & 5 deletions axlearn/cloud/gcp/tpu_health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

The main API is the `setup` function, which is commonly enabled via context manager:
```
with setup(spec, output_dir=...):
with setup(spec):
# Initialize jax distributed.
```
"""
Expand All @@ -33,7 +33,7 @@
from typing import Literal, Optional, Union

import tensorflow as tf
from absl import logging
from absl import flags, logging

from axlearn.cloud.gcp import tpu_health_check_main

Expand Down Expand Up @@ -128,11 +128,11 @@ def _run_health_check_program(


@contextmanager
def setup(check_spec: str, *, output_dir: str):
_pre_init_health_check(check_spec, output_dir=output_dir)
def setup(check_spec: str):
_pre_init_health_check(check_spec, output_dir=flags.FLAGS.trainer_dir)
yield
# Skip global health check if there's an exception.
global_health_check(check_spec, output_dir=output_dir)
global_health_check(check_spec, output_dir=flags.FLAGS.trainer_dir)


def _pre_init_health_check(check_spec: str, *, output_dir: str):
Expand Down
Loading