Skip to content

Commit 6de4d8a

Browse files
committed
Merge branch 'main' into vraspar/webgpu-native-matmul
2 parents 1b52d26 + dcc1f5a commit 6de4d8a

File tree

292 files changed

+10091
-4817
lines changed

Some content is hidden

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

292 files changed

+10091
-4817
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Install ONNX Runtime Wheel'
2+
description: 'Uninstalls existing ONNX Runtime packages and installs a wheel from a specified directory.'
3+
inputs:
4+
whl-directory:
5+
description: 'The directory containing the ONNX Runtime wheel files.'
6+
required: true
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Uninstall onnxruntime packages
11+
shell: pwsh
12+
run: |
13+
python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq
14+
15+
- name: Install onnxruntime wheel from specified directory
16+
shell: pwsh
17+
run: |
18+
Get-ChildItem -Path ${{ inputs.whl-directory }}/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# .github/actions/setup-android-ndk/action.yml
2+
name: 'Setup Android NDK'
3+
description: 'Installs and configures a specific version of the Android NDK'
4+
inputs:
5+
ndk-version:
6+
description: 'The version of the Android NDK to install (e.g., 27.2.12479018)'
7+
required: true
8+
default: '27.2.12479018'
9+
android-sdk-root:
10+
description: 'The root directory of the Android SDK'
11+
required: true
12+
default: '/usr/local/lib/android/sdk'
13+
14+
runs:
15+
using: "composite" # Use a composite action for multiple shell commands
16+
steps:
17+
- name: Install coreutils and ninja
18+
shell: bash
19+
run: sudo apt-get update -y && sudo apt-get install -y coreutils ninja-build
20+
21+
- name: Install Android NDK
22+
shell: bash
23+
run: |
24+
set -e
25+
"${{ inputs.android-sdk-root }}/cmdline-tools/latest/bin/sdkmanager" --install "ndk;${{ inputs.ndk-version }}"
26+
27+
NDK_PATH="${{ inputs.android-sdk-root }}/ndk/${{ inputs.ndk-version }}"
28+
if [[ ! -d "${NDK_PATH}" ]]; then
29+
echo "NDK directory is not in expected location: ${NDK_PATH}"
30+
exit 1
31+
fi
32+
33+
# Use standard environment variable setting in bash and add to GITHUB_ENV
34+
echo "ANDROID_NDK_HOME=${NDK_PATH}" >> $GITHUB_ENV
35+
echo "ANDROID_NDK_ROOT=${NDK_PATH}" >> $GITHUB_ENV
36+
echo "ANDROID_NDK_HOME: ${NDK_PATH}"
37+
echo "ANDROID_NDK_ROOT: ${NDK_PATH}"
38+
39+
- name: Check if emulator are installed and add to PATH
40+
shell: bash
41+
run: |
42+
if [[ ":$PATH:" == *":${ANDROID_SDK_ROOT}/emulator:"* ]]; then
43+
echo "${ANDROID_SDK_ROOT}/emulator is in PATH"
44+
else
45+
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "emulator"
46+
echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH
47+
fi
48+
49+
- name: Check if platform tools are installed and add to PATH
50+
shell: bash
51+
run: |
52+
if [[ ":$PATH:" == *":${ANDROID_SDK_ROOT}/platform-tools:"* ]]; then
53+
echo "${ANDROID_SDK_ROOT}/platform-tools is in PATH"
54+
else
55+
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "platform-tools"
56+
echo "${ANDROID_SDK_ROOT}/platform-tools" >> $GITHUB_PATH
57+
fi
58+
ls -R "${ANDROID_SDK_ROOT}/platform-tools"
59+
60+
- name: Create Android Emulator
61+
shell: bash
62+
env:
63+
ANDROID_AVD_HOME: ${{ runner.temp }}/android-avd
64+
run: |
65+
python3 tools/python/run_android_emulator.py \
66+
--android-sdk-root "${ANDROID_SDK_ROOT}" \
67+
--create-avd --system-image "system-images;android-31;default;x86_64"
68+
69+
- name: List Android AVDs
70+
shell: bash
71+
env:
72+
ANDROID_AVD_HOME: ${{ runner.temp }}/android-avd
73+
run: |
74+
"${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/avdmanager" list avd
75+
76+
- name: Check emulator.pid does not exist
77+
shell: bash
78+
run: |
79+
if test -f ./emulator.pid; then
80+
echo "Emulator PID file was not expected to exist but does and has pid: `cat ./emulator.pid`"
81+
exit 1
82+
fi
83+
84+
- name: Start Android Emulator
85+
shell: bash
86+
env:
87+
ANDROID_AVD_HOME: ${{ runner.temp }}/android-avd
88+
run: |
89+
set -e -x
90+
python3 tools/python/run_android_emulator.py \
91+
--android-sdk-root "${ANDROID_SDK_ROOT}" \
92+
--start --emulator-extra-args="-partition-size 2047" \
93+
--emulator-pid-file ./emulator.pid
94+
echo "Emulator PID: `cat ./emulator.pid`"
95+
96+
- name: View Android ENVs
97+
shell: bash
98+
run: env | grep ANDROID

.github/workflows/android.yml

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Android CI
2+
# This workflow is used to build and test on Android Emulator on Linux
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- rel-*
9+
pull_request:
10+
branches:
11+
- main
12+
- rel-*
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
18+
19+
jobs:
20+
android_nnapi_ep:
21+
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Ubuntu2204-AMD-CPU"]
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Use jdk 17
26+
uses: actions/setup-java@v4
27+
with:
28+
distribution: 'temurin'
29+
java-version: '17'
30+
architecture: x64
31+
32+
- name: Setup Android NDK
33+
uses: ./.github/actions/setup-android-ndk
34+
with:
35+
ndk-version: 27.2.12479018
36+
37+
- name: Export GitHub Actions cache environment variables
38+
uses: actions/github-script@v7
39+
with:
40+
script: |
41+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
42+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
43+
44+
- name: NNAPI EP, Build, Test on Android Emulator
45+
run: >-
46+
python3 tools/ci_build/build.py
47+
--enable_lto
48+
--android
49+
--build_dir build_nnapi
50+
--android_sdk_path "$ANDROID_HOME"
51+
--android_ndk_path "$ANDROID_NDK_HOME"
52+
--android_abi=x86_64
53+
--android_api=29
54+
--skip_submodule_sync
55+
--parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache
56+
--use_nnapi
57+
--build_shared_lib
58+
--cmake_generator=Ninja
59+
--build_java
60+
shell: bash
61+
62+
63+
- name: Build Minimal ORT with NNAPI and run tests
64+
run: tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh "$(pwd)"
65+
shell: bash
66+
67+
- name: Install psutil for emulator shutdown by run_android_emulator.py
68+
if: always()
69+
run: python3 -m pip install psutil
70+
shell: bash
71+
72+
- name: Stop Android Emulator
73+
if: always()
74+
run: |
75+
env | grep ANDROID
76+
if test -f ${{ github.workspace }}/emulator.pid; then
77+
echo "Emulator PID:"`cat ${{ github.workspace }}/emulator.pid`
78+
python3 tools/python/run_android_emulator.py \
79+
--android-sdk-root "${ANDROID_SDK_ROOT}" \
80+
--stop \
81+
--emulator-pid-file ${{ github.workspace }}/emulator.pid
82+
rm ${{ github.workspace }}/emulator.pid
83+
else
84+
echo "Emulator PID file was expected to exist but does not."
85+
fi
86+
shell: bash
87+
88+
android_cpu_ep:
89+
name: Android CI Pipeline
90+
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Ubuntu2204-AMD-CPU"]
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
- name: Use jdk 17
95+
uses: actions/setup-java@v4
96+
with:
97+
distribution: 'temurin'
98+
java-version: '17'
99+
architecture: x64
100+
101+
- name: Setup Android NDK
102+
uses: ./.github/actions/setup-android-ndk
103+
with:
104+
ndk-version: 27.2.12479018
105+
106+
- name: Export GitHub Actions cache environment variables
107+
uses: actions/github-script@v7
108+
with:
109+
script: |
110+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
111+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
112+
113+
- name: CPU EP, Build and Test
114+
run: >-
115+
python3 tools/ci_build/build.py
116+
--enable_lto
117+
--android
118+
--build_dir build
119+
--android_sdk_path $ANDROID_HOME
120+
--android_ndk_path $ANDROID_NDK_HOME
121+
--android_abi=x86_64
122+
--android_api=30
123+
--skip_submodule_sync
124+
--parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache
125+
--cmake_generator=Ninja
126+
--build_java
127+
shell: bash
128+
129+
- name: Install psutil for emulator shutdown by run_android_emulator.py
130+
if: always()
131+
run: python3 -m pip install psutil
132+
shell: bash
133+
134+
- name: Stop Android Emulator
135+
if: always()
136+
run: |
137+
if test -f ${{ github.workspace }}/emulator.pid; then
138+
echo "Emulator PID:"`cat ${{ github.workspace }}/emulator.pid`
139+
python3 tools/python/run_android_emulator.py \
140+
--android-sdk-root "${ANDROID_SDK_ROOT}" \
141+
--stop \
142+
--emulator-pid-file ${{ github.workspace }}/emulator.pid
143+
rm ${{ github.workspace }}/emulator.pid
144+
else
145+
echo "Emulator PID file was expected to exist but does not."
146+
fi
147+
shell: bash

.github/workflows/ios.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ name: iOS_CI_on_Mac
22

33
on:
44
push:
5-
branches: [ main, 'rel-*']
5+
branches:
6+
- main
7+
- rel-*
68
pull_request:
7-
branches: [ main ]
9+
branches:
10+
- main
11+
- rel-*
12+
workflow_dispatch:
813

914
concurrency:
1015
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/mac.yml

+41-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,46 @@ jobs:
154154
--use_xnnpack \
155155
--use_binskim_compliant_compile_flags
156156
157+
ARM64-Xcode16-webgpu:
158+
runs-on: macos-15
159+
160+
env:
161+
xcode_version: 16
162+
163+
timeout-minutes: 60
164+
165+
steps:
166+
- uses: actions/setup-python@v5
167+
with:
168+
python-version: ${{ env.python_version }}
169+
170+
- name: Verify ARM64 machine
171+
shell: python
172+
run: |
173+
import platform
174+
assert platform.machine() == "arm64", "This job expects to be run on an ARM64 machine."
175+
176+
- name: Use Xcode ${{ env.xcode_version }}
177+
shell: bash
178+
run: |
179+
XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ env.xcode_version }}.app/Contents/Developer"
180+
sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}"
181+
182+
- uses: actions/checkout@v4
183+
184+
- name: Build and test
185+
shell: bash
186+
run: |
187+
python ./tools/ci_build/build.py \
188+
--build_dir ./build \
189+
--update \
190+
--build --parallel \
191+
--test \
192+
--build_shared_lib \
193+
--build_nodejs \
194+
--use_webgpu \
195+
--use_binskim_compliant_compile_flags
196+
157197
ARM64-Xcode16-targeting-iphonesimulator:
158198
runs-on: macos-15
159199

@@ -164,7 +204,7 @@ jobs:
164204
matrix:
165205
target_arch: [x86_64, arm64]
166206

167-
timeout-minutes: 75
207+
timeout-minutes: 90
168208

169209
steps:
170210
- uses: actions/setup-python@v5

0 commit comments

Comments
 (0)