From 83dcfd1c5003d7d4a16deb443e2aeba00975d677 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:13:34 +0800 Subject: [PATCH 1/6] Try to fix Android CI --- .github/workflows/android-build.yml | 2 +- .../ai/onnxruntime_genai/example/javavalidator/SimpleTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index b814f4939..d6399d82d 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -21,7 +21,7 @@ jobs: # it doesn't work on macos-14. # HVF error: HV_UNSUPPORTED # it works on macos-13 but with macos-15 being released soon that isn't a long term solution. - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout OnnxRuntime GenAI repo uses: actions/checkout@v4 diff --git a/src/java/src/test/android/app/src/androidTest/java/ai/onnxruntime_genai/example/javavalidator/SimpleTest.kt b/src/java/src/test/android/app/src/androidTest/java/ai/onnxruntime_genai/example/javavalidator/SimpleTest.kt index 6c8d9705c..259409875 100644 --- a/src/java/src/test/android/app/src/androidTest/java/ai/onnxruntime_genai/example/javavalidator/SimpleTest.kt +++ b/src/java/src/test/android/app/src/androidTest/java/ai/onnxruntime_genai/example/javavalidator/SimpleTest.kt @@ -90,7 +90,7 @@ class SimpleTest { // the test model requires manual input as the token ids have to be < 1000 but the configured tokenizer // has a larger vocab size and the input ids it generates are not valid. val model = Model(newModelPath) - val params = model.createGeneratorParams() + val params = GeneratorParams(model) val sequenceLength = 4 val batchSize = 2 From ec5681707616c4ef820d076b50cf8460d52dd3a2 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:23:33 +0800 Subject: [PATCH 2/6] Try 1ES pool --- .github/workflows/android-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index d6399d82d..0cb222ff3 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -21,7 +21,7 @@ jobs: # it doesn't work on macos-14. # HVF error: HV_UNSUPPORTED # it works on macos-13 but with macos-15 being released soon that isn't a long term solution. - runs-on: ubuntu-24.04 + runs-on: [ "self-hosted", "1ES.Pool=onnxruntime-genai-Ubuntu2204-AMD-CPU" ] steps: - name: Checkout OnnxRuntime GenAI repo uses: actions/checkout@v4 From a24f7ea9266ee75268813748d0584fe311732c88 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:53:12 +0800 Subject: [PATCH 3/6] really? --- .github/workflows/android-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 0cb222ff3..ccef687c7 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -28,6 +28,10 @@ jobs: with: submodules: true + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Setup Java 17 uses: actions/setup-java@v4 with: @@ -54,10 +58,6 @@ jobs: run: | sudo apt-get install jq - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Checkout OnnxRuntime GenAI repo uses: actions/checkout@v4 with: From 1f717d2160324c9164da95d56fce4d316ec7e293 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:01:48 +0800 Subject: [PATCH 4/6] Rm --- .github/workflows/android-build.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index ccef687c7..cfbf8d0a8 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -28,10 +28,6 @@ jobs: with: submodules: true - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Setup Java 17 uses: actions/setup-java@v4 with: @@ -63,25 +59,6 @@ jobs: with: submodules: true - - name: Get the Latest OnnxRuntime Nightly Version - run: | - ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion') - echo "$ORT_NIGHTLY_VERSION" - echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV - - # have to create a dummy project to use `add package` - - name: Download OnnxRuntime Nightly - run: | - dotnet new console - dotnet add package ${{ env.ORT_PACKAGE_NAME }} --version ${{ env.ORT_NIGHTLY_VERSION }} --source ${{ env.ORT_NIGHTLY_SOURCE }} --package-directory . - - - name: Extract ONNX Runtime AAR - run: | - set -e -x - ls -l - unzip microsoft.ml.onnxruntime/${{ env.ORT_NIGHTLY_VERSION }}/runtimes/android/native/onnxruntime.aar -d ort - ls -lR ort - - name: Create Android build run: | set -e -x From 5fc02f8f11f05e65499afdeb63f9100f2b1fd5fb Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:56:24 +0800 Subject: [PATCH 5/6] Try install android emulator --- .github/workflows/android-build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index cfbf8d0a8..c6cbd0405 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -41,14 +41,27 @@ jobs: gradle-version: '8.6' # Check the NDK that we're using - - name: Check Android NDKs + - name: Check Android SDK and NDK run: | set -e -x uname -m + echo "ANDROID_HOME=$ANDROID_HOME" + ls -l $ANDROID_HOME + + echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" echo "ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME" ls -l $ANDROID_HOME/ndk + - name: Check if emulator are installed and install if needed + run: | + if [ -d "${ANDROID_SDK_ROOT}/emulator" ] then + echo "${ANDROID_SDK_ROOT}/emulator exists" + else + ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "emulator" + fi + # Needed for linux - name: Install jq run: | From 089bb9878e813b3d1f4984494d7d2ffb012f71b0 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:01:26 +0800 Subject: [PATCH 6/6] Try to install android emulator --- .github/workflows/android-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index c6cbd0405..6fa3bd530 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -40,7 +40,7 @@ jobs: with: gradle-version: '8.6' - # Check the NDK that we're using + # Check the Android SDK and NDK that we're using - name: Check Android SDK and NDK run: | set -e -x @@ -54,9 +54,9 @@ jobs: echo "ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME" ls -l $ANDROID_HOME/ndk - - name: Check if emulator are installed and install if needed + - name: Check if emulator is installed and install it if needed run: | - if [ -d "${ANDROID_SDK_ROOT}/emulator" ] then + if [ -d "${ANDROID_SDK_ROOT}/emulator" ]; then echo "${ANDROID_SDK_ROOT}/emulator exists" else ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "emulator"