Skip to content

Commit

Permalink
Upgrade numpy version requirement to
Browse files Browse the repository at this point in the history
Summary:

1.21 is too old now. For 3.10 or above, we should be able to use 2.0.0

We are already on CoreMLTools 8.1, which is https://github.com/apple/coremltools/blob/8.1/reqs/build.pip

We had to upgrade to the latest transformers as well
  • Loading branch information
mergennachin committed Jan 10, 2025
1 parent 25d8f15 commit 0ec8d85
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
9 changes: 3 additions & 6 deletions .ci/docker/requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
mpmath==1.3.0
numpy==1.21.3; python_version == '3.10'
numpy==1.23.2; python_version == '3.11'
numpy; python_version >= '3.12'
numpy==2.0.0; python_version >= '3.10'
PyYAML==6.0.1
ruamel.yaml==0.17.32
sympy==1.12
timm==0.6.13
tomli==2.0.1
torchsr==1.0.4
transformers==4.38.0
transformers==4.47.1
zstd==1.5.5.1
pandas==2.0.3; python_version == '3.10'
pandas; python_version >= '3.11'
pandas==2.2.2; python_version >= '3.10'
pytest==7.2.0
pytest-cov==4.1.0
expecttest==0.1.6
Expand Down
6 changes: 1 addition & 5 deletions backends/apple/coreml/scripts/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel

echo "${green}ExecuTorch: Installing coremltools."
pip install "$COREMLTOOLS_DIR_PATH"
# CoreMLTools have started supporting numpy 2.0,
# but ExecuTorch example model test env is still using older transformers,
# so for now we will need to downgrade numpy to 1.x
# TODO: Remove this numpy downgrade once later transformers starts to be used
pip install numpy==1.26.4

STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "${red}ExecuTorch: Failed to install coremltools."
Expand Down
2 changes: 0 additions & 2 deletions examples/models/llama/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ pip install snakeviz sentencepiece
# Install tiktoken for tokenizer
pip install lm_eval==0.4.5
pip install tiktoken blobfile
# Restore numpy if >= 2.0
pip install "numpy<2.0"

# Call the install helper for further setup
python examples/models/llama/install_requirement_helper.py
2 changes: 1 addition & 1 deletion install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def python_is_compatible():
"timm==1.0.7",
f"torchaudio==2.6.0.{NIGHTLY_VERSION}" if USE_PYTORCH_NIGHTLY else "torchaudio",
"torchsr==1.0.4",
"transformers==4.46.1",
"transformers==4.47.1",
]

# pip packages needed for development.
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ dependencies=[
"flatbuffers",
"hypothesis",
"mpmath==1.3.0",
"numpy==1.21.3; python_version == '3.10'",
"numpy==1.23.2; python_version == '3.11'",
"numpy; python_version >= '3.12'",
"numpy==2.0.0; python_version >= '3.10'",
"packaging",
"pandas==2.0.3; python_version == '3.10'",
"pandas; python_version >= '3.11'",
"pandas==2.2.2; python_version >= '3.10'",
"parameterized",
"pytest",
"pytest-xdist",
Expand Down

0 comments on commit 0ec8d85

Please sign in to comment.