Skip to content
Merged
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
6 changes: 4 additions & 2 deletions backends/apple/coreml/scripts/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SCRIPT_DIR_PATH="$(
)"

# TODO(jathu): remove the need to fetch coremltools to build deps for coreml_executor_runner.
# Keep this version in sync with: pyproject.toml
# Keep this version in sync with setup.py, and re-check the pip install below when bumping it.
COREMLTOOLS_VERSION="9.0"

# Safe colors (no TERM noise in CI)
Expand Down Expand Up @@ -75,12 +75,14 @@ if [[ "$(uname)" == "Darwin" ]]; then
fi

echo "${green}ExecuTorch: Installing coremltools dependencies.${reset}"
# Not coremltools' reqs/build.pip, whose old numpy pin would downgrade the caller's numpy.
# Its CMake build only needs numpy (for the include path) and setuptools (to build kmeans1d).
SDKROOT="$HOST_SDKROOT" \
CC="$HOST_CC" \
CXX="$HOST_CXX" \
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
python -m pip install -r "$COREMLTOOLS_DIR_PATH/reqs/build.pip"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any othr places using build.pip if that's out of date now? if not maybe we need to remove build.pip if that's a et controled file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.pip is not an ExecuTorch file. It comes from Apple's coremltools repo, which this script clones at the 9.0 tag. After this change nothing in ExecuTorch uses it, so there is nothing for us to remove.

python -m pip install numpy setuptools
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "${red}ExecuTorch: Failed to install coremltools dependencies.${reset}"
Expand Down
Loading