Skip to content

Commit 26268d0

Browse files
Merge branch 'main' into tosa_dialect_conv2d
2 parents bd01471 + fb87fa6 commit 26268d0

File tree

137 files changed

+2603
-459
lines changed

Some content is hidden

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

137 files changed

+2603
-459
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ set_up_aot() {
3838
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM=ON \
3939
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM_RUNNER=ON \
4040
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
41+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
4142
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
4243
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
4344
-DPYTHON_EXECUTABLE=python3

.ci/scripts/test_backend.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ fi
5959
if [[ "$FLOW" == *arm* ]]; then
6060
# Setup ARM deps.
6161
.ci/scripts/setup-arm-baremetal-tools.sh
62+
source examples/arm/ethos-u-scratch/setup_path.sh
6263

6364
if [[ "$FLOW" == *ethos_u* ]]; then
6465
# Prepare a test runner binary that can run on the Corstone-3x0 FVPs

.ci/scripts/test_llama_torchao_lowbit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cmake -DPYTHON_EXECUTABLE=python \
3131
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
3232
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3333
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
34+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
3435
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3536
-DEXECUTORCH_BUILD_XNNPACK=OFF \
3637
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \

.ci/scripts/test_model.sh

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,33 @@ prepare_artifacts_upload() {
4848
fi
4949
}
5050

51+
5152
build_cmake_executor_runner() {
5253
local backend_string_select="${1:-}"
5354
echo "Building executor_runner"
5455
rm -rf ${CMAKE_OUTPUT_DIR}
5556
mkdir ${CMAKE_OUTPUT_DIR}
57+
# Common options:
58+
COMMON="-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE"
5659
if [[ "$backend_string_select" == "XNNPACK" ]]; then
5760
echo "Backend $backend_string_select selected"
58-
(cd ${CMAKE_OUTPUT_DIR} \
59-
&& cmake -DCMAKE_BUILD_TYPE=Release \
61+
cmake -DCMAKE_BUILD_TYPE=Release \
6062
-DEXECUTORCH_BUILD_XNNPACK=ON \
61-
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)
63+
${COMMON} \
64+
-B${CMAKE_OUTPUT_DIR} .
65+
cmake --build ${CMAKE_OUTPUT_DIR} -j4
66+
elif [[ "$backend_string_select" == "CUDA" ]]; then
67+
echo "Backend $backend_string_select selected"
68+
cmake -DCMAKE_BUILD_TYPE=Release \
69+
-DEXECUTORCH_BUILD_CUDA=ON \
70+
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
71+
${COMMON} \
72+
-B${CMAKE_OUTPUT_DIR} .
6273
cmake --build ${CMAKE_OUTPUT_DIR} -j4
6374
else
6475
cmake -DCMAKE_BUILD_TYPE=Debug \
6576
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
66-
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
77+
${COMMON} \
6778
-B${CMAKE_OUTPUT_DIR} .
6879
cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
6980
fi
@@ -320,6 +331,13 @@ test_model_with_mediatek() {
320331
EXPORTED_MODEL=$(find "./${EXPORT_SCRIPT}" -type f -name "*.pte" -print -quit)
321332
}
322333

334+
test_model_with_cuda() {
335+
# Export a basic .pte and .ptd, then run the model.
336+
"${PYTHON_EXECUTABLE}" -m examples.cuda.scripts.export --model_name="${MODEL_NAME}" --output_dir "./"
337+
build_cmake_executor_runner "CUDA"
338+
./${CMAKE_OUTPUT_DIR}/executor_runner --model_path "./${MODEL_NAME}.pte" --data_path "./aoti_cuda_blob.ptd"
339+
}
340+
323341

324342
if [[ "${BACKEND}" == "portable" ]]; then
325343
echo "Testing ${MODEL_NAME} with portable kernels..."
@@ -372,6 +390,12 @@ elif [[ "${BACKEND}" == "mediatek" ]]; then
372390
if [[ $? -eq 0 ]]; then
373391
prepare_artifacts_upload
374392
fi
393+
elif [[ "${BACKEND}" == "cuda" ]]; then
394+
echo "Testing ${MODEL_NAME} with cuda..."
395+
test_model_with_cuda
396+
if [[ $? -eq 0 ]]; then
397+
prepare_artifacts_upload
398+
fi
375399
else
376400
set +e
377401
if [[ "${BACKEND}" == *"quantization"* ]]; then

.ci/scripts/test_torchao_huggingface_checkpoints.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ if [[ "$TEST_WITH_RUNNER" -eq 1 ]]; then
129129
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
130130
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
131131
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
132+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
132133
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
133134
-DEXECUTORCH_BUILD_XNNPACK=ON \
134135
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \

.ci/scripts/test_yolo12.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ cmake_install_executorch_libraries() {
119119
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
120120
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
121121
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
122+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
123+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
122124
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
123125
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
124126
-B"${build_dir}"
@@ -131,6 +133,8 @@ cmake_install_executorch_libraries() {
131133
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
132134
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
133135
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
136+
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
137+
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
134138
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
135139
-DEXECUTORCH_ENABLE_LOGGING=ON \
136140
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \

.ci/scripts/utils.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,15 @@ build_executorch_runner_cmake() {
125125
clean_executorch_install_folders
126126
mkdir "${CMAKE_OUTPUT_DIR}"
127127

128-
pushd "${CMAKE_OUTPUT_DIR}" || return
129128
if [[ $1 == "Debug" ]]; then
130129
CXXFLAGS="-fsanitize=address,undefined"
131130
else
132131
CXXFLAGS=""
133132
fi
134-
CXXFLAGS="$CXXFLAGS" retry cmake -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" -DCMAKE_BUILD_TYPE="${1:-Release}" ..
135-
popd || return
133+
CXXFLAGS="$CXXFLAGS" retry cmake \
134+
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
135+
-DCMAKE_BUILD_TYPE="${1:-Release}" \
136+
-B${CMAKE_OUTPUT_DIR} .
136137

137138
if [ "$(uname)" == "Darwin" ]; then
138139
CMAKE_JOBS=$(( $(sysctl -n hw.ncpu) - 1 ))
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,28 @@ jobs:
6161
else
6262
echo "SUCCESS: All ExecuTorch CUDA builds (12.6, 12.8, 12.9) completed successfully!"
6363
fi
64+
65+
test-models-cuda:
66+
name: test-models-cuda
67+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
68+
permissions:
69+
id-token: write
70+
contents: read
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
model: [linear, add, add_mul, resnet18]
75+
with:
76+
timeout: 90
77+
runner: linux.g5.4xlarge.nvidia.gpu
78+
gpu-arch-type: cuda
79+
gpu-arch-version: 12.6
80+
use-custom-docker-registry: false
81+
submodules: recursive
82+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
83+
script: |
84+
set -eux
85+
86+
PYTHON_EXECUTABLE=python CMAKE_ARGS="-DEXECUTORCH_BUILD_CUDA=ON" ./install_executorch.sh
87+
export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
88+
PYTHON_EXECUTABLE=python source .ci/scripts/test_model.sh "${{ matrix.model }}" cmake cuda

.github/workflows/pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,12 +909,12 @@ jobs:
909909
contents: read
910910
secrets: inherit
911911
with:
912+
secrets-env: SAMSUNG_AI_LITECORE_KEY
912913
runner: linux.2xlarge
913914
docker-image: ci-image:executorch-ubuntu-22.04-clang12-android
914915
submodules: 'recursive'
915916
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
916917
timeout: 90
917-
secrets-env: SAMSUNG_AI_LITECORE_KEY
918918
script: |
919919
set -ex
920920

.github/workflows/test-backend-arm.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
paths:
1313
- .github/workflows/test-backend-arm.yml
1414
- .github/workflows/_test_backend.yml
15+
- .ci/scripts/test_backend.sh
16+
- backends/test/suite/flow.py
17+
- backends/test/suite/flows/arm.py
1518
workflow_dispatch:
1619

1720
concurrency:

0 commit comments

Comments
 (0)