Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion .ci/docker/ci_commit_pins/pytorch.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
01f1cc44cbbfdf6307aa01b803a4ee22f9ade946
64247892a0ca8ed045ad0b530eb87c3dd66590ea
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's the other one? https://hud2.pytorch.org/pytorch/pytorch/commit/64247892a0ca8ed045ad0b530eb87c3dd66590ea

0d0058d90de410cbc998089eb5e475776d2ad55d

4 changes: 4 additions & 0 deletions .ci/scripts/test_ios_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ say "Installing CoreML Backend Requirements"

./backends/apple/coreml/scripts/install_requirements.sh

say "Installing MPS Backend Requirements"

./backends/apple/mps/install_requirements.sh

say "Exporting Models"

python3 -m examples.portable.scripts.export --model_name="$MODEL_NAME" --segment_alignment=0x4000
Expand Down
42 changes: 23 additions & 19 deletions .ci/scripts/test_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,14 @@ prepare_artifacts_upload() {
}

build_cmake_executor_runner() {
local backend_string_select="${1:-}"
echo "Building executor_runner"
rm -rf ${CMAKE_OUTPUT_DIR}
mkdir ${CMAKE_OUTPUT_DIR}
if [[ "$backend_string_select" == "XNNPACK" ]]; then
echo "Backend $backend_string_select selected"
(cd ${CMAKE_OUTPUT_DIR} \
&& cmake -DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)
cmake --build ${CMAKE_OUTPUT_DIR} -j4
else
cmake -DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-B${CMAKE_OUTPUT_DIR} .
cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
fi
cmake -DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-B${CMAKE_OUTPUT_DIR} .

cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
}

run_portable_executor_runner() {
Expand Down Expand Up @@ -121,6 +111,19 @@ test_model() {
run_portable_executor_runner
}

build_cmake_xnn_executor_runner() {
echo "Building xnn_executor_runner"

(rm -rf ${CMAKE_OUTPUT_DIR} \
&& mkdir ${CMAKE_OUTPUT_DIR} \
&& cd ${CMAKE_OUTPUT_DIR} \
&& retry cmake -DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)

cmake --build ${CMAKE_OUTPUT_DIR} -j4
}

test_model_with_xnnpack() {
WITH_QUANTIZATION=$1
WITH_DELEGATION=$2
Expand All @@ -145,11 +148,12 @@ test_model_with_xnnpack() {

# Run test model
if [[ "${BUILD_TOOL}" == "buck2" ]]; then
# TODO eventually buck should also use consolidated executor runners
buck2 run //examples/xnnpack:xnn_executor_runner -- --model_path "${OUTPUT_MODEL_PATH}"
elif [[ "${BUILD_TOOL}" == "cmake" ]]; then
build_cmake_executor_runner "XNNPACK"
./${CMAKE_OUTPUT_DIR}/executor_runner --model_path "${OUTPUT_MODEL_PATH}"
if [[ ! -f ${CMAKE_OUTPUT_DIR}/backends/xnnpack/xnn_executor_runner ]]; then
build_cmake_xnn_executor_runner
fi
./${CMAKE_OUTPUT_DIR}/backends/xnnpack/xnn_executor_runner --model_path "${OUTPUT_MODEL_PATH}"
else
echo "Invalid build tool ${BUILD_TOOL}. Only buck2 and cmake are supported atm"
exit 1
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/label_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

LABEL_ERR_MSG_TITLE = "This PR needs a `release notes:` label"
LABEL_ERR_MSG = f"""# {LABEL_ERR_MSG_TITLE}
If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with `release notes:`. This helps us keep track and include your important work in the next release notes.
If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with `release notes:`.

If not, please add the `release notes: none` label.

To add a label, you can comment to pytorchbot, for example
`@pytorchbot label "release notes: none"`
Expand Down
10 changes: 9 additions & 1 deletion .github/scripts/trymerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@
patterns_to_regex,
retries_decorator,
)
from label_utils import gh_add_labels, gh_remove_label
from label_utils import (
gh_add_labels,
gh_remove_label,
has_required_labels,
LABEL_ERR_MSG,
)
from trymerge_explainer import get_revert_message, TryMergeExplainer

# labels
Expand Down Expand Up @@ -2111,6 +2116,9 @@ def merge(
# Check for approvals
find_matching_merge_rule(pr, repo, skip_mandatory_checks=True)

if not has_required_labels(pr):
raise RuntimeError(LABEL_ERR_MSG.lstrip(" #"))

if ignore_current:
checks = pr.get_checkrun_conclusions()
_, failing, _ = categorize_checks(
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/apple-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ jobs:
backends/apple/coreml/scripts/install_requirements.sh
fi

if [[ ${{ matrix.config }} == *"mps"* ]]; then
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/mps/install_requirements.sh
fi

# Install requirements for export_llama
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash examples/models/llama/install_requirements.sh

Expand Down Expand Up @@ -374,6 +379,10 @@ jobs:
# Install CoreML Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/coreml/scripts/install_requirements.sh

# Install MPS Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/mps/install_requirements.sh
echo "::endgroup::"

echo "::group::Build ExecuTorch iOS frameworks"
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
"backend_xnnpack"
"kernels_custom"
"kernels_optimized"
"kernels_portable"
"kernels_quantized"
"threadpool"
)
Expand All @@ -168,6 +169,10 @@ jobs:
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/coreml/scripts/install_requirements.sh

# Install MPS Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/mps/install_requirements.sh

# Build iOS Frameworks
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh

Expand Down Expand Up @@ -302,6 +307,10 @@ jobs:
# Install CoreML Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/coreml/scripts/install_requirements.sh

# Install MPS Backend Requirements
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
backends/apple/mps/install_requirements.sh
echo "::endgroup::"

echo "::group::Build ExecuTorch iOS frameworks"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
PR_NUM: ${{ github.event.number || github.event.inputs.pr_number }}
run: |
set -ex
python3 .github/scripts/check_labels.py "${PR_NUM}"
python3 .github/scripts/check_labels.py --exit-non-zero "${PR_NUM}"
10 changes: 8 additions & 2 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ jobs:
# Install requirements
${CONDA_RUN} sh install_requirements.sh
${CONDA_RUN} sh backends/apple/coreml/scripts/install_requirements.sh
${CONDA_RUN} python install_executorch.py
${CONDA_RUN} python install_executorch.py --pybind coreml
${CONDA_RUN} sh examples/models/llama/install_requirements.sh

# Test ANE llama
Expand Down Expand Up @@ -414,7 +414,11 @@ jobs:
# Setup executorch
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool cmake

if [[ "${MODE}" == "coreml" ]]; then
if [[ "${MODE}" == "mps" ]]; then
# Install mps delegate
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/mps/install_requirements.sh
echo "Finishing installing mps."
elif [[ "${MODE}" == "coreml" ]]; then
# Install coreml delegate
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
echo "Finishing installing coreml."
Expand Down Expand Up @@ -500,6 +504,8 @@ jobs:
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
echo "Finishing installing coreml."
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/mps/install_requirements.sh
echo "Finishing installing mps."

# Build and test coreml model
MODELS=(mv3 ic4 resnet50 edsr mobilebert w2l)
Expand Down
Loading
Loading