Skip to content

Commit 749f3a5

Browse files
committed
Update on "Convert args to LlmConfig"
[ghstack-poisoned]
2 parents aed7c50 + 42e6148 commit 749f3a5

File tree

481 files changed

+14206
-5925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+14206
-5925
lines changed

.ci/scripts/build-qnn-sdk.sh

100644100755
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ set -o xtrace
1111

1212
build_qnn_backend() {
1313
echo "Start building qnn backend."
14-
export ANDROID_NDK_ROOT=/opt/ndk
15-
export QNN_SDK_ROOT=/tmp/qnn/2.28.0.241029
14+
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/ndk}
15+
export QNN_SDK_ROOT=${QNN_SDK_ROOT:-/tmp/qnn/2.28.0.241029}
1616
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
1717

18-
# Workaround to avoid issues around missing flatccrt library (depending on the
19-
# number of jobs used), see issue #7300:
20-
# Build twice (second time with `--no_clean`) to make sure libflatccrt.a is
21-
# available.
22-
# TODO: Remove this workaround once the underlying issue is fixed.
23-
bash backends/qualcomm/scripts/build.sh --skip_aarch64 --job_number 2 --release || \
24-
bash backends/qualcomm/scripts/build.sh --skip_aarch64 --job_number 2 --release --no_clean
18+
parallelism=$(( $(nproc) - 1 ))
19+
bash backends/qualcomm/scripts/build.sh --skip_aarch64 --job_number ${parallelism} --release
2520
}
2621

2722
set_up_aot() {

.ci/scripts/build_llama_android.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ install_executorch_and_backend_lib() {
2222
ANDROID_NDK=/opt/ndk
2323
BUCK2=buck2
2424
ANDROID_ABI=arm64-v8a
25-
cmake -DBUCK2="${BUCK2}" \
25+
cmake --preset llm \
26+
-DBUCK2="${BUCK2}" \
2627
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
2728
-DANDROID_ABI="${ANDROID_ABI}" \
2829
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
2930
-DCMAKE_BUILD_TYPE=Release \
30-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
31-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
32-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
33-
-DEXECUTORCH_BUILD_XNNPACK=ON \
34-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
35-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
36-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
3731
-DXNNPACK_ENABLE_ARM_BF16=OFF \
3832
-Bcmake-android-out .
3933

@@ -51,11 +45,7 @@ build_llama_runner() {
5145
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK"/build/cmake/android.toolchain.cmake \
5246
-DANDROID_ABI="${ANDROID_ABI}" \
5347
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
54-
-DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=python \
55-
-DEXECUTORCH_BUILD_XNNPACK=ON \
56-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
57-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
58-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
48+
-DCMAKE_BUILD_TYPE=Release \
5949
-Bcmake-android-out/examples/models/llama examples/models/llama
6050

6151
cmake --build cmake-android-out/examples/models/llama -j4 --config Release

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,11 @@ which "${PYTHON_EXECUTABLE}"
152152
cmake_install_executorch_libraries() {
153153
echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a"
154154
rm -rf cmake-out
155-
retry cmake \
155+
retry cmake --preset llm \
156156
-DCMAKE_INSTALL_PREFIX=cmake-out \
157157
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
158-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
159-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
160-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
161-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
162-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
163-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
164-
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
165-
-DEXECUTORCH_BUILD_MPS="$MPS" \
166-
-DEXECUTORCH_BUILD_COREML="$COREML" \
167158
-DEXECUTORCH_BUILD_QNN="$QNN" \
168159
-DQNN_SDK_ROOT="$QNN_SDK_ROOT" \
169-
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
170160
-Bcmake-out .
171161
cmake --build cmake-out -j9 --target install --config "$CMAKE_BUILD_TYPE"
172162
}
@@ -181,10 +171,6 @@ cmake_build_llama_runner() {
181171
retry cmake \
182172
-DCMAKE_INSTALL_PREFIX=cmake-out \
183173
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
184-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
185-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
186-
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
187-
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
188174
-Bcmake-out/${dir} \
189175
${dir}
190176
cmake --build cmake-out/${dir} -j9 --config "$CMAKE_BUILD_TYPE"

.ci/scripts/tests/test_gather_benchmark_configs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def test_skip_disabled_configs(self):
5353
"mv3": [
5454
self.gather_benchmark_configs.DisabledConfig(
5555
config_name="disabled_config1",
56-
github_issue="https://github.com/org/repo/issues/123",
56+
github_issue="https://github.com/org/repo/issues/123", # @lint-ignore
5757
),
5858
self.gather_benchmark_configs.DisabledConfig(
5959
config_name="disabled_config2",
60-
github_issue="https://github.com/org/repo/issues/124",
60+
github_issue="https://github.com/org/repo/issues/124", # @lint-ignore
6161
),
6262
]
6363
},
@@ -84,7 +84,9 @@ def test_skip_disabled_configs(self):
8484
self.assertIn("enabled_config2", result)
8585

8686
def test_disabled_configs_have_github_links(self):
87-
github_issue_regex = re.compile(r"https://github\.com/.+/.+/issues/\d+")
87+
github_issue_regex = re.compile(
88+
r"https://github\.com/.+/.+/issues/\d+" # @lint-ignore
89+
)
8890

8991
for (
9092
model_name,

.ci/scripts/unittest-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ if [[ "$BUILD_TOOL" == "cmake" ]]; then
2020
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
2121
source .ci/scripts/setup-vulkan-linux-deps.sh
2222

23+
# We need the runner to test the built library.
2324
PYTHON_EXECUTABLE=python \
24-
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
25+
CMAKE_ARGS="-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON -DEXECUTORCH_BUILD_TESTS=ON" \
2526
.ci/scripts/setup-linux.sh "$@"
2627

2728
.ci/scripts/unittest-linux-cmake.sh

.ci/scripts/unittest-macos.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ export PATH="${TMP_DIR}:$PATH"
2020
trap 'rm -rfv ${TMP_DIR}' EXIT
2121

2222
# Setup MacOS dependencies as there is no Docker support on MacOS atm
23+
# We need the runner to test the built library.
2324
PYTHON_EXECUTABLE=python \
24-
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
25+
CMAKE_ARGS="-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON -DEXECUTORCH_BUILD_TESTS=ON" \
2526
${CONDA_RUN} --no-capture-output \
2627
.ci/scripts/setup-macos.sh "$@"
2728

.ci/scripts/wheel/envvar_base.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@
1111
# Ensure that CMAKE_ARGS is defined before referencing it. Defaults to empty
1212
# if not defined.
1313
export CMAKE_ARGS="${CMAKE_ARGS:-}"
14-
15-
# Link the XNNPACK backend into the pybindings runtime so that users can execute
16-
# ExecuTorch programs that delegate to it.
17-
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON"

.ci/scripts/wheel/envvar_macos.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@
99
# any variables so that subprocesses will see them.
1010

1111
source "${GITHUB_WORKSPACE}/${REPOSITORY}/.ci/scripts/wheel/envvar_base.sh"
12-
13-
# When building for macOS, link additional backends into the pybindings runtime.
14-
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_COREML=ON"
15-
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_MPS=ON"

.github/scripts/label_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def get_last_page_num_from_header(header: Any) -> int:
5151
# rel="next", <https://api.github.com/repositories/65600975/labels?per_page=100&page=3>; rel="last"
5252
link_info = header["link"]
5353
# Docs does not specify that it should be present for projects with just few labels
54-
# And https://github.com/malfet/deleteme/actions/runs/7334565243/job/19971396887 it's not the case
5554
if link_info is None:
5655
return 1
5756
prefix = "&page="

.github/scripts/test_extract_benchmark_results.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def get_mock_happy_flow_content(app_type: str = "IOS_APP"):
2929
"name": "Syslog",
3030
"type": "DEVICE_LOG",
3131
"extension": "syslog",
32-
"url": "https://job_arn_1_device_log",
33-
"s3_url": "https://job_arn_1/test-workflow1/1/syslog.syslog",
32+
"url": "https://job_arn_1_device_log", # @lint-ignore
33+
"s3_url": "https://job_arn_1/test-workflow1/1/syslog.syslog", # @lint-ignore
3434
"app_type": app_type,
3535
"job_name": "job_arn_1_name",
3636
"os": "14",
@@ -55,8 +55,8 @@ def get_mock_happy_flow_content(app_type: str = "IOS_APP"):
5555
"name": "Customer Artifacts",
5656
"type": "CUSTOMER_ARTIFACT",
5757
"extension": "zip",
58-
"url": "https://job_arn_1_customer_artifact",
59-
"s3_url": "https://job_arn_1_customer_artifact1",
58+
"url": "https://job_arn_1_customer_artifact", # @lint-ignore
59+
"s3_url": "https://job_arn_1_customer_artifact1", # @lint-ignore
6060
"app_type": app_type,
6161
"job_name": "job_arn_1_device_name",
6262
"os": "14",
@@ -68,8 +68,8 @@ def get_mock_happy_flow_content(app_type: str = "IOS_APP"):
6868
"name": "Syslog",
6969
"type": "DEVICE_LOG",
7070
"extension": "syslog",
71-
"url": "https://job_arn_1_device_log",
72-
"s3_url": "https://job_arn_1/test-workflow1/1/syslog.syslog",
71+
"url": "https://job_arn_1_device_log", # @lint-ignore
72+
"s3_url": "https://job_arn_1/test-workflow1/1/syslog.syslog", # @lint-ignore
7373
"app_type": app_type,
7474
"job_name": "job_arn_2_name",
7575
"os": "14",
@@ -94,8 +94,8 @@ def get_mock_happy_flow_content(app_type: str = "IOS_APP"):
9494
"name": "Customer Artifacts",
9595
"type": "CUSTOMER_ARTIFACT",
9696
"extension": "zip",
97-
"url": "https://job_arn_1_customer_artifact",
98-
"s3_url": "https://job_arn_1_customer_artifact1",
97+
"url": "https://job_arn_1_customer_artifact", # @lint-ignore
98+
"s3_url": "https://job_arn_1_customer_artifact1", # @lint-ignore
9999
"app_type": app_type,
100100
"job_name": "job_arn_2_name",
101101
"os": "14",

.github/scripts/trymerge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ def check_for_sev(org: str, project: str, skip_mandatory_checks: bool) -> None:
19641964
response = cast(
19651965
Dict[str, Any],
19661966
gh_fetch_json_list(
1967-
"https://api.github.com/search/issues",
1967+
"https://api.github.com/search/issues", # @lint-ignore
19681968
params={"q": f'repo:{org}/{project} is:open is:issue label:"ci: sev"'},
19691969
),
19701970
)

.github/workflows/_link_check.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
timeout: 120
1919
script: |
2020
./scripts/lint_urls.sh $(
21-
{ [ "${{ github.event_name }}" = "pull_request" ] \
22-
&& git diff --name-only "${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}"; } \
23-
|| \
24-
{ [ "${{ github.event_name }}" = "push" ] \
25-
&& git diff --name-only "${{ github.event.before }}...${{ github.sha }}"; }
21+
if [ "${{ github.event_name }}" = "pull_request" ]; then
22+
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
23+
else
24+
echo "${{ github.event.before }}" "${{ github.sha }}"
25+
fi
2626
) || {
2727
echo
2828
echo "URL lint failed."
@@ -43,11 +43,11 @@ jobs:
4343
timeout: 60
4444
script: |
4545
./scripts/lint_xrefs.sh $(
46-
{ [ "${{ github.event_name }}" = "pull_request" ] \
47-
&& git diff --name-only "${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}"; } \
48-
|| \
49-
{ [ "${{ github.event_name }}" = "push" ] \
50-
&& git diff --name-only "${{ github.event.before }}...${{ github.sha }}"; }
46+
if [ "${{ github.event_name }}" = "pull_request" ]; then
47+
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
48+
else
49+
echo "${{ github.event.before }}" "${{ github.sha }}"
50+
fi
5151
) || {
5252
echo
5353
echo "Xref lint failed."

.github/workflows/android-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ jobs:
367367
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
368368
369369
mkdir -p aar-out
370-
PYTHON_EXECUTABLE=python ANDROID_ABIS="arm64-v8a" BUILD_AAR_DIR=aar-out EXECUTORCH_BUILD_QNN=ON QNN_SDK_ROOT=/tmp/qnn/2.28.0.241029 bash scripts/build_android_library.sh
370+
PYTHON_EXECUTABLE=python ANDROID_ABIS="arm64-v8a" BUILD_AAR_DIR=aar-out EXECUTORCH_BUILD_QNN=ON QNN_SDK_ROOT=/tmp/qnn/2.28.0.241029 EXECUTORCH_ANDROID_PROFILING=ON bash scripts/build_android_library.sh
371371
mkdir -p extension/benchmark/android/benchmark/app/libs
372372
cp aar-out/executorch.aar extension/benchmark/android/benchmark/app/libs
373373
pushd extension/benchmark/android/benchmark

.github/workflows/build-presets.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- main
88
- release/*
9+
paths:
10+
- .github/workflows/build-presets.yml
911
workflow_dispatch:
1012

1113
concurrency:
@@ -16,15 +18,51 @@ jobs:
1618
apple:
1719
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
1820
strategy:
21+
fail-fast: false
1922
matrix:
20-
preset: [macos-arm64]
23+
preset: [macos-arm64, pybind, llm]
2124
with:
2225
job-name: build
26+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
2327
runner: macos-latest-xlarge
2428
python-version: 3.12
2529
submodules: recursive
30+
timeout: 90
2631
script: |
2732
set -eux
2833
${CONDA_RUN} ./install_requirements.sh > /dev/null
2934
${CONDA_RUN} cmake --preset ${{ matrix.preset }}
30-
${CONDA_RUN} cmake --build cmake-out --parallel
35+
${CONDA_RUN} cmake --build cmake-out -j$(( $(sysctl -n hw.ncpu) - 1 ))
36+
37+
linux:
38+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
preset: [pybind, llm]
43+
runner: [linux.2xlarge, linux.arm64.2xlarge]
44+
docker-image: [executorch-ubuntu-22.04-clang12, executorch-ubuntu-22.04-gcc11-aarch64]
45+
# Excluding specific runner + docker image combinations that don't make sense:
46+
# - Excluding the ARM64 gcc image on the x86 runner (linux.2xlarge)
47+
# - Excluding the x86 clang image on the ARM64 runner (linux.arm64.2xlarge)
48+
exclude:
49+
- runner: linux.2xlarge
50+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
51+
- runner: linux.arm64.2xlarge
52+
docker-image: executorch-ubuntu-22.04-clang12
53+
with:
54+
job-name: build
55+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
56+
runner: ${{ matrix.runner }}
57+
docker-image: ${{ matrix.docker-image }}
58+
submodules: recursive
59+
timeout: 90
60+
script: |
61+
set -eux
62+
# The generic Linux job chooses to use base env, not the one setup by the image
63+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
64+
conda activate "${CONDA_ENV}"
65+
66+
./install_requirements.sh > /dev/null
67+
cmake --preset ${{ matrix.preset }}
68+
cmake --build cmake-out -j$(( $(nproc) - 1 ))

.github/workflows/pull.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -343,34 +343,6 @@ jobs:
343343
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
344344
PYTHON_EXECUTABLE=python bash examples/xnnpack/quantization/test_quantize.sh "${BUILD_TOOL}" mv2
345345
346-
test-pybind-build-linux:
347-
name: test-pybind-build-linux
348-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
349-
permissions:
350-
id-token: write
351-
contents: read
352-
strategy:
353-
fail-fast: false
354-
with:
355-
runner: linux.2xlarge
356-
docker-image: executorch-ubuntu-22.04-clang12
357-
submodules: 'recursive'
358-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
359-
timeout: 90
360-
script: |
361-
# The generic Linux job chooses to use base env, not the one setup by the image
362-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
363-
conda activate "${CONDA_ENV}"
364-
365-
# build module for executorch.extension.pybindings.portable_lib
366-
BUILD_TOOL="cmake"
367-
PYTHON_EXECUTABLE=python \
368-
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
369-
bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
370-
371-
# see if we can import the module successfully
372-
python -c "from executorch.extension.pybindings import portable_lib; print('success!')"
373-
374346
test-binary-size-linux-gcc:
375347
name: test-binary-size-linux-gcc
376348
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main

0 commit comments

Comments
 (0)