pytorch / benchmark

TorchBench is a collection of open source benchmarks used to evaluate PyTorch performance.
BSD 3-Clause "New" or "Revised" License
817 stars 259 forks source link

Hardcode the numpy version #2316

Closed xuzhao9 closed 1 week ago

xuzhao9 commented 1 week ago

When there is a big numpy version bump (1.21.2 -> 2.0.0), pip install will somehow automatically upgrade numpy version to 2.0.0 even when the old version (1.21.2) has been installed.

Therefore, we have to hardcode numpy version both globally and for the models whose install will cause numpy to unexpectedly upgrade. Since downstream CI supports Python 3.8 as the lowest supported Python version, we have to pin numpy version to the lowest version used in the downstream CI.

facebook-github-bot commented 1 week ago

@xuzhao9 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 week ago

@xuzhao9 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

xuzhao9 commented 1 week ago

We probably can add a constraint to the numpy version by dynamically adding a numpy_constraint.txt file during the installation.

I think it is reasonable to guarantee that numpy version does not change when the models are being installed.

facebook-github-bot commented 1 week ago

@xuzhao9 merged this pull request in pytorch/benchmark@62e2609a269f8ba394d01b82a71a037a4b240f75.