Skip to content

Manual cherry-pick to update numpy as well as all dependencies #7727

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

Merged
merged 6 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 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 All @@ -24,7 +21,7 @@ sphinx-gallery==0.14.0
breathe==4.34.0
exhale==0.2.3
docutils==0.16
matplotlib==3.7.2
matplotlib==3.9.4
# PyTorch Theme
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
myst-parser==0.18.1
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
4 changes: 2 additions & 2 deletions examples/arm/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# Copyright 2023-2024 Arm Limited and/or its affiliates.
# Copyright 2023-2025 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -88,7 +88,7 @@ ethos_u_base_rev="24.08"

# tosa reference model
tosa_reference_model_url="https://review.mlplatform.org/tosa/reference_model"
tosa_reference_model_rev="c5570b79e90c3a36ab8c4ddb8ee3fbc2cd3f7c38"
tosa_reference_model_rev="v0.80.1"

# vela
vela_repo_url="https://review.mlplatform.org/ml/ethos-u/ethos-u-vela"
Expand Down
5 changes: 0 additions & 5 deletions examples/models/llama/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
# Install sentencepiece for llama tokenizer
pip install snakeviz sentencepiece

# Install torchao.
pip install "$(dirname "$0")/../../../third-party/ao"

# Install lm-eval for Model Evaluation with lm-evalution-harness
# 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
7 changes: 1 addition & 6 deletions examples/models/llama3_2_vision/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

NIGHTLY_VERSION="dev20241112"

# Install torchtune nightly for model definitions.
pip install --pre torchtune==0.4.0.${NIGHTLY_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu --no-cache-dir

# Install torchao.
pip install "$(dirname "$0")/../../../third-party/ao"
pip install torchtune==0.5.0 --no-cache-dir
3 changes: 0 additions & 3 deletions examples/models/phi-3-mini-lora/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@
pip install torchvision
pip install torchtune
pip install tiktoken

# Install torchao.
pip install "$(dirname "$0")/../../../third-party/ao"
19 changes: 18 additions & 1 deletion install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def python_is_compatible():
"timm==1.0.7",
"torchaudio==2.6.0" 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 Expand Up @@ -166,6 +166,23 @@ def python_is_compatible():
check=True,
)

LOCAL_REQUIREMENTS = [
"third-party/ao", # We need the latest kernels for fast iteration, so not relying on pypi.
]

# Install packages directly from local copy instead of pypi.
# This is usually not recommended.
subprocess.run(
[
sys.executable,
"-m",
"pip",
"install",
*LOCAL_REQUIREMENTS,
],
check=True,
)

#
# Install executorch pip package. This also makes `flatc` available on the path.
# The --extra-index-url may be necessary if pyproject.toml has a dependency on a
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
2 changes: 1 addition & 1 deletion third-party/pybind11
Submodule pybind11 updated 189 files
Loading