Skip to content

Commit 04ca3f3

Browse files
committed
Merge remote-tracking branch 'cavus/main' into openvino_llama_support
2 parents 8106204 + 65100f6 commit 04ca3f3

File tree

801 files changed

+38202
-12340
lines changed

Some content is hidden

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

801 files changed

+38202
-12340
lines changed

.ci/docker/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ case "${IMAGE_NAME}" in
5454
executorch-ubuntu-22.04-mediatek-sdk)
5555
MEDIATEK_SDK=yes
5656
CLANG_VERSION=12
57-
ANDROID_NDK_VERSION=r27b
57+
ANDROID_NDK_VERSION=r28c
5858
;;
5959
executorch-ubuntu-22.04-clang12-android)
6060
LINTRUNNER=""
6161
CLANG_VERSION=12
6262
# From https://developer.android.com/ndk/downloads
63-
ANDROID_NDK_VERSION=r27b
63+
ANDROID_NDK_VERSION=r28c
6464
;;
6565
*)
6666
echo "Invalid image name ${IMAGE_NAME}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
40b02a2dc61bbf901a2df91719f47c98d65368ec
1+
bd06b54e627fbfd354a2cffa4c80fb21883209a9
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4d4abec80f03cd8fdefe1d9cb3a60d3690cd777e
1+
53a2908a10f414a2f85caa06703a26a40e873869

.ci/docker/requirements-ci.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ hypothesis==6.84.2
1616
parameterized==0.9.0
1717

1818
# Doc build requirements, same as https://github.com/pytorch/pytorch/blob/main/.ci/docker/requirements-docs.txt
19-
sphinx==5.3.0
19+
sphinx==7.2.6
20+
sphinxcontrib.katex==0.9.10
21+
breathe==4.36.0 # only if generating C++
22+
exhale==0.3.7 # only if generating C++ docs
23+
docutils==0.18.1,<0.21
24+
sphinx-design==0.6.1
25+
sphinxcontrib-mermaid==1.0.0
26+
myst-parser==3.0.1 # if want to contribute in markdown
27+
sphinx-gallery==0.14.0 # only if hosting interactive tutorials
28+
sphinx-sitemap==2.7.1
2029
sphinx-reredirects==0.1.4
21-
sphinx-gallery==0.14.0
22-
breathe==4.34.0
23-
exhale==0.2.3
24-
docutils==0.16
2530
matplotlib>=3.9.4
31+
sphinx-copybutton==0.5.2
2632
# PyTorch Theme
27-
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
28-
myst-parser==0.18.1
29-
sphinx_design==0.4.1
30-
sphinx-copybutton==0.5.0
33+
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2
3134

3235
# script unit test requirements
3336
yaspin==3.1.0

.ci/scripts/setup-samsung-linux-deps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -ex
1111

1212
download_ai_lite_core() {
1313
API_BASE="https://soc-developer.semiconductor.samsung.com/api/v1/resource/ai-litecore/download"
14-
API_KEY="kn10SoSY3hkC-9Qny5TqD2mnqVrlupv3krnjLeBt5cY"
14+
API_KEY=$SAMSUNG_AI_LITECORE_KEY
1515

1616
VERSION="0.5"
1717
OS_NAME="Ubuntu 22.04"
@@ -52,7 +52,7 @@ download_ai_lite_core() {
5252
install_enn_backend() {
5353
NDK_INSTALLATION_DIR=/opt/ndk
5454
rm -rf "${NDK_INSTALLATION_DIR}" && sudo mkdir -p "${NDK_INSTALLATION_DIR}"
55-
ANDROID_NDK_VERSION=r27b
55+
ANDROID_NDK_VERSION=r28c
5656

5757
# build Exynos backend
5858
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/ndk}

.ci/scripts/test-cuda-build.sh

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -exu
9+
10+
CUDA_VERSION=${1:-"12.6"}
11+
12+
echo "=== Testing ExecuTorch CUDA ${CUDA_VERSION} Build ==="
13+
14+
# Function to build and test ExecuTorch with CUDA support
15+
test_executorch_cuda_build() {
16+
local cuda_version=$1
17+
18+
echo "Building ExecuTorch with CUDA ${cuda_version} support..."
19+
echo "ExecuTorch will automatically detect CUDA and install appropriate PyTorch wheel"
20+
21+
# Check available resources before starting
22+
echo "=== System Information ==="
23+
echo "Available memory: $(free -h | grep Mem | awk '{print $2}')"
24+
echo "Available disk space: $(df -h . | tail -1 | awk '{print $4}')"
25+
echo "CPU cores: $(nproc)"
26+
echo "CUDA version check:"
27+
nvcc --version || echo "nvcc not found"
28+
nvidia-smi || echo "nvidia-smi not found"
29+
30+
# Set CMAKE_ARGS to enable CUDA build - ExecuTorch will handle PyTorch installation automatically
31+
export CMAKE_ARGS="-DEXECUTORCH_BUILD_CUDA=ON"
32+
33+
echo "=== Starting ExecuTorch Installation ==="
34+
# Install ExecuTorch with CUDA support with timeout and error handling
35+
timeout 5400 ./install_executorch.sh || {
36+
local exit_code=$?
37+
echo "ERROR: install_executorch.sh failed with exit code: $exit_code"
38+
if [ $exit_code -eq 124 ]; then
39+
echo "ERROR: Installation timed out after 90 minutes"
40+
fi
41+
exit $exit_code
42+
}
43+
44+
echo "SUCCESS: ExecuTorch CUDA build completed"
45+
46+
# Verify the installation
47+
echo "=== Verifying ExecuTorch CUDA Installation ==="
48+
49+
# Test that ExecuTorch was built successfully
50+
python -c "
51+
import executorch
52+
print('SUCCESS: ExecuTorch imported successfully')
53+
"
54+
55+
# Test CUDA availability and show details
56+
python -c "
57+
try:
58+
import torch
59+
print('INFO: PyTorch version:', torch.__version__)
60+
print('INFO: CUDA available:', torch.cuda.is_available())
61+
62+
if torch.cuda.is_available():
63+
print('SUCCESS: CUDA is available for ExecuTorch')
64+
print('INFO: CUDA version:', torch.version.cuda)
65+
print('INFO: GPU device count:', torch.cuda.device_count())
66+
print('INFO: Current GPU device:', torch.cuda.current_device())
67+
print('INFO: GPU device name:', torch.cuda.get_device_name())
68+
69+
# Test basic CUDA tensor operation
70+
device = torch.device('cuda')
71+
x = torch.randn(10, 10).to(device)
72+
y = torch.randn(10, 10).to(device)
73+
z = torch.mm(x, y)
74+
print('SUCCESS: CUDA tensor operation completed on device:', z.device)
75+
print('INFO: Result tensor shape:', z.shape)
76+
77+
print('SUCCESS: ExecuTorch CUDA integration verified')
78+
else:
79+
print('WARNING: CUDA not detected, but ExecuTorch built successfully')
80+
exit(1)
81+
except Exception as e:
82+
print('ERROR: ExecuTorch CUDA test failed:', e)
83+
exit(1)
84+
"
85+
86+
echo "SUCCESS: ExecuTorch CUDA ${cuda_version} build and verification completed successfully"
87+
}
88+
89+
# Main execution
90+
echo "Current working directory: $(pwd)"
91+
echo "Directory contents:"
92+
ls -la
93+
94+
# Run the CUDA build test
95+
test_executorch_cuda_build "${CUDA_VERSION}"

.ci/scripts/test_backend_linux.sh renamed to .ci/scripts/test_backend.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,26 @@ SUITE=$1
1010
FLOW=$2
1111
ARTIFACT_DIR=$3
1212

13-
REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.csv"
13+
REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.json"
1414

1515
echo "Running backend test job for suite $SUITE, flow $FLOW."
1616
echo "Saving job artifacts to $ARTIFACT_DIR."
1717

18-
# The generic Linux job chooses to use base env, not the one setup by the image
1918
eval "$(conda shell.bash hook)"
2019
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
2120
conda activate "${CONDA_ENV}"
2221

22+
if [[ "$(uname)" == "Darwin" ]]; then
23+
bash .ci/scripts/setup-conda.sh
24+
eval "$(conda shell.bash hook)"
25+
CONDA_RUN_CMD="${CONDA_RUN} --no-capture-output"
26+
${CONDA_RUN_CMD} pip install awscli==1.37.21
27+
IS_MACOS=1
28+
else
29+
CONDA_RUN_CMD=""
30+
IS_MACOS=0
31+
fi
32+
2333
export PYTHON_EXECUTABLE=python
2434

2535
# CMake options to use, in addition to the defaults.
@@ -50,11 +60,14 @@ if [[ "$FLOW" == *arm* ]]; then
5060
.ci/scripts/setup-arm-baremetal-tools.sh
5161
fi
5262

53-
# We need the runner to test the built library.
54-
PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release --editable true
63+
if [[ $IS_MACOS -eq 1 ]]; then
64+
SETUP_SCRIPT=.ci/scripts/setup-macos.sh
65+
else
66+
SETUP_SCRIPT=.ci/scripts/setup-linux.sh
67+
fi
68+
CMAKE_ARGS="$EXTRA_BUILD_ARGS" ${CONDA_RUN_CMD} $SETUP_SCRIPT --build-tool cmake --build-mode Release --editable true
5569

5670
EXIT_CODE=0
57-
python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$REPORT_FILE" || EXIT_CODE=$?
58-
71+
${CONDA_RUN_CMD} pytest -c /dev/nul -n auto backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
5972
# Generate markdown summary.
60-
python -m executorch.backends.test.suite.generate_markdown_summary "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE
73+
${CONDA_RUN_CMD} python -m executorch.backends.test.suite.generate_markdown_summary_json "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE

.ci/scripts/test_backend_macos.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)