Skip to content

Commit 5da6235

Browse files
mergennachinSS-JIA
andauthored
Manual cherry-pick to update numpy as well as all dependencies (#7727)
* Install torchao by default (#7470) Summary: Now that torchao is not experimental anymore, we can rely on torchao directly via git submodule. Part of #7460 (cherry picked from commit a861294) * Upgrade numpy version requirement to 2.0 (#7599) Upgrade numpy version requirement to 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 (cherry picked from commit a7b5297) * Update torchtune pin (#7670) (cherry picked from commit a18f6e8) * [Arm] TOSA reference model update * Install release version of torchtune --------- Co-authored-by: Sicheng Stephen Jia <[email protected]>
1 parent 5dee6be commit 5da6235

File tree

9 files changed

+29
-35
lines changed

9 files changed

+29
-35
lines changed

.ci/docker/requirements-ci.txt

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
mpmath==1.3.0
2-
numpy==1.21.3; python_version == '3.10'
3-
numpy==1.23.2; python_version == '3.11'
4-
numpy; python_version >= '3.12'
2+
numpy==2.0.0; python_version >= '3.10'
53
PyYAML==6.0.1
64
ruamel.yaml==0.17.32
75
sympy==1.12
86
timm==0.6.13
97
tomli==2.0.1
108
torchsr==1.0.4
11-
transformers==4.38.0
9+
transformers==4.47.1
1210
zstd==1.5.5.1
13-
pandas==2.0.3; python_version == '3.10'
14-
pandas; python_version >= '3.11'
11+
pandas==2.2.2; python_version >= '3.10'
1512
pytest==7.2.0
1613
pytest-cov==4.1.0
1714
expecttest==0.1.6
@@ -24,7 +21,7 @@ sphinx-gallery==0.14.0
2421
breathe==4.34.0
2522
exhale==0.2.3
2623
docutils==0.16
27-
matplotlib==3.7.2
24+
matplotlib==3.9.4
2825
# PyTorch Theme
2926
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
3027
myst-parser==0.18.1

backends/apple/coreml/scripts/install_requirements.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel
4747

4848
echo "${green}ExecuTorch: Installing coremltools."
4949
pip install "$COREMLTOOLS_DIR_PATH"
50-
# CoreMLTools have started supporting numpy 2.0,
51-
# but ExecuTorch example model test env is still using older transformers,
52-
# so for now we will need to downgrade numpy to 1.x
53-
# TODO: Remove this numpy downgrade once later transformers starts to be used
54-
pip install numpy==1.26.4
50+
5551
STATUS=$?
5652
if [ $STATUS -ne 0 ]; then
5753
echo "${red}ExecuTorch: Failed to install coremltools."

examples/arm/setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) Meta Platforms, Inc. and affiliates.
33
# All rights reserved.
44
#
5-
# Copyright 2023-2024 Arm Limited and/or its affiliates.
5+
# Copyright 2023-2025 Arm Limited and/or its affiliates.
66
#
77
# This source code is licensed under the BSD-style license found in the
88
# LICENSE file in the root directory of this source tree.
@@ -88,7 +88,7 @@ ethos_u_base_rev="24.08"
8888

8989
# tosa reference model
9090
tosa_reference_model_url="https://review.mlplatform.org/tosa/reference_model"
91-
tosa_reference_model_rev="c5570b79e90c3a36ab8c4ddb8ee3fbc2cd3f7c38"
91+
tosa_reference_model_rev="v0.80.1"
9292

9393
# vela
9494
vela_repo_url="https://review.mlplatform.org/ml/ethos-u/ethos-u-vela"

examples/models/llama/install_requirements.sh

-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
# Install sentencepiece for llama tokenizer
1010
pip install snakeviz sentencepiece
1111

12-
# Install torchao.
13-
pip install "$(dirname "$0")/../../../third-party/ao"
14-
1512
# Install lm-eval for Model Evaluation with lm-evalution-harness
1613
# Install tiktoken for tokenizer
1714
pip install lm_eval==0.4.5
1815
pip install tiktoken blobfile
19-
# Restore numpy if >= 2.0
20-
pip install "numpy<2.0"
2116

2217
# Call the install helper for further setup
2318
python examples/models/llama/install_requirement_helper.py

examples/models/llama3_2_vision/install_requirements.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,5 @@
55
# This source code is licensed under the BSD-style license found in the
66
# LICENSE file in the root directory of this source tree.
77

8-
NIGHTLY_VERSION="dev20241112"
9-
108
# Install torchtune nightly for model definitions.
11-
pip install --pre torchtune==0.4.0.${NIGHTLY_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu --no-cache-dir
12-
13-
# Install torchao.
14-
pip install "$(dirname "$0")/../../../third-party/ao"
9+
pip install torchtune==0.5.0 --no-cache-dir

examples/models/phi-3-mini-lora/install_requirements.sh

-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@
88
pip install torchvision
99
pip install torchtune
1010
pip install tiktoken
11-
12-
# Install torchao.
13-
pip install "$(dirname "$0")/../../../third-party/ao"

install_requirements.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def python_is_compatible():
133133
"timm==1.0.7",
134134
"torchaudio==2.6.0" if USE_PYTORCH_NIGHTLY else "torchaudio",
135135
"torchsr==1.0.4",
136-
"transformers==4.46.1",
136+
"transformers==4.47.1",
137137
]
138138

139139
# pip packages needed for development.
@@ -166,6 +166,23 @@ def python_is_compatible():
166166
check=True,
167167
)
168168

169+
LOCAL_REQUIREMENTS = [
170+
"third-party/ao", # We need the latest kernels for fast iteration, so not relying on pypi.
171+
]
172+
173+
# Install packages directly from local copy instead of pypi.
174+
# This is usually not recommended.
175+
subprocess.run(
176+
[
177+
sys.executable,
178+
"-m",
179+
"pip",
180+
"install",
181+
*LOCAL_REQUIREMENTS,
182+
],
183+
check=True,
184+
)
185+
169186
#
170187
# Install executorch pip package. This also makes `flatc` available on the path.
171188
# The --extra-index-url may be necessary if pyproject.toml has a dependency on a

pyproject.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,9 @@ dependencies=[
5555
"flatbuffers",
5656
"hypothesis",
5757
"mpmath==1.3.0",
58-
"numpy==1.21.3; python_version == '3.10'",
59-
"numpy==1.23.2; python_version == '3.11'",
60-
"numpy; python_version >= '3.12'",
58+
"numpy==2.0.0; python_version >= '3.10'",
6159
"packaging",
62-
"pandas==2.0.3; python_version == '3.10'",
63-
"pandas; python_version >= '3.11'",
60+
"pandas==2.2.2; python_version >= '3.10'",
6461
"parameterized",
6562
"pytest",
6663
"pytest-xdist",

third-party/pybind11

Submodule pybind11 updated 189 files

0 commit comments

Comments
 (0)