diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index e51bbe156..79e318cda 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -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 }} diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index ea8c77b24..2020ec4ec 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -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 }} diff --git a/.pipelines/stages/jobs/nuget-packaging-job.yml b/.pipelines/stages/jobs/nuget-packaging-job.yml index e65abf838..3a6e4d72a 100644 --- a/.pipelines/stages/jobs/nuget-packaging-job.yml +++ b/.pipelines/stages/jobs/nuget-packaging-job.yml @@ -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: '' diff --git a/.pipelines/stages/jobs/py-packaging-job.yml b/.pipelines/stages/jobs/py-packaging-job.yml index dd1dabf1b..b6b3ee199 100644 --- a/.pipelines/stages/jobs/py-packaging-job.yml +++ b/.pipelines/stages/jobs/py-packaging-job.yml @@ -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' diff --git a/.pipelines/stages/jobs/steps/utils/capi-archive.yml b/.pipelines/stages/jobs/steps/utils/capi-archive.yml index 6034d255c..62ac453f5 100644 --- a/.pipelines/stages/jobs/steps/utils/capi-archive.yml +++ b/.pipelines/stages/jobs/steps/utils/capi-archive.yml @@ -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 diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 5346bade8..5e108af4e 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -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: diff --git a/.pipelines/stages/nuget-packaging-stage.yml b/.pipelines/stages/nuget-packaging-stage.yml index cd571d503..7e8a41e43 100644 --- a/.pipelines/stages/nuget-packaging-stage.yml +++ b/.pipelines/stages/nuget-packaging-stage.yml @@ -11,8 +11,6 @@ parameters: type: boolean - name: ort_version type: string -- name: ort_dml_version - type: string - name: cuda_version type: string default: '' @@ -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 diff --git a/.pipelines/stages/py-packaging-stage.yml b/.pipelines/stages/py-packaging-stage.yml index a8c479cb5..9b40414f2 100644 --- a/.pipelines/stages/py-packaging-stage.yml +++ b/.pipelines/stages/py-packaging-stage.yml @@ -11,8 +11,6 @@ parameters: type: boolean - name: ort_version type: string -- name: ort_dml_version - type: string - name: cuda_version type: string default: '' @@ -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) }}: