Add llama-bench for android #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android ARM64 llama-bench Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/extra-android-android-arm64-tools.yml' | |
| - '**/CMakeLists.txt' | |
| - '**/*.h' | |
| - '**/*.hpp' | |
| - '**/*.c' | |
| - '**/*.cpp' | |
| - '**/*.cu' | |
| - '**/*.cuh' | |
| - 'tools/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - '.github/workflows/extra-android-android-arm64-tools.yml' | |
| - '**/CMakeLists.txt' | |
| - '**/*.h' | |
| - '**/*.hpp' | |
| - '**/*.c' | |
| - '**/*.cpp' | |
| - '**/*.cu' | |
| - '**/*.cuh' | |
| - 'tools/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| # https://developer.android.com/ndk/downloads | |
| NDK_VERSION: "29.0.14206865" | |
| jobs: | |
| android-arm64-llama-bench: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ggml-org/ccache-action@v1.2.16 | |
| with: | |
| key: android-arm64-llama-bench | |
| - uses: actions/setup-java@v3 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - uses: android-actions/setup-android@v3 | |
| with: | |
| log-accepted-android-sdk-licenses: false | |
| - run: sdkmanager "ndk;${{ env.NDK_VERSION }}" | |
| - run: | | |
| echo "ANDROID_NDK=$HOME/.android/sdk/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV | |
| - run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build | |
| - run: | | |
| cmake -B build -G Ninja \ | |
| -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ | |
| -DANDROID_ABI=arm64-v8a \ | |
| -DANDROID_PLATFORM=android-28 \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DGGML_NATIVE=OFF \ | |
| -DGGML_BACKEND_DL=ON \ | |
| -DGGML_CPU_ALL_VARIANTS=ON \ | |
| -DLLAMA_CURL=OFF \ | |
| -DGGML_OPENMP=OFF \ | |
| -DLLAMA_BUILD_TOOLS=ON \ | |
| -DLLAMA_BUILD_EXAMPLES=OFF \ | |
| -DLLAMA_BUILD_TESTS=OFF \ | |
| -DLLAMA_BUILD_SERVER=OFF | |
| cmake --build build --config Release --target llama-bench | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: llama-bench-android-arm64-v8a | |
| path: build/bin/* | |
| retention-days: 30 | |
| if-no-files-found: error |