Skip to content

Add model builder for Qwen2_5_VLTextModel #6595

Add model builder for Qwen2_5_VLTextModel

Add model builder for Qwen2_5_VLTextModel #6595

name: "Windows CPU arm64 Build"
on:
workflow_dispatch:
push:
branches:
- main
- rel-*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: true
env:
binaryDir: 'build/cpu/win-arm64'
ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1"
ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime"
jobs:
windows-cpu-arm64-build:
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-genai-win11-arm64-cpu2"]
steps:
- name: Checkout OnnxRuntime GenAI repo
uses: actions/checkout@v5
with:
submodules: true
- uses: nuget/setup-nuget@v2
with:
nuget-version: '5.x'
- name: Set up Python 3.12 for ARM64
uses: actions/setup-python@v6
with:
python-version: '3.12'
architecture: 'arm64'
cache: 'pip'
- name: Setup Java 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
architecture: 'aarch64'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: '8.6'
- name: Download OnnxRuntime Nightly
shell: powershell
run: |
$resp = Invoke-RestMethod "${{ env.ORT_NIGHTLY_REST_API }}"
$ORT_NIGHTLY_VERSION = $resp.value[0].versions[0].normalizedVersion
Write-Host "$ORT_NIGHTLY_VERSION"
"ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
nuget install ${{ env.ORT_PACKAGE_NAME }} -version $ORT_NIGHTLY_VERSION -x -NonInteractive
- run: Get-ChildItem ${{ env.ORT_PACKAGE_NAME }} -Recurse
continue-on-error: true
- name: Extract OnnxRuntime library and header files
run: |
mkdir ort/lib
move ${{ env.ORT_PACKAGE_NAME }}/build/native/include ort/
move ${{ env.ORT_PACKAGE_NAME }}/runtimes/win-arm64/native/* ort/lib/
- name: Install Rust Toolchain
run: |
$exePath = "$env:TEMP\rustup-init.exe"
(New-Object Net.WebClient).DownloadFile('https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe', $exePath)
& $exePath -y --default-toolchain=1.86.0
Add-Content $env:GITHUB_PATH "$env:USERPROFILE\.cargo\bin"
- name: Install LLVM
run: |
choco install llvm --yes
Add-Content $env:GITHUB_PATH "C:\Program Files\LLVM\bin"
- name: Configure CMake
run: |
python -m pip install wheel requests
cmake --preset windows_arm64_cpu_release
- name: Build with CMake
run: |
cmake --build --preset windows_arm64_cpu_release --parallel
cmake --build --preset windows_arm64_cpu_release --target PyPackageBuild
- name: Install the Python Wheel and Test Dependencies
run: |
# Uninstalling LLVM/Clang as it is no longer required and causes issues with numpy installation
choco uninstall llvm --yes
python -m pip install "numpy<2" coloredlogs flatbuffers packaging protobuf sympy pytest
python -m pip install onnxruntime-qnn
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps
- name: Run the Python Tests
run: |
python test/python/test_onnxruntime_genai.py --cwd "test\python" --test_models "test\test_models"
- name: Build the C# API and Run the C# Tests
run: |
cd test\csharp
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib"
- name: Build the Java API and Run the Java Tests
run: |
python build.py --config=Release --build_dir $env:binaryDir --build_java --parallel
- name: Verify Build Artifacts
if: always()
continue-on-error: true
run: |
Get-ChildItem -Path $env:GITHUB_WORKSPACE\$env:binaryDir -Recurse
Get-ChildItem -Path $env:GITHUB_WORKSPACE\$env:binaryDir\test -Recurse
- name: Run tests
run: |-
copy $env:GITHUB_WORKSPACE\ort\lib\* .\$env:binaryDir\Release
& .\$env:binaryDir\Release\unit_tests.exe