Skip to content

Commit

Permalink
test_ios comments on pybindings (#2324)
Browse files Browse the repository at this point in the history
Summary:

Accoding to shoumikhin, this was a quick way to test the build for pybindings on macos, but pybindings isn't actually needed by the rest of the script.

Add comments to make it clear why these scripts are building the pybindings. Move the pybindings to the bottom so that nothing else can depend on them.

Reviewed By: shoumikhin

Differential Revision: D54695352
  • Loading branch information
dbort authored and facebook-github-bot committed Mar 11, 2024
1 parent 4ef264e commit 446a626
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 11 additions & 8 deletions build/test_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ say "Installing MPS Backend Requirements"

./backends/apple/mps/install_requirements.sh

say "Installing Python Bindings"

EXECUTORCH_BUILD_PYBIND=ON \
BUCK="$(pwd)/$BUCK2" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
CMAKE_BUILD_PARALLEL_LEVEL=9 \
pip install . --no-build-isolation -v

say "Exporting Models"

python3 -m examples.portable.scripts.export --model_name="$MODEL_NAME"
Expand Down Expand Up @@ -120,3 +112,14 @@ xcodebuild test \
-project "$APP_PATH.xcodeproj" \
-scheme MobileNetClassifierTest \
-destination name="$SIMULATOR_NAME"

say "Installing Python Bindings"

# Ensure that the pybindings build works on macOS. TODO(shoumikhin): Make this a
# separate test to clarify that it's not required for the rest of the script.
# Until then, make this the last step so that nothing can depend on it.
EXECUTORCH_BUILD_PYBIND=ON \
BUCK="$(pwd)/$BUCK2" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
CMAKE_BUILD_PARALLEL_LEVEL=9 \
pip install . --no-build-isolation -v
19 changes: 11 additions & 8 deletions build/test_ios_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ say "Installing MPS Backend Requirements"

./backends/apple/mps/install_requirements.sh

say "Installing Python Bindings"

EXECUTORCH_BUILD_PYBIND=ON \
BUCK="$(which buck2)" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
CMAKE_BUILD_PARALLEL_LEVEL=9 \
pip install . --no-build-isolation -v

say "Exporting Models"

python3 -m examples.portable.scripts.export --model_name="$MODEL_NAME" --segment_alignment=0x4000
Expand Down Expand Up @@ -77,3 +69,14 @@ xcodebuild test \
-project "$APP_PATH.xcodeproj" \
-scheme MobileNetClassifierTest \
-destination name="$SIMULATOR_NAME"

say "Installing Python Bindings"

# Ensure that the pybindings build works on macOS. TODO(shoumikhin): Make this a
# separate test to clarify that it's not required for the rest of the script.
# Until then, make this the last step so that nothing can depend on it.
EXECUTORCH_BUILD_PYBIND=ON \
BUCK="$(which buck2)" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
CMAKE_BUILD_PARALLEL_LEVEL=9 \
pip install . --no-build-isolation -v

0 comments on commit 446a626

Please sign in to comment.