Skip to content

Commit

Permalink
pin numpy to < 2.0 until tensorboard cuts a release
Browse files Browse the repository at this point in the history
Summary: The latest TB version hasn't incorporated numpy2.0-compatible changes (tensorflow/tensorboard#6869 (comment)), and recently unpinned botorch (D60735276) means Ax CI is now failing. This pins numpy to < 2.0 to prevent issues in CI.

Differential Revision: D60917879
  • Loading branch information
Bernie Beckerman authored and facebook-github-bot committed Aug 7, 2024
1 parent c85a803 commit 272b99d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ax/metrics/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,14 @@ def _get_event_multiplexer_for_trial(
"TensorboardMetric, please install tensorboard."
)
pass
except AttributeError as e:
if (
"`np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead."
in repr(e)
):
logger.warning(
"tensorboard package not compatible with numpy 2.0+. "
"Please install numpy < 2.0."
)
else:
raise e
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
NOTEBOOK_REQUIRES = ["jupyter"]

UNITTEST_MINIMAL_REQUIRES = [
# Replace with `tensorboard >= x.x` once tb cuts a release.
# https://github.com/tensorflow/tensorboard/issues/6869#issuecomment-2273718763
"numpy<2.0",
"tensorboard", # For tensorboard unit tests.
"torchvision", # For torchvision unit tests.
"torchx", # For torchx unit tests.
Expand Down

0 comments on commit 272b99d

Please sign in to comment.