Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .pipelines/mac-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ jobs:
displayName: 'Run the Java tests'
workingDirectory: '$(Build.SourcesDirectory)'

- bash: |
set -e -x
rm -rf ort
displayName: 'Remove the ort lib and header files'
workingDirectory: '$(Build.SourcesDirectory)'

- bash: |
ls -l $(Build.SourcesDirectory)/build/cpu/osx-arm64
ls -l $(Build.SourcesDirectory)/build/cpu/osx-arm64/wheel
Expand All @@ -216,7 +210,7 @@ jobs:
set -e -x
export ORTGENAI_LOG_ORT_LIB=1
cd test/csharp
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/osx-arm64" --verbosity normal
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/osx-arm64" /p:OrtLibDir="../../ort/lib" --verbosity normal
displayName: 'Build the C# API and run the C# tests'
workingDirectory: '$(Build.SourcesDirectory)'

Expand Down
2 changes: 1 addition & 1 deletion .pipelines/nuget-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ parameters:
type: string
values:
- '12.8'
- '13.0'
- '13.1'
default: '12.8'

- name: build_config
Expand Down
14 changes: 10 additions & 4 deletions .pipelines/pypl-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ parameters:
type: boolean
default: true

- name: enable_win_arm64_cpu
displayName: 'Whether Windows ARM64 CPU package is built.'
- name: enable_win_arm64
displayName: 'Whether Windows ARM64 package is built.'
type: boolean
default: true

Expand Down Expand Up @@ -54,6 +54,11 @@ parameters:
type: string
default: '2.1.1'

- name: ort_cuda_version
displayName: 'OnnxRuntime GPU version'
type: string
default: '1.23.0'

- name: cuda_versions
displayName: 'CUDA versions'
type: string
Expand Down Expand Up @@ -115,11 +120,12 @@ extends:
enable_win_x64_cpu: ${{ parameters.enable_win_x64_cpu }}
enable_win_cuda: ${{ parameters.enable_win_cuda }}
enable_win_dml: ${{ parameters.enable_win_dml }}
enable_win_arm64_cpu: ${{ parameters.enable_win_arm64_cpu }}
enable_win_arm64: ${{ parameters.enable_win_arm64 }}
enable_macos_cpu: ${{ parameters.enable_macos_cpu }}
cuda_versions: ${{ parameters.cuda_versions }}
build_config: ${{ parameters.build_config }}
enable_winml: ${{ parameters.enable_winml }}
ort_cuda_version: ${{ parameters.ort_cuda_version }}
${{ if eq(parameters.enable_winml, true) }}:
ort_version: ${{ parameters.ort_winml_version }}
${{ else }}:
Expand All @@ -136,7 +142,7 @@ extends:
enable_win_x64_cpu: ${{ parameters.enable_win_x64_cpu }}
enable_win_cuda: ${{ parameters.enable_win_cuda }}
enable_win_dml: ${{ parameters.enable_win_dml }}
enable_win_arm64_cpu: ${{ parameters.enable_win_arm64_cpu }}
enable_win_arm64: ${{ parameters.enable_win_arm64 }}
enable_macos_cpu: ${{ parameters.enable_macos_cpu }}
cuda_versions: ${{ parameters.cuda_versions }}
SpecificArtifact: false
14 changes: 14 additions & 0 deletions .pipelines/stages/capi-packaging-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ stages:
enable_winml: ${{ parameters.enable_winml }}
ort_version: ${{ parameters.ort_winml_version }}
build_config: ${{ parameters.build_config }}
cuda_version: ${{ parameters.cuda_version }}

- ${{ if eq(parameters.enable_win_x64_cpu, true) }}:
- template: jobs/capi-packaging-job.yml
Expand Down Expand Up @@ -129,6 +130,19 @@ stages:
ort_build_version: ${{ parameters.ort_build_version }}
ort_build_source: ${{ parameters.ort_build_source }}

- ${{ if and(eq(parameters.enable_win_arm64, true), eq(parameters.enable_win_cuda, true)) }}:
- template: jobs/capi-packaging-job.yml
parameters:
arch: 'arm64'
cuda_version: ${{ parameters.cuda_version }}
ep: 'cuda'
ort_version: ${{ parameters.ort_cuda_version }}
os: 'win'
build_config: ${{ parameters.build_config }}
enable_winml: ${{ parameters.enable_winml }}
ort_build_version: ${{ parameters.ort_build_version }}
ort_build_source: ${{ parameters.ort_build_source }}

- ${{ if eq(parameters.enable_linux_x64_cpu, true) }}:
- template: jobs/capi-packaging-job.yml
parameters:
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/stages/jobs/custom-nuget-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:

- template: steps/utils/flex-download-pipeline-artifact.yml
parameters:
StepName: 'Download win-cpu-arm64 capi Artifacts'
ArtifactName: onnxruntime-genai-win-cpu-arm64-capi
StepName: 'Download win-cuda-arm64 capi Artifacts'
ArtifactName: onnxruntime-genai-win-cuda-arm64-capi
TargetPath: '$(Build.BinariesDirectory)/artifact-downloads'

- template: steps/utils/flex-download-pipeline-artifact.yml
Expand Down
20 changes: 20 additions & 0 deletions .pipelines/stages/jobs/nuget-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ jobs:
ArtifactName: onnxruntime-genai-win-cuda-x64-capi
TargetPath: '$(Build.BinariesDirectory)/artifact-downloads'

- ${{ if and(eq(parameters.enable_win_arm64, true), eq(parameters.enable_win_cuda, true), eq(parameters.ep, 'cuda')) }}:
- template: steps/utils/flex-download-pipeline-artifact.yml
parameters:
StepName: 'Download win-cuda-arm64 capi Artifacts'
ArtifactName: onnxruntime-genai-win-cuda-arm64-capi
TargetPath: '$(Build.BinariesDirectory)/artifact-downloads'

- ${{ if and(eq(parameters.enable_win_dml, true), eq(parameters.ep, 'directml')) }}:
- template: steps/utils/flex-download-pipeline-artifact.yml
parameters:
Expand Down Expand Up @@ -317,6 +324,19 @@ jobs:
}
}

if ('${{ parameters.ep }}' -eq 'cuda') {
$cudaExpected = @{}
if ('${{ parameters.enable_win_cuda }}' -eq 'True') { $cudaExpected['win-x64'] = 'onnxruntime-genai-cuda.dll' }
if ('${{ parameters.enable_win_arm64 }}' -eq 'True') { $cudaExpected['win-arm64'] = 'onnxruntime-genai-cuda.dll' }
if ('${{ parameters.enable_linux_cuda }}' -eq 'True') { $cudaExpected['linux-x64'] = 'libonnxruntime-genai-cuda.so' }
foreach ($rid in $cudaExpected.Keys) {
$lib = "$outputDir/$rid/$(buildConfig)/$($cudaExpected[$rid])"
if (-not (Test-Path $lib)) {
throw "Expected CUDA native library missing for enabled RID '$rid': $lib"
}
}
}

displayName: 'Extract Artifacts & Prepare Native Libraries'
workingDirectory: '$(Build.BinariesDirectory)/artifact-downloads'

Expand Down
2 changes: 1 addition & 1 deletion .pipelines/stages/jobs/nuget-validation-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
value: 'cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4'

- name: cuda_docker_image
${{ if eq(parameters.cuda_version, '13.0') }}:
${{ if eq(parameters.cuda_version, '13.1') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda13_x64_almalinux8_gcc14:20251107.1
${{ else }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc12:20250714.2
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/stages/jobs/py-validation-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
value: 'cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4'

- name: cuda_docker_image
${{ if eq(parameters.cuda_version, '13.0') }}:
${{ if eq(parameters.cuda_version, '13.1') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda13_x64_almalinux8_gcc14:20251107.1
${{ else }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc12:20250714.2
Expand Down
30 changes: 23 additions & 7 deletions .pipelines/stages/jobs/steps/capi-linux-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ steps:
- bash: |
set -e -x
python3 -m pip install requests
python3 tools/ci_build/get_docker_image.py --dockerfile tools/ci_build/github/linux/docker/manylinux/Dockerfile.manylinux2_28_$(ep)_$(cuda_version) \
cuda_dockerfile_version="$(cuda_version)"
if [[ "$(cuda_version)" == 13.* ]]; then
cuda_dockerfile_version="13"
fi
python3 tools/ci_build/get_docker_image.py --dockerfile tools/ci_build/github/linux/docker/manylinux/Dockerfile.manylinux2_28_$(ep)_$cuda_dockerfile_version \
--context tools/ci_build/github/linux/docker/manylinux \
--docker-build-args "--build-arg BUILD_UID=$( id -u )" \
--container-registry onnxruntimebuildcache \
Expand Down Expand Up @@ -161,15 +165,28 @@ steps:
- ${{ if eq(parameters.target, 'onnxruntime-genai') }}:
- script: |
set -e -x
docker_env_args=()
if [ "$(ep)" = "cuda" ]; then
docker_env_args=(-e CMAKE_EXTRA_ARGS="$(CMAKE_EXTRA_ARGS)")
fi
docker run \
--rm \
--volume $(Build.Repository.LocalPath):/ort_genai_src \
-w /ort_genai_src/ ortgenai$(ep)build$(arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_$(ep)_$(build_config) \
-DENABLE_TESTS=OFF -DENABLE_PYTHON=OFF $(CMAKE_EXTRA_ARGS) $(ORT_HOME_CMAKE_ARG) && \
-w /ort_genai_src/ \
"${docker_env_args[@]}" \
ortgenai$(ep)build$(arch) \
bash -c '
set -e -x
cmake_args=(-DENABLE_TESTS=OFF -DENABLE_PYTHON=OFF)
if [ -n "$CMAKE_EXTRA_ARGS" ]; then
eval "cmake_args+=($CMAKE_EXTRA_ARGS)"
fi
if [ "${{ parameters.ort_build_version }}" != "default" ]; then
cmake_args+=("-DORT_HOME=/ort_genai_src/ort_build")
fi
/usr/bin/cmake --preset linux_gcc_$(ep)_$(build_config) "${cmake_args[@]}"
/usr/bin/cmake --build --preset linux_gcc_$(ep)_$(build_config) \
--target onnxruntime-genai"
--target onnxruntime-genai'
displayName: 'Build GenAi'
workingDirectory: '$(Build.Repository.LocalPath)'

Expand Down Expand Up @@ -252,4 +269,3 @@ steps:
- script: |
ls $(Build.Repository.LocalPath) -R
displayName: 'List files from SourceDirectory'

76 changes: 68 additions & 8 deletions .pipelines/stages/jobs/steps/capi-win-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,62 @@ steps:
- powershell: |
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v$(cuda_version)" 'cuda_sdk'
displayName: 'Download CUDA $(cuda_version)'
condition: or(eq(variables['ep'], 'cuda'), and(eq(variables['ep'], 'winml'), eq(variables['arch'], 'x64')))
condition: and(eq(variables['arch'], 'x64'), or(eq(variables['ep'], 'cuda'), eq(variables['ep'], 'winml')))
workingDirectory: '$(Build.Repository.LocalPath)'

- ${{ if or(eq(parameters.ep, 'cuda'), and(eq(parameters.ep, 'winml'), eq(parameters.arch, 'x64'))) }}:
- powershell: |
Write-Host "Downloading Azure CLI..."
$azCliUrl = "https://aka.ms/installazurecliwindows"
$installerPath = "$(Agent.TempDirectory)\AzureCLI.msi"
Invoke-WebRequest -Uri $azCliUrl -OutFile $installerPath
Write-Host "Installing Azure CLI..."
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i", $installerPath, "/quiet", "/norestart" -Wait
Write-Host "Azure CLI installed successfully"
# Add Azure CLI to PATH
$azCliBin = "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin"
if (!(Test-Path $azCliBin)) {
Write-Error "Azure CLI install failed or path not found: $azCliBin"
exit 1
}
Comment thread
baijumeswani marked this conversation as resolved.
$env:PATH = "$azCliBin;$env:PATH"

Write-Host "Downloading AzCopy..."
$azcopyUrl = "https://aka.ms/downloadazcopy-v10-windows"
$azcopyZip = "$(Agent.TempDirectory)\azcopy.zip"
Invoke-WebRequest -Uri $azcopyUrl -OutFile $azcopyZip
$azcopyExtractPath = "$(Agent.TempDirectory)\azcopy"
Expand-Archive -Path $azcopyZip -DestinationPath $azcopyExtractPath -Force
# Find the actual azcopy.exe (it's in a versioned subfolder)
$azcopyExeFile = Get-ChildItem -Path $azcopyExtractPath -Name "azcopy.exe" -Recurse | Select-Object -First 1
if (-not $azcopyExeFile) {
Write-Error "AzCopy executable not found after extraction"
exit 1
}
$azcopyFullPath = Get-ChildItem -Path $azcopyExtractPath -Filter "azcopy.exe" -Recurse | Select-Object -First 1
$azcopyDir = $azcopyFullPath.Directory.FullName
Write-Host "AzCopy found at: $azcopyDir"
$env:PATH = "$azcopyDir;$env:PATH"

Write-Host "##vso[task.setvariable variable=PATH]$env:PATH"
# Verify installations
az --version
azcopy --version
displayName: 'Install Azure CLI and AzCopy'
condition: and(eq(variables['arch'], 'arm64'), or(eq(variables['ep'], 'winml'), eq(variables['ep'], 'cuda')))
workingDirectory: '$(Build.Repository.LocalPath)'

- ${{ if and(or(eq(parameters.ep, 'cuda'), eq(parameters.ep, 'winml')), eq(parameters.arch, 'arm64')) }}:
- task: AzureCLI@2
displayName: 'Download CUDA $(cuda_version)'
inputs:
azureSubscription: 'ortcibuild_readonly_mi2-ONNX Runtime'
scriptType: batch
scriptLocation: inlineScript
inlineScript: |
set AZCOPY_AUTO_LOGIN_TYPE=AZCLI
azcopy cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/win-arm64/v$(cuda_version)" "cuda_sdk"

- ${{ if or(eq(parameters.ep, 'cuda'), eq(parameters.ep, 'winml')) }}:
- powershell: |
if ('$(cuda_version)' -like '13.*') {
$cuda_archs = "75-real;80-real;86-real;89-real;90-real;100-real;120-real;120-virtual"
Expand Down Expand Up @@ -108,13 +160,13 @@ steps:
condition: eq(variables['arch'], 'arm64')
workingDirectory: '$(Build.Repository.LocalPath)'

- ${{ if ne(parameters.ort_build_version, 'default') }}:
- ${{ if or(ne(parameters.ort_build_version, 'default'), and(eq(parameters.ep, 'cuda'), eq(parameters.arch, 'arm64'))) }}:
- powershell: |
$ep = "$(ep)"
$arch = "$(arch)"

switch ($ep) {
"cuda" { $packageName = "Microsoft.ML.OnnxRuntime.Gpu.Windows" }
"cuda" { $packageName = if ($arch -eq "arm64") { "Microsoft.ML.OnnxRuntime" } else { "Microsoft.ML.OnnxRuntime.Gpu.Windows" } }
"directml" { $packageName = "Microsoft.ML.OnnxRuntime.DirectML" }
default { $packageName = "Microsoft.ML.OnnxRuntime" }
}
Expand All @@ -123,6 +175,13 @@ steps:
$feedProject = "2692857e-05ef-43b4-ba9c-ccf1c22c437c"
$feedId = "7982ae20-ed19-4a35-a362-a96ac99897b7"
$version = "${{ parameters.ort_build_version }}"
if ($version -eq "default") {
$version = "$(ort_version)"
}
if ([string]::IsNullOrWhiteSpace($version)) {
Write-Error "ORT build version is empty. Set ort_build_version or pass the appropriate ORT version parameter for $ep/$arch."
exit 1
}

$source = "${{ parameters.ort_build_source }}"
if ($source -eq "Ort-Nightly") {
Expand All @@ -148,7 +207,8 @@ steps:
# Copy headers
# CUDA packages store headers in buildTransitive/native/include, while other
# ORT packages (CPU, DML) use build/native/include per NuGet package layout.
if ($ep -eq "cuda") {
# CUDA arm64 currently builds against the CPU ORT package, which uses build/native/include.
if ($ep -eq "cuda" -and $arch -ne "arm64") {
$headerSrc = "$extractPath\buildTransitive\native\include"
} else {
$headerSrc = "$extractPath\build\native\include"
Expand All @@ -162,13 +222,13 @@ steps:
Write-Host "ORT_HOME: $ortHome"
Get-ChildItem "$ortHome" -Recurse | Select-Object FullName
Write-Host "##vso[task.setvariable variable=ORT_HOME_CMAKE_ARG]-DORT_HOME=$ortHome"
displayName: 'Download ORT build package ${{ parameters.ort_build_version }}'
displayName: 'Download ORT build package'
condition: ne(variables['ep'], 'winml')
workingDirectory: '$(Build.Repository.LocalPath)'

- powershell: |
cmake --preset windows_$(arch)_$(ep)_$(build_config) -DWINML_SDK_VERSION='$(ort_version)'
displayName: 'Configure CMake C API with WinML (arm64, NO CUDA) - $(ort_version)'
cmake --preset windows_$(arch)_$(ep)_$(build_config) -T cuda='$(Build.Repository.LocalPath)\cuda_sdk\v$(cuda_version)' -DWINML_SDK_VERSION='$(ort_version)' -DCMAKE_CUDA_ARCHITECTURES='$(cuda_archs)'
displayName: 'Configure CMake C API with WinML (arm64, WITH CUDA) - $(ort_version)'
condition: and(eq(variables['ep'], 'winml'), eq(variables['arch'], 'arm64'))
workingDirectory: '$(Build.Repository.LocalPath)'

Expand Down
1 change: 1 addition & 0 deletions .pipelines/stages/nuget-packaging-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ stages:
build_config: ${{ parameters.build_config }}
enable_linux_cuda: ${{ parameters.enable_linux_cuda }}
enable_win_cuda: ${{ parameters.enable_win_cuda }}
enable_win_arm64: ${{ parameters.enable_win_arm64 }}
Comment thread
baijumeswani marked this conversation as resolved.
nuget_version_type: ${{ parameters.nuget_version_type }}
- ${{ if eq(parameters.enable_win_dml, true) }}:
- template: jobs/nuget-packaging-job.yml
Expand Down
Loading
Loading