Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Apr 29, 2024
1 parent 55c0b69 commit 64ce581
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 75 deletions.
1 change: 0 additions & 1 deletion .pipelines/nuget-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ stages:
enable_linux_cuda: ${{ parameters.enable_linux_cuda }}
enable_win_dml: ${{ parameters.enable_win_dml }}
ort_version: ${{ parameters.ort_version }}
ort_dml_version: ${{ parameters.ort_dml_version }}
cuda_version: ${{ parameters.cuda_version }}
1 change: 0 additions & 1 deletion .pipelines/pypl-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@ stages:
enable_win_cuda: ${{ parameters.enable_win_cuda }}
enable_win_dml: ${{ parameters.enable_win_dml }}
ort_version: ${{ parameters.ort_version }}
ort_dml_version: ${{ parameters.ort_dml_version }}
cuda_version: ${{ parameters.cuda_version }}

15 changes: 9 additions & 6 deletions .pipelines/stages/jobs/nuget-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,21 @@ jobs:
value: ${{ parameters.ort_version }}
- name: GDN_CODESIGN_TARGETDIRECTORY
value: '$(Build.ArtifactStagingDirectory)/nuget'
- name: os
value: ${{ parameters.os }}
- name: ort_filename
${{ if eq(parameters.ep, 'cpu') }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime'
${{ elseif eq(parameters.ep, 'cuda') }}:
${{if eq(parameters.cuda_version, '11.8') }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-gpu-${{ parameters.ort_version }}'
${{if eq(parameters.os, 'win') }}:
value: 'Microsoft.ML.OnnxRuntime.Gpu.Windows'
${{ else }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-cuda12-${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime.Gpu.Linux'
${{ elseif eq(parameters.ep, 'directml')}}:
value: 'Microsoft.ML.OnnxRuntime.DirectML.${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime.DirectML'
${{ else }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-${{ parameters.ep}}-${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime'

- name: genai_nuget_ext
${{ if eq(parameters.ep, 'cpu') }}:
value: ''
Expand Down
15 changes: 9 additions & 6 deletions .pipelines/stages/jobs/py-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,21 @@ jobs:
value: ${{ parameters.ep }}
- name: ort_version
value: ${{ parameters.ort_version }}
- name: os
value: ${{ parameters.os }}

- name: ort_filename
${{ if eq(parameters.ep, 'cpu') }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime'
${{ elseif eq(parameters.ep, 'cuda') }}:
${{if eq(parameters.cuda_version, '11.8') }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-gpu-${{ parameters.ort_version }}'
${{if eq(parameters.os, 'win') }}:
value: 'Microsoft.ML.OnnxRuntime.Gpu.Windows'
${{ else }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-cuda12-${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime.Gpu.Linux'
${{ elseif eq(parameters.ep, 'directml')}}:
value: 'Microsoft.ML.OnnxRuntime.DirectML.${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime.DirectML'
${{ else }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-${{ parameters.ep}}-${{ parameters.ort_version }}'
value: 'Microsoft.ML.OnnxRuntime'

- name: dml_dir
value: 'Microsoft.AI.DirectML.1.14.1'
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/stages/jobs/steps/utils/capi-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ steps:
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/$(buildDir)'
Contents: |
onnxruntime-genai.so
libonnxruntime-genai.so
TargetFolder: '$(Build.ArtifactStagingDirectory)\$(artifactName)\lib'
- ${{ else }}:
- task: CopyFiles@2
Expand Down
78 changes: 25 additions & 53 deletions .pipelines/stages/jobs/steps/utils/download-ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,32 @@ parameters:
type: string
default: cpu
steps:
- bash: |
echo "##[error]Error: ort_version and ort_filename are not set"
exit 1
displayName: 'Check if variables ort_version and ort_filename are set'
condition: or( eq (variables['ort_version'], ''), eq (variables['ort_filename'], ''))

#Special case for DML
- ${{ if ne(parameters.ep, 'directml') }}:
- task: DownloadGitHubRelease@0
inputs:
connection: 'GitHub - Release'
userRepository: 'microsoft/onnxruntime'
defaultVersionType: 'specificTag'
version: 'v$(ort_version)'
itemPattern: '$(ort_filename).${{ parameters.archiveType }}'
downloadPath: '$(Build.Repository.LocalPath)'
displayName: Download $(ort_filename)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.Repository.LocalPath)/$(ort_filename).${{ parameters.archiveType }}'
destinationFolder: '$(Build.Repository.LocalPath)'
cleanDestinationFolder: false
overwriteExistingFiles: true
displayName: Unzip OnnxRuntime
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/$(ort_filename)'
TargetFolder: '$(Build.Repository.LocalPath)/ort'
displayName: Copy OnnxRuntime to ort
- ${{ else }}:
- task: DownloadPackage@1
inputs:
packageType: 'nuget'
feed: '2692857e-05ef-43b4-ba9c-ccf1c22c437c/7982ae20-ed19-4a35-a362-a96ac99897b7'
definition: 'Microsoft.ML.OnnxRuntime.DirectML' # Can also be package name
version: '$(ort_version)'
extract: false
downloadPath: '$(Build.Repository.LocalPath)'
displayName: Download $(ort_filename)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.Repository.LocalPath)/*.nupkg'
destinationFolder: '$(Build.Repository.LocalPath)/ort'
cleanDestinationFolder: false
overwriteExistingFiles: true
displayName: Unzip OnnxRuntime
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/ort/runtimes/win-x64/native'
TargetFolder: '$(Build.Repository.LocalPath)/ort/lib'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/ort/build/native/include'
TargetFolder: '$(Build.Repository.LocalPath)/ort/include'
- task: DownloadPackage@1
inputs:
packageType: 'nuget'
feed: '2692857e-05ef-43b4-ba9c-ccf1c22c437c/7982ae20-ed19-4a35-a362-a96ac99897b7'
definition: '$(ort_filename)' # Can also be package name
version: '$(ort_version)'
extract: false
downloadPath: '$(Build.Repository.LocalPath)'
displayName: Download Onnxruntime file
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.Repository.LocalPath)/*.nupkg'
destinationFolder: '$(Build.Repository.LocalPath)/ort'
cleanDestinationFolder: false
overwriteExistingFiles: true
displayName: Unzip OnnxRuntime
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/ort/runtimes/$(os)-$(arch)/native'
TargetFolder: '$(Build.Repository.LocalPath)/ort/lib'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/ort/'
Contents: '**/native/include/**'
TargetFolder: '$(Build.Repository.LocalPath)/ort/include'

- task: DeleteFiles@1
inputs:
Expand Down
5 changes: 1 addition & 4 deletions .pipelines/stages/nuget-packaging-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ parameters:
type: boolean
- name: ort_version
type: string
- name: ort_dml_version
type: string
- name: cuda_version
type: string
default: ''
Expand All @@ -34,9 +32,8 @@ stages:
parameters:
arch: 'x64'
ep: 'directml'
ort_version: ${{ parameters.ort_dml_version }}
ort_version: ${{ parameters.ort_version }}
os: 'win'
publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }}

- ${{ if eq(parameters.enable_win_cuda, true) }}:
- template: jobs/nuget-packaging-job.yml
Expand Down
4 changes: 1 addition & 3 deletions .pipelines/stages/py-packaging-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ parameters:
type: boolean
- name: ort_version
type: string
- name: ort_dml_version
type: string
- name: cuda_version
type: string
default: ''
Expand All @@ -34,7 +32,7 @@ stages:
parameters:
arch: 'x64'
ep: 'directml'
ort_version: ${{ parameters.ort_dml_version }}
ort_version: ${{ parameters.ort_version }}
os: 'win'

- ${{ if eq(parameters.enable_win_cuda, true) }}:
Expand Down

0 comments on commit 64ce581

Please sign in to comment.