Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc4 cherry-pick #226

Merged
merged 13 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
13 changes: 12 additions & 1 deletion .pipelines/nuget-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ parameters:
- '12.2'
default: '11.8'

- name: publish_to_ado_feed
displayName: 'Publish to Azure DevOps Feed'
type: boolean
default: false

- name: publish_to_nuget
displayName: 'Publish to NuGet.org'
type: boolean
default: false

resources:
repositories:
- repository: manylinux
Expand All @@ -51,4 +61,5 @@ stages:
enable_linux_cuda: ${{ parameters.enable_linux_cuda }}
ort_version: ${{ parameters.ort_version }}
cuda_version: ${{ parameters.cuda_version }}

publish_to_nuget: ${{ parameters.publish_to_nuget }}
publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }}
51 changes: 0 additions & 51 deletions .pipelines/stages/jobs/nuget-linux-packaging-job.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .pipelines/stages/jobs/nuget-packaging-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
parameters:
- name: arch
type: string
- name: ep
type: string
- name: ort_version
type: string
- name: cuda_version
type: string
default: ''
- name: os
type: string
- name: publish_to_ado_feed
type: boolean
- name: publish_to_nuget
type: boolean
jobs:
- job: nuget_${{ parameters.os }}_${{ parameters.ep }}_${{ parameters.arch }}_packaging
${{ if eq(parameters.os, 'linux') }}:
pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
${{ if eq(parameters.os, 'win') }}:
pool: 'onnxruntime-Win-CPU-2022'
timeoutInMinutes: 180
# set variables here to be used in the template and steps
variables:
- name: arch
value: ${{ parameters.arch }}
- name: artifactName
value: 'onnxruntime-genai-${{ parameters.os }}-${{ parameters.ep }}-${{ parameters.arch }}'
- name: buildConfig
value: 'Release'
- name: buildDir
value: 'build/${{ parameters.ep }}'
- name: cuda_version
value: ${{ parameters.cuda_version }}
- name: ep
value: ${{ parameters.ep }}
- name: ort_version
value: ${{ parameters.ort_version }}
- name: GDN_CODESIGN_TARGETDIRECTORY
value: '$(Build.ArtifactStagingDirectory)/nuget'
- name: ort_filename
${{ if eq(parameters.ep, 'cpu') }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-${{ parameters.ort_version }}'
${{ else}}:
${{if eq(parameters.cuda_version, '11.8') }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-gpu-${{ parameters.ort_version }}'
${{ else }}:
value: 'onnxruntime-${{ parameters.os }}-${{ parameters.arch }}-cuda12-${{ parameters.ort_version }}'
- name: genai_nuget_ext
${{ if eq(parameters.ep, 'cpu') }}:
value: ''
${{ if eq(parameters.ep, 'cuda') }}:
value: '.Cuda'
- name: ort_nuget_ext
${{ if eq(parameters.ep, 'cpu') }}:
value: ''
${{ if eq(parameters.ep, 'cuda') }}:
value: '.Gpu'
workspace:
clean: all
steps:
- template: steps/capi-${{ parameters.os }}-step.yml
parameters:
target: 'onnxruntime-genai'

# TODO: Add a step to build the linux nuget package
- ${{ if eq(parameters.os, 'win') }}:
- template: steps/nuget-${{ parameters.os }}-step.yml
- ${{ if or(eq(parameters.publish_to_nuget, true), eq(parameters.publish_to_ado_feed, true))}}:
- template: steps/nuget-releasing-step.yml
parameters:
publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }}
publish_to_nuget: ${{ parameters.publish_to_nuget }}

- template: steps/compliant-and-cleanup-step.yml

70 changes: 0 additions & 70 deletions .pipelines/stages/jobs/nuget-win-packaging-job.yml

This file was deleted.

8 changes: 3 additions & 5 deletions .pipelines/stages/jobs/py-linux-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
workspace:
clean: all
pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
# set variables here to be used in the template and steps
variables:
# The build machine pool doesn't have dotnet, so it can't run CG.
- name: skipComponentGovernanceDetection
Expand All @@ -39,6 +40,8 @@ jobs:
value: ${{ parameters.arch }}
- name: ep
value: ${{ parameters.ep }}
- name: artifactName
value: 'onnxruntime-genai-capi-linux-${{ parameters.ep }}-${{ parameters.arch }}-python'
- name: cuda_version
value: ${{ parameters.cuda_version }}
- name: ort_version
Expand All @@ -58,10 +61,5 @@ jobs:
target: 'python'
genai_src: '$(Build.SourcesDirectory)/onnxruntime-genai'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
inputs:
ArtifactName: onnxruntime-genai-linux-$(ep)-$(arch)

- template: steps/compliant-and-cleanup-step.yml

30 changes: 3 additions & 27 deletions .pipelines/stages/jobs/py-win-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ jobs:
Python312_x64:
PythonVersion: '3.12'
timeoutInMinutes: 180
# set variables here to be used in the template and steps
variables:
- name: ep
value: ${{ parameters.ep }}
- name: cuda_version
value: ${{ parameters.cuda_version }}
- name: artifactName
value: 'onnxruntime-genai-capi-win-${{ parameters.ep }}-${{ parameters.arch }}-wheel'
- name: arch
value: ${{ parameters.arch }}
- name: ort_version
Expand Down Expand Up @@ -64,32 +67,5 @@ jobs:
- template: steps/capi-win-step.yml
parameters:
target: 'python'
# ep: ${{ parameters.ep }}

- template: steps/compliant/win-esrp-dll-step.yml
parameters:
FolderPath: '$(Build.SourcesDirectory)\build\release\$(ep)_default\wheel\onnxruntime_genai'
DisplayName: 'ESRP - PYD Sign'
DoEsrp: true
Pattern: '*.pyd'

- powershell: |
cmake --build --preset windows_$(arch)_$(ep)_release --parallel --PyPackageBuild
displayName: 'Build Python Wheel'

- powershell: |
Get-ChildItem -Path $(Build.SourcesDirectory) -Recurse

- task: CopyFiles@2
displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\build\release\$(ep)_default\wheel'
Contents: '*.whl'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime Genai python wheel'
inputs:
ArtifactName: onnxruntime-genai-win-$(ep)-$(arch)

- template: steps/compliant-and-cleanup-step.yml
Loading
Loading