Skip to content

Commit 337f0c2

Browse files
committed
Merge remote-tracking branch 'origin/main' into user/xiaofeihan/implement_gemm
2 parents ff864c6 + 9dbfee9 commit 337f0c2

File tree

521 files changed

+20658
-9706
lines changed

Some content is hidden

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

521 files changed

+20658
-9706
lines changed

.github/ISSUE_TEMPLATE/03-mobile.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ body:
131131
id: ep-version
132132
attributes:
133133
label: Execution Provider Library Version
134-
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
134+
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
135135
validations:
136136
required: false

.github/ISSUE_TEMPLATE/05-performance.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ body:
127127
id: ep-version
128128
attributes:
129129
label: Execution Provider Library Version
130-
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
130+
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
131131
validations:
132132
required: false
133133
- type: textarea

.github/ISSUE_TEMPLATE/06-training.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ body:
7272
id: ep-version
7373
attributes:
7474
label: Execution Provider Library Version
75-
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
75+
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
7676
validations:
7777
required: false

.github/ISSUE_TEMPLATE/08-general.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ body:
125125
id: ep-version
126126
attributes:
127127
label: Execution Provider Library Version
128-
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
128+
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
129129
validations:
130130
required: false
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}
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: "macOS CI pipeline setup steps"
2+
description: "Common setup steps for macOS CI pipelines"
3+
4+
inputs:
5+
platform_machine:
6+
required: false
7+
type: string
8+
default: "arm64"
9+
python_version:
10+
required: false
11+
type: string
12+
default: "3.11"
13+
node_version:
14+
required: false
15+
type: string
16+
default: "20.x"
17+
java_version:
18+
required: false
19+
type: string
20+
default: "17"
21+
xcode_version:
22+
required: false
23+
type: string
24+
default: "16"
25+
use_cache:
26+
required: false
27+
type: boolean
28+
default: false
29+
30+
runs:
31+
using: "composite"
32+
steps:
33+
- name: Use Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ inputs.python_version }}
37+
38+
- name: Verify machine architecture
39+
shell: python
40+
run: |
41+
import platform
42+
print(f"Running on {platform.machine()}")
43+
assert platform.machine().lower() == "${{ inputs.platform_machine}}", "This job expects to be run on an ${{ inputs.platform_machine}} machine."
44+
45+
- name: Use Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: ${{ inputs.node_version }}
49+
50+
- name: Install coreutils and ninja
51+
shell: bash
52+
run: brew install coreutils ninja
53+
54+
- name: Install Java
55+
uses: actions/setup-java@v4
56+
with:
57+
distribution: "temurin"
58+
java-version: ${{ inputs.java_version }}
59+
60+
- name: Use Xcode ${{ inputs.xcode_version }}
61+
shell: bash
62+
run: |
63+
XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ inputs.xcode_version }}.app/Contents/Developer"
64+
sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}"
65+
66+
- name: Export GitHub Actions cache environment variables
67+
if: ${{ inputs.use_cache }}
68+
uses: actions/github-script@v7
69+
with:
70+
script: |
71+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
72+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
73+
74+
- name: Install python dependencies
75+
shell: bash
76+
working-directory: ${{ github.workspace }}
77+
run: |
78+
python -m pip install --upgrade pip
79+
python -m pip install -r requirements-dev.txt
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 }}

0 commit comments

Comments
 (0)