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

Restrict NumPy Version <2.0 #2333

Merged
merged 1 commit into from
Jun 17, 2024
Merged

Restrict NumPy Version <2.0 #2333

merged 1 commit into from
Jun 17, 2024

Conversation

Satrat
Copy link

@Satrat Satrat commented Jun 17, 2024

NumPy 2.0 released on June 16th, it broke some dependencies in SparseML. For the 1.8 release, I think its best we just restrict the version to < 2.0 since the error is in tensorboard rather than our code

Testing

This error was being hit in multiple test suites, restricting the numpy version fixes the problem.

tests/sparseml/core/logger/test_logger.py:40: in <module>
    TensorBoardLogger(),
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sparseml/core/logger/logger.py:505: in __init__
    raise tensorboard_import_error
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sparseml/core/logger/logger.py:42: in <module>
    from torch.utils.tensorboard import SummaryWriter
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/torch/utils/tensorboard/__init__.py:12: in <module>
    from .writer import FileWriter, SummaryWriter  # noqa: F401
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/torch/utils/tensorboard/writer.py:13: in <module>
    from tensorboard.summary.writer.event_file_writer import EventFileWriter
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/summary/__init__.py:22: in <module>
    from tensorboard.summary import v1  # noqa: F401
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/summary/v1.py:23: in <module>
    from tensorboard.plugins.histogram import summary as _histogram_summary
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/plugins/histogram/summary.py:35: in <module>
    from tensorboard.plugins.histogram import summary_v2
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/plugins/histogram/summary_v2.py:35: in <module>
    from tensorboard.util import tensor_util
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/util/tensor_util.py:20: in <module>
    from tensorboard.compat.tensorflow_stub import dtypes, compat, tensor_shape
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/compat/tensorflow_stub/__init__.py:22: in <module>
    from .dtypes import as_dtype  # noqa
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:[32](https://github.com/neuralmagic/sparseml/actions/runs/9549548577/job/26319412607#step:13:33)6: in <module>
    np.bool8: (False, True),
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/numpy/__init__.py:410: in __getattr__
    raise AttributeError("module {!r} has no attribute "
E   AttributeError: module 'numpy' has no attribute 'bool8'

@Satrat Satrat requested review from bfineran and dsikka June 17, 2024 17:07
@bfineran bfineran merged commit 50b6858 into main Jun 17, 2024
18 checks passed
@bfineran bfineran deleted the restrict_numpy branch June 17, 2024 18:37
dhuangnm pushed a commit that referenced this pull request Jun 17, 2024
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