Skip to content

Commit

Permalink
Merge branch 'main' into jialli/genny-maui
Browse files Browse the repository at this point in the history
  • Loading branch information
skyline75489 committed Dec 13, 2024
2 parents d374090 + 1e2105b commit 133297e
Show file tree
Hide file tree
Showing 185 changed files with 7,563 additions and 2,401 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/linux-cpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ jobs:
with:
dotnet-version: '8.0.x'

- name: Setup Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: '8.6'

- name: Get the Latest OnnxRuntime Nightly Version
shell: pwsh
run: |
Expand Down Expand Up @@ -94,7 +106,12 @@ jobs:
run: |
export ORTGENAI_LOG_ORT_LIB=1
cd test/csharp
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/" /p:OrtLibDir="../../ort/lib/"
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/" /p:OrtLibDir="../../ort/lib/" --verbosity normal
- name: Build the Java API and Run the Java Tests
run: |
set -e -x
python3 build.py --config=Release --build_dir build/cpu --build_java --parallel --cmake_generator "Ninja"
- name: Run tests
run: |
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/mac-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ jobs:
with:
python-version: '3.12.x'

- name: Setup Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: '8.6'

- 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')
Expand Down Expand Up @@ -76,13 +88,20 @@ jobs:
source genai-macos-venv/bin/activate
export HF_TOKEN="12345"
export ORTGENAI_LOG_ORT_LIB=1
python3 -m pip install requests
python3 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: |
export ORTGENAI_LOG_ORT_LIB=1
cd test/csharp
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/osx-arm64"
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/osx-arm64" --verbosity normal
- name: Build the Java API and Run the Java Tests
run: |
set -e -x
source genai-macos-venv/bin/activate
python3 build.py --config=Release --build_dir build/cpu/osx-arm64 --build_java --parallel --cmake_generator "Unix Makefiles"
- name: Run tests
run: |
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/win-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ jobs:
with:
nuget-version: '5.x'

- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: '8.6'

- name: Download OnnxRuntime Nightly
shell: powershell
run: |
Expand All @@ -54,18 +66,14 @@ jobs:
- name: Configure CMake
run: |
python -m pip install wheel
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
- 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: Install the Python Wheel and Test Dependencies
run: |
python -m pip install "numpy<2" coloredlogs flatbuffers packaging protobuf sympy pytest
Expand All @@ -76,6 +84,15 @@ jobs:
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
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/win-cpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ jobs:
with:
dotnet-version: '8.0.x'

- name: Setup Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: '8.6'

- name: Download OnnxRuntime Nightly
shell: pwsh
run: |
Expand Down Expand Up @@ -90,7 +102,11 @@ jobs:
- 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"
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib" --verbosity normal
- name: Build the Java API and Run the Java Tests
run: |
python3 build.py --config=Release --build_dir $env:binaryDir --build_java --parallel
- name: Verify Build Artifacts
if: always()
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/win-cuda-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ jobs:
run: |
echo "${{ env.cuda_dir }}\\v${{ env.cuda_version }}\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build the C# API and Run the C# Tests
run: |
cd test\csharp
dotnet test /p:Configuration=release /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib"
- name: Install the Python Wheel and Test Dependencies
run: |
python -m pip install -r test\python\requirements.txt
Expand All @@ -100,6 +95,12 @@ jobs:
Get-ChildItem -Path $env:GITHUB_WORKSPACE\$env:binaryDir -Recurse
- name: Build the C# API and Run the C# Tests
run: |
$env:PATH = "${{ env.cuda_dir }}\\v${{ env.cuda_version }}\\bin;" + $env:PATH
cd test\csharp
dotnet test /p:Configuration=release /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib"
- name: Prepend CUDA to PATH and Run tests
run: |
$env:PATH = "${{ env.cuda_dir }}\\v${{ env.cuda_version }}\\bin;" + $env:PATH
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ examples/csharp/HelloPhi/models
/src/java/.gradle
/src/java/local.properties
/src/java/build
/src/java/CMakeFiles
/src/java/CMakeCache.txt
22 changes: 22 additions & 0 deletions .pipelines/macos-ios-cocoapods-publishing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
parameters:
- name: ort_version
displayName: 'OnnxRuntime version'
type: string
default: '1.18.0'

- name: build_config
displayName: 'Build Configuration'
type: string
default: 'Release'
values:
- 'Debug'
- 'RelWithDebInfo'
- 'Release'
- 'MinSizeRel'

trigger: none
stages:
- template: stages/macos-ios-cocoapods-packaging-stage.yml
parameters:
ort_version: ${{ parameters.ort_version }}
build_config: ${{ parameters.build_config }}
1 change: 1 addition & 0 deletions .pipelines/stages/jobs/capi-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,6 @@ jobs:
- template: steps/capi-appleframework-step.yml
parameters:
build_config: ${{ parameters.build_config }}
build_settings_file: "tools/ci_build/github/apple/default_full_ios_framework_build_settings.json"

- template: steps/compliant-and-cleanup-step.yml
40 changes: 40 additions & 0 deletions .pipelines/stages/jobs/macos-ios-cocoapods-packaging-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
parameters:
- name: build_config
type: string
- name: ort_version
type: string

jobs:
- job: macos_ios_cocoapods_packaging
pool:
vmImage: 'macOS-latest'
variables:
buildSettingsFile: "tools/ci_build/github/apple/default_full_apple_framework_build_settings.json"

workspace:
clean: all
steps:
- checkout: self
clean: true
submodules: none

- template: steps/utils/set-genai-version.yml
- template: steps/utils/set-cmake-build-type.yml
parameters:
build_config: ${{parameters.build_config}}


- task: CmdLine@2
displayName: Build MacOS & iOS CocoaPods Packages
inputs:
script: |
set -e -x
python tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
--build-dir "$(Build.BinariesDirectory)/apple_framework" \
--staging-dir "$(Build.BinariesDirectory)/staging" \
--pod-version "$(genai_version)" \
--test \
--variant Full \
--build-settings-file "${{ variables.buildSettingsFile }}" \
--build-apple-framework-args==--config=$(cmake_build_type) \
--ort-version ${{parameters.ort_version}}
2 changes: 2 additions & 0 deletions .pipelines/stages/jobs/nuget-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ jobs:

- template: steps/utils/set-genai-version.yml

- task: NuGetAuthenticate@1

- powershell: |
dotnet --info
dotnet build Microsoft.ML.OnnxRuntimeGenAI.csproj -p:Configuration="$(buildConfig)" -p:IncludeMobileTargets=true --verbosity normal
Expand Down
Loading

0 comments on commit 133297e

Please sign in to comment.