From 2a0a696650f4ae42c81e1d32786690719551a859 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Sun, 28 Apr 2024 14:30:12 -0700 Subject: [PATCH 01/27] Creating the install --- CMakeLists.txt | 5 +++-- cmake/package.cmake | 10 ++++++++++ src/tokenizer/CMakeLists.txt | 5 ++--- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 cmake/package.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index acf8f22f6..f565d9c0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,8 +178,7 @@ if(USE_DML) add_dependencies(onnxruntime-genai RESTORE_PACKAGES) add_dependencies(onnxruntime-genai-static RESTORE_PACKAGES) endif() - -if(NO_TOKENIZEROOT) +if(NO_TOKENIZER) add_compile_definitions(NO_TOKENIZER=1) message("----------------Tokenizer Disabled------------------") else() @@ -245,5 +244,7 @@ foreach(DLL_FILE ${onnxruntime_libs}) ) endforeach() +include(cmake/package.cmake) + # Have visual studio put all files into one single folder vs the default split of header files into a separate folder source_group(TREE ${GENERATORS_ROOT} FILES ${generator_srcs}) diff --git a/cmake/package.cmake b/cmake/package.cmake new file mode 100644 index 000000000..c71fe61d3 --- /dev/null +++ b/cmake/package.cmake @@ -0,0 +1,10 @@ +set_target_properties( + onnxruntime-genai PROPERTIES PUBLIC_HEADER + "${CMAKE_SOURCE_DIR}/src/ort_genai_c.h;${CMAKE_SOURCE_DIR}/src/ort_genai.h" +) +install(TARGETS + onnxruntime-genai onnxruntime-genai-static + ARCHIVE + LIBRARY + PUBLIC_HEADER +) \ No newline at end of file diff --git a/src/tokenizer/CMakeLists.txt b/src/tokenizer/CMakeLists.txt index 69d603715..135dedce6 100644 --- a/src/tokenizer/CMakeLists.txt +++ b/src/tokenizer/CMakeLists.txt @@ -8,11 +8,10 @@ file(GLOB tokenizer_srcs CONFIGURE_DEPENDS ) FetchContent_Declare(GSL URL https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip) -FetchContent_MakeAvailable(GSL) +onnxruntime_fetchcontent_makeavailable(GSL) FetchContent_Declare(simdjson URL https://github.com/simdjson/simdjson/archive/refs/tags/v3.6.3.zip URL_HASH SHA1=2b063a2e81f74a5d1cb937fadf3d2fca0f1edb09) -FetchContent_MakeAvailable(simdjson) - +onnxruntime_fetchcontent_makeavailable(simdjson) add_library(tokenizer STATIC ${tokenizer_srcs}) message(STATUS "GSL_SOURCE_DIR: ${GSL_SOURCE_DIR}") From ea52206f46dae9a7ecc4d656330f08f36ab6f56c Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Sun, 28 Apr 2024 15:34:52 -0700 Subject: [PATCH 02/27] ort_genai.h --- .pipelines/nuget-publishing.yml | 7 +-- .pipelines/pypl-publishing.yml | 7 +-- .../stages/jobs/nuget-packaging-job.yml | 7 +-- .pipelines/stages/jobs/py-packaging-job.yml | 6 +-- .../steps/nuget-ado-feed-releasing-step.yml | 43 ------------------- .../stages/jobs/steps/nuget-win-step.yml | 2 +- .../jobs/steps/py-ado-feed-releasing-step.yml | 10 ----- .../stages/jobs/steps/utils/capi-archive.yml | 1 + .pipelines/stages/nuget-packaging-stage.yml | 11 +++-- .pipelines/stages/py-packaging-stage.yml | 11 +++-- cmake/package.cmake | 27 ++++++++++-- 11 files changed, 41 insertions(+), 91 deletions(-) delete mode 100644 .pipelines/stages/jobs/steps/nuget-ado-feed-releasing-step.yml delete mode 100644 .pipelines/stages/jobs/steps/py-ado-feed-releasing-step.yml diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index b6fff7111..e2c163430 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -33,11 +33,6 @@ parameters: - '12.2' default: '11.8' -- name: publish_to_ado_feed - displayName: 'Publish to Azure DevOps Feed' - type: boolean - default: false - resources: repositories: - repository: manylinux @@ -56,4 +51,4 @@ stages: enable_linux_cuda: ${{ parameters.enable_linux_cuda }} ort_version: ${{ parameters.ort_version }} cuda_version: ${{ parameters.cuda_version }} - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} \ No newline at end of file + \ No newline at end of file diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index 1069ede44..d1b952220 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -32,11 +32,6 @@ parameters: - '11.8' - '12.2' -- name: publish_to_ado_feed - displayName: 'Whether to publish the packages to ADO feed.' - type: boolean - default: false - resources: repositories: - repository: manylinux @@ -55,4 +50,4 @@ stages: enable_win_cuda: ${{ parameters.enable_win_cuda }} ort_version: ${{ parameters.ort_version }} cuda_version: ${{ parameters.cuda_version }} - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} + diff --git a/.pipelines/stages/jobs/nuget-packaging-job.yml b/.pipelines/stages/jobs/nuget-packaging-job.yml index f790215b7..0b58ae02d 100644 --- a/.pipelines/stages/jobs/nuget-packaging-job.yml +++ b/.pipelines/stages/jobs/nuget-packaging-job.yml @@ -13,8 +13,6 @@ parameters: values: - 'linux' - 'win' -- name: publish_to_ado_feed - type: boolean jobs: - job: nuget_${{ parameters.os }}_${{ parameters.ep }}_${{ parameters.arch }}_packaging @@ -55,7 +53,8 @@ jobs: ${{ if eq(parameters.ep, 'cuda') }}: value: '.Cuda' - name: ortHome - value: 'ort' + value: 'ort' + workspace: clean: all steps: @@ -70,8 +69,6 @@ jobs: parameters: target: 'onnxruntime-genai' - template: steps/nuget-win-step.yml - - ${{ if eq(parameters.publish_to_ado_feed, true)}}: - - template: steps/nuget-ado-feed-releasing-step.yml - template: steps/compliant-and-cleanup-step.yml diff --git a/.pipelines/stages/jobs/py-packaging-job.yml b/.pipelines/stages/jobs/py-packaging-job.yml index 7066b070e..f7b790dac 100644 --- a/.pipelines/stages/jobs/py-packaging-job.yml +++ b/.pipelines/stages/jobs/py-packaging-job.yml @@ -13,8 +13,7 @@ parameters: values: - 'linux' - 'win' -- name: publish_to_ado_feed - type: boolean + jobs: - job: python_${{ parameters.os }}_${{ parameters.ep }}_${{ parameters.arch }}_packaging @@ -98,8 +97,5 @@ jobs: parameters: target: 'python' - - ${{ if eq(parameters.publish_to_ado_feed, true)}}: - - template: steps/py-ado-feed-releasing-step.yml - - template: steps/compliant-and-cleanup-step.yml diff --git a/.pipelines/stages/jobs/steps/nuget-ado-feed-releasing-step.yml b/.pipelines/stages/jobs/steps/nuget-ado-feed-releasing-step.yml deleted file mode 100644 index 331a9ea7c..000000000 --- a/.pipelines/stages/jobs/steps/nuget-ado-feed-releasing-step.yml +++ /dev/null @@ -1,43 +0,0 @@ -steps: -- task: NuGetToolInstaller@1 - inputs: - versionSpec: 6.8.x - -- powershell: | - New-Item -Path $(Agent.TempDirectory) -Name "binfiles" -ItemType "directory" - $base_path_name = Join-Path -Path $(Agent.TempDirectory) -ChildPath "binfiles" - Get-ChildItem $(GDN_CODESIGN_TARGETDIRECTORY) -Filter *.nupkg | - Foreach-Object { - $dir_name = Join-Path -Path $base_path_name -ChildPath $_.Basename - $cmd = "7z.exe x $($_.FullName) -y -o$dir_name" - Write-Output $cmd - Invoke-Expression -Command $cmd - } - dir $(Agent.TempDirectory) - tree $(Agent.TempDirectory) - workingDirectory: '$(Agent.TempDirectory)' - -- task: CodeSign@1 - displayName: 'Run Codesign Validation' - -- task: PublishSecurityAnalysisLogs@3 - displayName: 'Publish Security Analysis Logs' - continueOnError: true - -- task: PostAnalysis@2 - inputs: - GdnBreakAllTools: true - GdnBreakPolicy: M365 - GdnBreakPolicyMinSev: Error - -- template: utils/get-nuget-package-version-as-variable.yml - parameters: - packageFolder: '$(GDN_CODESIGN_TARGETDIRECTORY)' -#This task must be run on a Windows machine -- task: NuGetCommand@2 - displayName: 'NuGet push to Azure DevOps Feed' - inputs: - command: push - packagesToPush: '$(GDN_CODESIGN_TARGETDIRECTORY)/*.nupkg' - publishVstsFeed: 'PublicPackages/onnxruntime-genai' - allowPackageConflicts: true \ No newline at end of file diff --git a/.pipelines/stages/jobs/steps/nuget-win-step.yml b/.pipelines/stages/jobs/steps/nuget-win-step.yml index b5acf6a5a..546ca95f4 100644 --- a/.pipelines/stages/jobs/steps/nuget-win-step.yml +++ b/.pipelines/stages/jobs/steps/nuget-win-step.yml @@ -16,7 +16,7 @@ steps: DisplayName: 'ESRP - Sign C# dlls' Pattern: '*OnnxRuntimeGenAI*.dll' - powershell: | - $VERSION = '0.1.0-rc4' + $VERSION = '0.2.0-rc4' nuget.exe pack Microsoft.ML.OnnxRuntimeGenAI.nuspec ` -Prop version=$VERSION ` -Prop genai_nuget_ext=$(genai_nuget_ext) ` diff --git a/.pipelines/stages/jobs/steps/py-ado-feed-releasing-step.yml b/.pipelines/stages/jobs/steps/py-ado-feed-releasing-step.yml deleted file mode 100644 index 85c0a7e3d..000000000 --- a/.pipelines/stages/jobs/steps/py-ado-feed-releasing-step.yml +++ /dev/null @@ -1,10 +0,0 @@ -steps: -- task: TwineAuthenticate@1 - inputs: - artifactFeed: PublicPackages/onnxruntime-genai -- script: 'python -m twine upload -r onnxruntime-genai --config-file $(PYPIRC_PATH) --non-interactive *.whl' - workingDirectory: '$(Build.ArtifactStagingDirectory)/wheel' - displayName: 'Uploading wheels to PublicPackages/onnxruntime-genai' - retryCountOnTaskFailure: 3 - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) \ No newline at end of file diff --git a/.pipelines/stages/jobs/steps/utils/capi-archive.yml b/.pipelines/stages/jobs/steps/utils/capi-archive.yml index 1395b31f7..6034d255c 100644 --- a/.pipelines/stages/jobs/steps/utils/capi-archive.yml +++ b/.pipelines/stages/jobs/steps/utils/capi-archive.yml @@ -39,6 +39,7 @@ steps: SourceFolder: '$(Build.Repository.LocalPath)/src' Contents: | ort_genai_c.h + ort_genai.h TargetFolder: '$(Build.ArtifactStagingDirectory)/$(artifactName)/include' - task: CopyFiles@2 diff --git a/.pipelines/stages/nuget-packaging-stage.yml b/.pipelines/stages/nuget-packaging-stage.yml index f962337ac..5af026fbc 100644 --- a/.pipelines/stages/nuget-packaging-stage.yml +++ b/.pipelines/stages/nuget-packaging-stage.yml @@ -12,8 +12,7 @@ parameters: - name: cuda_version type: string default: '' -- name: publish_to_ado_feed - type: boolean + stages: - stage: nuget_packaging @@ -25,7 +24,7 @@ stages: ep: 'cpu' 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 parameters: @@ -34,7 +33,7 @@ stages: ep: 'cuda' ort_version: ${{ parameters.ort_version }} os: 'win' - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} + - ${{ if eq(parameters.enable_linux_cpu, true) }}: - template: jobs/nuget-packaging-job.yml parameters: @@ -42,7 +41,7 @@ stages: ep: 'cpu' ort_version: ${{ parameters.ort_version }} os: 'linux' - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} + - ${{ if eq(parameters.enable_linux_cuda, true) }}: - template: jobs/nuget-packaging-job.yml parameters: @@ -51,4 +50,4 @@ stages: ep: 'cuda' ort_version: ${{ parameters.ort_version }} os: 'linux' - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} \ No newline at end of file + \ No newline at end of file diff --git a/.pipelines/stages/py-packaging-stage.yml b/.pipelines/stages/py-packaging-stage.yml index e23581f56..f613bfd9a 100644 --- a/.pipelines/stages/py-packaging-stage.yml +++ b/.pipelines/stages/py-packaging-stage.yml @@ -12,8 +12,7 @@ parameters: - name: cuda_version type: string default: '' -- name: publish_to_ado_feed - type: boolean + stages: - stage: python_packaging @@ -25,7 +24,7 @@ stages: ep: 'cpu' 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/py-packaging-job.yml parameters: @@ -34,7 +33,7 @@ stages: ep: 'cuda' ort_version: ${{ parameters.ort_version }} os: 'win' - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} + - ${{ if eq(parameters.enable_linux_cpu, true) }}: - template: jobs/py-packaging-job.yml @@ -43,7 +42,7 @@ stages: ep: 'cpu' ort_version: ${{ parameters.ort_version }} os: 'linux' - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} + - ${{ if eq(parameters.enable_linux_cuda, true) }}: - template: jobs/py-packaging-job.yml parameters: @@ -52,7 +51,7 @@ stages: ep: 'cuda' ort_version: ${{ parameters.ort_version }} os: 'linux' - publish_to_ado_feed: ${{ parameters.publish_to_ado_feed }} + diff --git a/cmake/package.cmake b/cmake/package.cmake index c71fe61d3..7b5d9fbe1 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -1,10 +1,31 @@ set_target_properties( onnxruntime-genai PROPERTIES PUBLIC_HEADER - "${CMAKE_SOURCE_DIR}/src/ort_genai_c.h;${CMAKE_SOURCE_DIR}/src/ort_genai.h" + "${PROJECT_SOURCE_DIR}/src/ort_genai_c.h;${PROJECT_SOURCE_DIR}/src/ort_genai.h" ) install(TARGETS - onnxruntime-genai onnxruntime-genai-static + onnxruntime-genai + onnxruntime-genai-static ARCHIVE LIBRARY PUBLIC_HEADER -) \ No newline at end of file +) +set(CPACK_PACKAGE_VENDOR "Microsoft") +set(CPACK_PACKAGE_NAME "onnxruntime-genai") +set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") +set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/microsoft/onnxruntime-genai") +set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/packages") +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${VERSION_INFO}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") +if (WIN32) + set(CPACK_GENERATOR "ZIP") +else () + set(CPACK_GENERATOR "TGZ") +endif () +set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY TRUE) +install(FILES + "${PROJECT_SOURCE_DIR}/README.md" + "${PROJECT_SOURCE_DIR}/ThirdPartyNotices.txt" + "${PROJECT_SOURCE_DIR}/SECURITY.md" + "${PROJECT_SOURCE_DIR}/LICENSE" + DESTINATION .) +include(CPack) \ No newline at end of file From 95f906710d26625d5cbfc8c7eeba4dcd4a8aed06 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Sun, 28 Apr 2024 15:54:39 -0700 Subject: [PATCH 03/27] revert ort_genai.h --- .pipelines/stages/jobs/steps/nuget-win-step.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/nuget-win-step.yml b/.pipelines/stages/jobs/steps/nuget-win-step.yml index 546ca95f4..b5acf6a5a 100644 --- a/.pipelines/stages/jobs/steps/nuget-win-step.yml +++ b/.pipelines/stages/jobs/steps/nuget-win-step.yml @@ -16,7 +16,7 @@ steps: DisplayName: 'ESRP - Sign C# dlls' Pattern: '*OnnxRuntimeGenAI*.dll' - powershell: | - $VERSION = '0.2.0-rc4' + $VERSION = '0.1.0-rc4' nuget.exe pack Microsoft.ML.OnnxRuntimeGenAI.nuspec ` -Prop version=$VERSION ` -Prop genai_nuget_ext=$(genai_nuget_ext) ` From d81209182a1f1a7fed5ecc71998c33eeda3b63d6 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Sun, 28 Apr 2024 15:57:14 -0700 Subject: [PATCH 04/27] revert ort_genai.h --- .pipelines/stages/jobs/steps/utils/capi-archive.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/capi-archive.yml b/.pipelines/stages/jobs/steps/utils/capi-archive.yml index 6034d255c..1395b31f7 100644 --- a/.pipelines/stages/jobs/steps/utils/capi-archive.yml +++ b/.pipelines/stages/jobs/steps/utils/capi-archive.yml @@ -39,7 +39,6 @@ steps: SourceFolder: '$(Build.Repository.LocalPath)/src' Contents: | ort_genai_c.h - ort_genai.h TargetFolder: '$(Build.ArtifactStagingDirectory)/$(artifactName)/include' - task: CopyFiles@2 From 64ce581b3422093d7e53da887bd04a8b9923c26c Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 29 Apr 2024 14:43:43 -0700 Subject: [PATCH 05/27] update build --- .pipelines/nuget-publishing.yml | 1 - .pipelines/pypl-publishing.yml | 1 - .../stages/jobs/nuget-packaging-job.yml | 15 ++-- .pipelines/stages/jobs/py-packaging-job.yml | 15 ++-- .../stages/jobs/steps/utils/capi-archive.yml | 2 +- .../stages/jobs/steps/utils/download-ort.yml | 78 ++++++------------- .pipelines/stages/nuget-packaging-stage.yml | 5 +- .pipelines/stages/py-packaging-stage.yml | 4 +- 8 files changed, 46 insertions(+), 75 deletions(-) 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) }}: From 75d0179541c9614eb79fa120b1809c60edb4b0d7 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 29 Apr 2024 14:45:53 -0700 Subject: [PATCH 06/27] update build --- .pipelines/nuget-publishing.yml | 5 ----- .pipelines/pypl-publishing.yml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index 79e318cda..52318e6b3 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -27,11 +27,6 @@ parameters: - name: ort_version displayName: 'OnnxRuntime version' type: string - default: '1.17.3' - -- name: ort_dml_version - displayName: 'OnnxRuntime DirectML version' - type: string default: '1.18.0-dev-20240423-0527-c07b8d545d' - name: cuda_version diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index 2020ec4ec..111cabffb 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -27,11 +27,6 @@ parameters: - name: ort_version displayName: 'OnnxRuntime version' type: string - default: '1.17.3' - -- name: ort_dml_version - displayName: 'OnnxRuntime DirectML version' - type: string default: '1.18.0-dev-20240423-0527-c07b8d545d' - name: cuda_version From a411b14fae138badc7e7e7692d50be6c4867cbc3 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 29 Apr 2024 15:16:40 -0700 Subject: [PATCH 07/27] update build --- .pipelines/stages/jobs/steps/capi-linux-step.yml | 13 ++++++++++++- .pipelines/stages/jobs/steps/capi-win-step.yml | 9 +++++---- cmake/package.cmake | 4 +--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.pipelines/stages/jobs/steps/capi-linux-step.yml b/.pipelines/stages/jobs/steps/capi-linux-step.yml index 2ff4d5c74..abc6cd038 100644 --- a/.pipelines/stages/jobs/steps/capi-linux-step.yml +++ b/.pipelines/stages/jobs/steps/capi-linux-step.yml @@ -58,6 +58,7 @@ steps: --target onnxruntime-genai" displayName: 'Build GenAi' workingDirectory: '$(Build.Repository.LocalPath)' + - task: BinSkim@4 displayName: 'Run BinSkim' inputs: @@ -66,12 +67,22 @@ steps: - template: utils/capi-archive.yml parameters: archiveType: tar + - script: | + set -e -x + docker run \ + --rm \ + --volume $(Build.Repository.LocalPath):/ort_genai_src \ + -w /ort_genai_src/ onnxruntime$(ep)build$(arch) \ + bash -c " \ + /usr/bin/cmake --build --preset linux_$(arch)_$(ep)_release --target package" + displayName: 'Package C/C++ API' + workingDirectory: '$(Build.Repository.LocalPath)' - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: ONNXRuntime Genai capi' inputs: ArtifactName: $(artifactName)-capi - PathtoPublish: '$(Build.ArtifactStagingDirectory)/capi' + PathtoPublish: '$(Build.Repository.LocalPath)/build/$(ep)/package' - ${{ if eq(parameters.target, 'python') }}: - bash: | diff --git a/.pipelines/stages/jobs/steps/capi-win-step.yml b/.pipelines/stages/jobs/steps/capi-win-step.yml index 8afafdb41..abfb665b5 100644 --- a/.pipelines/stages/jobs/steps/capi-win-step.yml +++ b/.pipelines/stages/jobs/steps/capi-win-step.yml @@ -83,15 +83,16 @@ steps: AnalyzeTargetGlob: '$(Build.Repository.LocalPath)\**\*genai.dll' continueOnError: true - - template: utils/capi-archive.yml - parameters: - archiveType: zip + - powershell: | + cmake --build --preset windows_$(arch)_$(ep)_release --target package + displayName: 'Package C/C++ API' + workingDirectory: '$(Build.Repository.LocalPath)' - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: ONNXRuntime Genai capi' inputs: ArtifactName: $(artifactName)-capi - PathtoPublish: '$(Build.ArtifactStagingDirectory)/capi' + PathtoPublish: '$(Build.Repository.LocalPath)\build\$(ep)\package' - ${{ if eq(parameters.target, 'python') }}: - task: BinSkim@4 diff --git a/cmake/package.cmake b/cmake/package.cmake index 7b5d9fbe1..9c9102689 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -4,8 +4,6 @@ set_target_properties( ) install(TARGETS onnxruntime-genai - onnxruntime-genai-static - ARCHIVE LIBRARY PUBLIC_HEADER ) @@ -14,7 +12,7 @@ set(CPACK_PACKAGE_NAME "onnxruntime-genai") set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md") set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/microsoft/onnxruntime-genai") -set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/packages") +set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/package") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${VERSION_INFO}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") if (WIN32) set(CPACK_GENERATOR "ZIP") From 07ae10ac5ecd7c69b29b00c08b8f314c871a3550 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 29 Apr 2024 15:41:49 -0700 Subject: [PATCH 08/27] update build --- .pipelines/nuget-publishing.yml | 10 ++- .pipelines/pypl-publishing.yml | 12 ++- .../jobs/steps/utils/download-ort-build.yml | 75 +++++++++++++++++++ .../stages/jobs/steps/utils/download-ort.yml | 1 + 4 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 .pipelines/stages/jobs/steps/utils/download-ort-build.yml diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index 52318e6b3..79f783d0d 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -44,7 +44,15 @@ resources: endpoint: Microsoft name: pypa/manylinux ref: 5eda9aded5462201e6310105728d33016e637ea7 - + pipelines: + - pipeline: ort_package + project: 'Lotus' + source: 'Zip-Nuget-Java-Nodejs Packaging Pipeline' + trigger: + branches: + include: + - main + branch: main trigger: none stages: - template: stages/nuget-packaging-stage.yml diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index 111cabffb..7d72d18ca 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -7,7 +7,7 @@ parameters: - name: enable_win_cuda displayName: 'Whether Windows CUDA package is built.' type: boolean - default : true + default: true - name: enable_win_dml displayName: 'Whether Windows DirectML package is built.' @@ -44,7 +44,15 @@ resources: endpoint: Microsoft name: pypa/manylinux ref: 5eda9aded5462201e6310105728d33016e637ea7 - + pipelines: + - pipeline: ort_package + project: 'Lotus' + source: 'Zip-Nuget-Java-Nodejs Packaging Pipeline' + trigger: + branches: + include: + - main + branch: main trigger: none stages: - template: stages/py-packaging-stage.yml diff --git a/.pipelines/stages/jobs/steps/utils/download-ort-build.yml b/.pipelines/stages/jobs/steps/utils/download-ort-build.yml new file mode 100644 index 000000000..fab837e83 --- /dev/null +++ b/.pipelines/stages/jobs/steps/utils/download-ort-build.yml @@ -0,0 +1,75 @@ +parameters: +- name: archiveType + type: string +- name: ep + type: string + default: cpu +- name: os + type: string + default: linux +- name: arch + type: string + default: x64 +steps: + + +- download: build + displayName: 'Download Pipeline Artifact from Zip-Nuget-Java-Nodejs Packaging Pipeline' + ${{ if eq(parameters.ep, 'directml') }}: + artifact: 'drop-nuget-dml' + ${{ elseif eq(parameters.ep, 'cuda') }}: + artifact: 'onnxruntime-${{ parameters.os}}-${{ parameters.ep}}-${{ parameters.arch}}-cuda' + ${{ else }}: + artifact: 'onnxruntime-${{ parameters.os}}-${{ parameters.ep}}-${{ parameters.arch}}' + +- ${{ if eq(parameters.ep, 'directml') }}: + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '$(Pipeline.Workspace)/ort_package/*/*.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' + flattenFolders: true +- ${{ elseif eq(parameters.os, 'win') }}: + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '$(Pipeline.Workspace)/ort_package/*/*.zip' + destinationFolder: '$(Build.Repository.LocalPath)/ort' + cleanDestinationFolder: false + overwriteExistingFiles: true + displayName: Unzip OnnxRuntime +- ${{ else }}: + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '$(Pipeline.Workspace)/ort_package/*/*.tgz' + destinationFolder: '$(Build.Repository.LocalPath)/ort' + cleanDestinationFolder: false + overwriteExistingFiles: true + displayName: Unzip OnnxRuntime + + +- task: DeleteFiles@1 + inputs: + SourceFolder: '$(Build.Repository.LocalPath)/ort/lib' + Contents: '*tensorrt*' + RemoveSourceFolder: false + displayName: 'Remove tensorrt from lib' + continueOnError: true + +- task: DeleteFiles@1 + inputs: + SourceFolder: '$(Build.Repository.LocalPath)/ort/lib' + Contents: '*.pdb' + RemoveSourceFolder: false + displayName: 'Remove .pdb files from lib' + continueOnError: true diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 5e108af4e..e4d6a8b7f 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -31,6 +31,7 @@ steps: SourceFolder: '$(Build.Repository.LocalPath)/ort/' Contents: '**/native/include/**' TargetFolder: '$(Build.Repository.LocalPath)/ort/include' + flattenFolders: true - task: DeleteFiles@1 inputs: From 26ee50bd070b3e30b69584f956a6b323dfd6162f Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 29 Apr 2024 15:48:25 -0700 Subject: [PATCH 09/27] arch: ${{ parameters.arch }} ep: ${{ parameters.ep }} --- .pipelines/stages/jobs/nuget-packaging-job.yml | 5 +++++ .pipelines/stages/jobs/py-packaging-job.yml | 3 +++ .../stages/jobs/steps/capi-linux-step.yml | 17 +++++++++++++++-- .pipelines/stages/jobs/steps/capi-win-step.yml | 14 ++++++++++++-- .../jobs/steps/utils/download-ort-build.yml | 4 +--- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.pipelines/stages/jobs/nuget-packaging-job.yml b/.pipelines/stages/jobs/nuget-packaging-job.yml index 3a6e4d72a..5f2a4c8e9 100644 --- a/.pipelines/stages/jobs/nuget-packaging-job.yml +++ b/.pipelines/stages/jobs/nuget-packaging-job.yml @@ -85,12 +85,17 @@ jobs: - template: steps/capi-linux-step.yml parameters: target: 'onnxruntime-genai' + arch: ${{ parameters.arch }} + ep: ${{ parameters.ep }} + # TODO: Add a step to build the linux nuget package - ${{ if eq(parameters.os, 'win') }}: - template: steps/capi-win-step.yml parameters: target: 'onnxruntime-genai' + arch: ${{ parameters.arch }} + ep: ${{ parameters.ep }} - template: steps/nuget-win-step.yml - template: steps/compliant-and-cleanup-step.yml diff --git a/.pipelines/stages/jobs/py-packaging-job.yml b/.pipelines/stages/jobs/py-packaging-job.yml index b6b3ee199..f5a183289 100644 --- a/.pipelines/stages/jobs/py-packaging-job.yml +++ b/.pipelines/stages/jobs/py-packaging-job.yml @@ -109,12 +109,15 @@ jobs: - template: steps/capi-linux-step.yml parameters: target: 'python' + arch: ${{ parameters.arch }} + ep: ${{ parameters.ep }} # Windows job needs to set the python version and install the required packages - ${{ if eq(parameters.os, 'win') }}: - template: steps/capi-win-step.yml parameters: target: 'python' + arch: ${{ parameters.arch }} ep: ${{ parameters.ep }} - template: steps/compliant-and-cleanup-step.yml diff --git a/.pipelines/stages/jobs/steps/capi-linux-step.yml b/.pipelines/stages/jobs/steps/capi-linux-step.yml index abc6cd038..a8133a623 100644 --- a/.pipelines/stages/jobs/steps/capi-linux-step.yml +++ b/.pipelines/stages/jobs/steps/capi-linux-step.yml @@ -1,6 +1,12 @@ parameters: - name: target type: string +- name: ep + type: string + default: 'cpu' +- name: arch + type: string + default: 'x64' steps: - checkout: self @@ -26,9 +32,16 @@ steps: echo "arch=$(arch)" echo "ep=$(ep)" displayName: 'Print Parameters' -- template: utils/download-ort.yml + +- template: utils/download-ort-build.yml parameters: - archiveType: 'tgz' + ep: ${{ parameters.ep }} + arch: ${{ parameters.arch }} + os: 'linux' + +#- template: utils/download-ort.yml +# parameters: +# archiveType: 'tgz' - bash: | set -e -x diff --git a/.pipelines/stages/jobs/steps/capi-win-step.yml b/.pipelines/stages/jobs/steps/capi-win-step.yml index abfb665b5..698960d61 100644 --- a/.pipelines/stages/jobs/steps/capi-win-step.yml +++ b/.pipelines/stages/jobs/steps/capi-win-step.yml @@ -5,6 +5,9 @@ parameters: - name: ep type: string default: 'cpu' +- name: arch + type: string + default: 'x64' steps: - bash: | echo "##[error]Error: ep and arch are not set" @@ -31,10 +34,17 @@ steps: echo "cuda_version=$(cuda_version)" echo "target=${{ parameters.target }}" displayName: 'Print Parameters' -- template: utils/download-ort.yml + +- template: utils/download-ort-build.yml parameters: - archiveType: 'zip' ep: ${{ parameters.ep }} + arch: ${{ parameters.arch }} + os: 'win' + +#- template: utils/download-ort.yml +# parameters: +# archiveType: 'zip' +# ep: ${{ parameters.ep }} - ${{ if eq(parameters.ep, 'directml') }}: - powershell: | diff --git a/.pipelines/stages/jobs/steps/utils/download-ort-build.yml b/.pipelines/stages/jobs/steps/utils/download-ort-build.yml index fab837e83..1f5e91b23 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort-build.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort-build.yml @@ -1,6 +1,4 @@ parameters: -- name: archiveType - type: string - name: ep type: string default: cpu @@ -13,7 +11,7 @@ parameters: steps: -- download: build +- download: ort_package displayName: 'Download Pipeline Artifact from Zip-Nuget-Java-Nodejs Packaging Pipeline' ${{ if eq(parameters.ep, 'directml') }}: artifact: 'drop-nuget-dml' From 8c6dabf0d6b584ae83e062b7723591af1991de80 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 30 Apr 2024 09:55:45 -0700 Subject: [PATCH 10/27] Nuget --- .../stages/jobs/steps/capi-linux-step.yml | 16 ++++++------ .../stages/jobs/steps/capi-win-step.yml | 16 ++++++------ .../stages/jobs/steps/utils/download-ort.yml | 26 ++++++++++++++----- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/.pipelines/stages/jobs/steps/capi-linux-step.yml b/.pipelines/stages/jobs/steps/capi-linux-step.yml index a8133a623..e3a715637 100644 --- a/.pipelines/stages/jobs/steps/capi-linux-step.yml +++ b/.pipelines/stages/jobs/steps/capi-linux-step.yml @@ -33,15 +33,15 @@ steps: echo "ep=$(ep)" displayName: 'Print Parameters' -- template: utils/download-ort-build.yml - parameters: - ep: ${{ parameters.ep }} - arch: ${{ parameters.arch }} - os: 'linux' - -#- template: utils/download-ort.yml +#- template: utils/download-ort-build.yml # parameters: -# archiveType: 'tgz' +# ep: ${{ parameters.ep }} +# arch: ${{ parameters.arch }} +# os: 'linux' + +- template: utils/download-ort.yml + parameters: + archiveType: 'tgz' - bash: | set -e -x diff --git a/.pipelines/stages/jobs/steps/capi-win-step.yml b/.pipelines/stages/jobs/steps/capi-win-step.yml index 698960d61..7581c1fdd 100644 --- a/.pipelines/stages/jobs/steps/capi-win-step.yml +++ b/.pipelines/stages/jobs/steps/capi-win-step.yml @@ -35,16 +35,16 @@ steps: echo "target=${{ parameters.target }}" displayName: 'Print Parameters' -- template: utils/download-ort-build.yml - parameters: - ep: ${{ parameters.ep }} - arch: ${{ parameters.arch }} - os: 'win' - -#- template: utils/download-ort.yml +#- template: utils/download-ort-build.yml # parameters: -# archiveType: 'zip' # ep: ${{ parameters.ep }} +# arch: ${{ parameters.arch }} +# os: 'win' + +- template: utils/download-ort.yml + parameters: + archiveType: 'zip' + ep: ${{ parameters.ep }} - ${{ if eq(parameters.ep, 'directml') }}: - powershell: | diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index e4d6a8b7f..b747f4d0e 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -15,13 +15,25 @@ steps: 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 +- $ {{ if eq(parameters.os, 'win') }}: + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '$(Build.Repository.LocalPath)/*.nupkg' + destinationFolder: '$(Build.Repository.LocalPath)/ort' + cleanDestinationFolder: false + overwriteExistingFiles: true + displayName: Unzip OnnxRuntime +- ${{ else }}: + - script: | + mv $(Build.Repository.LocalPath)/$(ort_filename).nupkg $(Build.Repository.LocalPath)/$(ort_filename).tgz + displayName: Rename OnnxRuntime nuget package to tgz + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '$(Build.Repository.LocalPath)/$(ort_filename).tgz' + 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' From a455b8062e94f2c03c8741f744ae8d1754ca1a9d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 30 Apr 2024 09:56:39 -0700 Subject: [PATCH 11/27] ${{ --- .pipelines/stages/jobs/steps/utils/download-ort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index b747f4d0e..064d3d639 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -15,7 +15,7 @@ steps: extract: false downloadPath: '$(Build.Repository.LocalPath)' displayName: Download Onnxruntime file -- $ {{ if eq(parameters.os, 'win') }}: +- ${{ if eq(parameters.os, 'win') }}: - task: ExtractFiles@1 inputs: archiveFilePatterns: '$(Build.Repository.LocalPath)/*.nupkg' From 1ce3d63ae8d9deb8571cc34777c8fdd420359f53 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 30 Apr 2024 09:57:43 -0700 Subject: [PATCH 12/27] archiveType --- .pipelines/stages/jobs/steps/utils/download-ort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 064d3d639..20fad8ea4 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -15,7 +15,7 @@ steps: extract: false downloadPath: '$(Build.Repository.LocalPath)' displayName: Download Onnxruntime file -- ${{ if eq(parameters.os, 'win') }}: +- ${{ if eq(parameters.archiveType, 'zip') }}: - task: ExtractFiles@1 inputs: archiveFilePatterns: '$(Build.Repository.LocalPath)/*.nupkg' From 7d3687114a53b2c92ee4a685a1d106107f14fb21 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 2 May 2024 12:11:26 -0700 Subject: [PATCH 13/27] try zip instead of tgz --- .pipelines/stages/jobs/steps/utils/download-ort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 20fad8ea4..367377d01 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -25,7 +25,7 @@ steps: displayName: Unzip OnnxRuntime - ${{ else }}: - script: | - mv $(Build.Repository.LocalPath)/$(ort_filename).nupkg $(Build.Repository.LocalPath)/$(ort_filename).tgz + mv $(Build.Repository.LocalPath)/$(ort_filename).nupkg $(Build.Repository.LocalPath)/$(ort_filename).zip displayName: Rename OnnxRuntime nuget package to tgz - task: ExtractFiles@1 inputs: From cf6ab4bd523c7160aa124976f139238c0462efb1 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 2 May 2024 12:12:44 -0700 Subject: [PATCH 14/27] try zip instead of tgz --- .pipelines/stages/jobs/steps/utils/download-ort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 367377d01..4cc19238e 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -29,7 +29,7 @@ steps: displayName: Rename OnnxRuntime nuget package to tgz - task: ExtractFiles@1 inputs: - archiveFilePatterns: '$(Build.Repository.LocalPath)/$(ort_filename).tgz' + archiveFilePatterns: '$(Build.Repository.LocalPath)/$(ort_filename).zip' destinationFolder: '$(Build.Repository.LocalPath)/ort' cleanDestinationFolder: false overwriteExistingFiles: true From 1fb0d6c7f6583ca7670a9663ea8fd7692fbbd890 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 2 May 2024 12:12:57 -0700 Subject: [PATCH 15/27] try zip instead of tgz --- .pipelines/stages/jobs/steps/utils/download-ort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 4cc19238e..3bcc6e384 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -26,7 +26,7 @@ steps: - ${{ else }}: - script: | mv $(Build.Repository.LocalPath)/$(ort_filename).nupkg $(Build.Repository.LocalPath)/$(ort_filename).zip - displayName: Rename OnnxRuntime nuget package to tgz + displayName: Rename OnnxRuntime nuget package to zip - task: ExtractFiles@1 inputs: archiveFilePatterns: '$(Build.Repository.LocalPath)/$(ort_filename).zip' From 65528e1bb1595f46cb6c644db05e2a4ef1f219db Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 2 May 2024 12:31:53 -0700 Subject: [PATCH 16/27] Gcc --- .pipelines/stages/jobs/steps/capi-linux-step.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/capi-linux-step.yml b/.pipelines/stages/jobs/steps/capi-linux-step.yml index e3a715637..56cc036ee 100644 --- a/.pipelines/stages/jobs/steps/capi-linux-step.yml +++ b/.pipelines/stages/jobs/steps/capi-linux-step.yml @@ -87,7 +87,7 @@ steps: --volume $(Build.Repository.LocalPath):/ort_genai_src \ -w /ort_genai_src/ onnxruntime$(ep)build$(arch) \ bash -c " \ - /usr/bin/cmake --build --preset linux_$(arch)_$(ep)_release --target package" + /usr/bin/cmake --build --preset linux_gcc_$(ep)_release --target package" displayName: 'Package C/C++ API' workingDirectory: '$(Build.Repository.LocalPath)' From e8355c26319d5b902cfc2e0fa7f6fcace3370847 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 2 May 2024 15:11:36 -0700 Subject: [PATCH 17/27] codeql --- nuget.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget.config b/nuget.config index 63a200340..f3853aee6 100644 --- a/nuget.config +++ b/nuget.config @@ -10,7 +10,7 @@ - + \ No newline at end of file From fd677d071c7f34add96cd5134cfcb29126a08c5a Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 10:56:49 -0700 Subject: [PATCH 18/27] latest --- .pipelines/nuget-publishing.yml | 2 +- .pipelines/pypl-publishing.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index 79f783d0d..95854d5d2 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -27,7 +27,7 @@ parameters: - name: ort_version displayName: 'OnnxRuntime version' type: string - default: '1.18.0-dev-20240423-0527-c07b8d545d' + default: 'latest' - name: cuda_version displayName: 'CUDA version' diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index 7d72d18ca..66d521968 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -27,7 +27,7 @@ parameters: - name: ort_version displayName: 'OnnxRuntime version' type: string - default: '1.18.0-dev-20240423-0527-c07b8d545d' + default: 'latest' - name: cuda_version displayName: 'CUDA version' From d0bc45edc9ee1eb8f3c76a96f6282cd069cca263 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 12:58:17 -0700 Subject: [PATCH 19/27] # TODO: Find out why do we need to to have libonnxruntime.so.$ort_version --- .github/workflows/linux-cpu-x64-build.yml | 2 +- .github/workflows/linux-gpu-x64-build.yml | 2 +- .github/workflows/mac-cpu-arm64-build.yml | 2 +- .github/workflows/win-cpu-x64-build.yml | 2 +- .github/workflows/win-cuda-x64-build.yml | 2 +- .pipelines/stages/jobs/steps/utils/download-ort.yml | 8 ++++++++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux-cpu-x64-build.yml b/.github/workflows/linux-cpu-x64-build.yml index 290695c9c..08305e36a 100644 --- a/.github/workflows/linux-cpu-x64-build.yml +++ b/.github/workflows/linux-cpu-x64-build.yml @@ -58,7 +58,7 @@ jobs: continue-on-error: true # TODO: Find out why do we need to to have libonnxruntime.so.$ort_version - - name: Extra OnnxRuntime library and header files + - name: Extract OnnxRuntime library and header files run: | mkdir -p ort/lib mv ${{ env.ORT_PACKAGE_NAME }}/build/native/include ort/ diff --git a/.github/workflows/linux-gpu-x64-build.yml b/.github/workflows/linux-gpu-x64-build.yml index f6cdf0f37..219b62007 100644 --- a/.github/workflows/linux-gpu-x64-build.yml +++ b/.github/workflows/linux-gpu-x64-build.yml @@ -72,7 +72,7 @@ jobs: continue-on-error: true # TODO: Find out why do we need to to have libonnxruntime.so.$ort_version - - name: Extra OnnxRuntime library and header files + - name: Extract OnnxRuntime library and header files run: | mkdir -p ort/lib mv ${{ env.ORT_PACKAGE_NAME }}/buildTransitive/native/include ort/ diff --git a/.github/workflows/mac-cpu-arm64-build.yml b/.github/workflows/mac-cpu-arm64-build.yml index f2f90e427..9f861a96d 100644 --- a/.github/workflows/mac-cpu-arm64-build.yml +++ b/.github/workflows/mac-cpu-arm64-build.yml @@ -30,7 +30,7 @@ jobs: run: | nuget install ${{ env.ORT_PACKAGE_NAME }} -version ${{ env.ORT_NIGHTLY_VERSION }} -x - - name: Extra OnnxRuntime library and header files + - name: Extract OnnxRuntime library and header files run: | mkdir -p ort/lib mv ${{ env.ORT_PACKAGE_NAME }}/build/native/include ort/ diff --git a/.github/workflows/win-cpu-x64-build.yml b/.github/workflows/win-cpu-x64-build.yml index cf5614dee..855025fb2 100644 --- a/.github/workflows/win-cpu-x64-build.yml +++ b/.github/workflows/win-cpu-x64-build.yml @@ -53,7 +53,7 @@ jobs: - run: Get-ChildItem ${{ env.ORT_PACKAGE_NAME }} -Recurse continue-on-error: true - - name: Extra OnnxRuntime library and header files + - name: Extract OnnxRuntime library and header files run: | mkdir ort/lib move ${{ env.ORT_PACKAGE_NAME }}/build/native/include ort/ diff --git a/.github/workflows/win-cuda-x64-build.yml b/.github/workflows/win-cuda-x64-build.yml index ccc2f71fe..154850c96 100644 --- a/.github/workflows/win-cuda-x64-build.yml +++ b/.github/workflows/win-cuda-x64-build.yml @@ -60,7 +60,7 @@ jobs: - run: Get-ChildItem ${{ env.ORT_PACKAGE_NAME }} -Recurse continue-on-error: true - - name: Extra OnnxRuntime library and header files + - name: Extract OnnxRuntime library and header files run: | mkdir ort/lib move ${{ env.ORT_PACKAGE_NAME }}/buildTransitive/native/include ort/ diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 3bcc6e384..3b28f8280 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -38,6 +38,14 @@ steps: inputs: SourceFolder: '$(Build.Repository.LocalPath)/ort/runtimes/$(os)-$(arch)/native' TargetFolder: '$(Build.Repository.LocalPath)/ort/lib' + +# TODO: Find out why do we need to to have libonnxruntime.so.ort_stable_version +- script: | + ort_stable_version=$(echo $(ort_version) | cut -d- -f1) + cp libonnxruntime.so libonnxruntime.so.ort_stable_version + displayName: Copy libonnxruntime.so to libonnxruntime.so. + workingDirectory: '$(Build.Repository.LocalPath)/ort/lib' + - task: CopyFiles@2 inputs: SourceFolder: '$(Build.Repository.LocalPath)/ort/' From 38156a67f54a358c24017a6116f9ebebd6f5ca3c Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 13:14:55 -0700 Subject: [PATCH 20/27] # TODO: Find out why do we need to to have libonnxruntime.so.$ort_version --- .pipelines/stages/jobs/steps/utils/download-ort.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 3b28f8280..1a5e432c2 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -41,8 +41,10 @@ steps: # TODO: Find out why do we need to to have libonnxruntime.so.ort_stable_version - script: | + set -e -x ort_stable_version=$(echo $(ort_version) | cut -d- -f1) - cp libonnxruntime.so libonnxruntime.so.ort_stable_version + echo $ort_stable_version + cp libonnxruntime.so libonnxruntime.so.$ort_stable_version displayName: Copy libonnxruntime.so to libonnxruntime.so. workingDirectory: '$(Build.Repository.LocalPath)/ort/lib' From 3823a06065afb71f9b4bd1c66b3cf242aebbaa0b Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 13:50:01 -0700 Subject: [PATCH 21/27] default: '1.18.0-dev-20240426-1256-b842effa29' - name: ort_cuda_version displayName: 'OnnxRuntime GPU version' type: string default: '1.18.0-dev-20240426-0614-b842effa29' - name: ort_dml_version displayName: 'OnnxRuntime DML version' type: string default: '1.18.0-dev-20240426-0116-b842effa29' --- .pipelines/nuget-publishing.yml | 12 +++++++++++- .pipelines/pypl-publishing.yml | 12 +++++++++++- .pipelines/stages/nuget-packaging-stage.yml | 10 +++++++--- .pipelines/stages/py-packaging-stage.yml | 10 +++++++--- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index 95854d5d2..4c7ed5e35 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -27,7 +27,17 @@ parameters: - name: ort_version displayName: 'OnnxRuntime version' type: string - default: 'latest' + default: '1.18.0-dev-20240426-1256-b842effa29' + +- name: ort_cuda_version + displayName: 'OnnxRuntime GPU version' + type: string + default: '1.18.0-dev-20240426-0614-b842effa29' + +- name: ort_dml_version + displayName: 'OnnxRuntime DML version' + type: string + default: '1.18.0-dev-20240426-0116-b842effa29' - name: cuda_version displayName: 'CUDA version' diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index 66d521968..af050a11a 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -27,7 +27,17 @@ parameters: - name: ort_version displayName: 'OnnxRuntime version' type: string - default: 'latest' + default: '1.18.0-dev-20240426-1256-b842effa29' + +- name: ort_cuda_version + displayName: 'OnnxRuntime GPU version' + type: string + default: '1.18.0-dev-20240426-0614-b842effa29' + +- name: ort_dml_version + displayName: 'OnnxRuntime DML version' + type: string + default: '1.18.0-dev-20240426-0116-b842effa29' - name: cuda_version displayName: 'CUDA version' diff --git a/.pipelines/stages/nuget-packaging-stage.yml b/.pipelines/stages/nuget-packaging-stage.yml index 7e8a41e43..37709022e 100644 --- a/.pipelines/stages/nuget-packaging-stage.yml +++ b/.pipelines/stages/nuget-packaging-stage.yml @@ -11,6 +11,10 @@ parameters: type: boolean - name: ort_version type: string +- name: ort_cuda_version + type: string +- name: ort_dml_version + type: string - name: cuda_version type: string default: '' @@ -32,7 +36,7 @@ stages: parameters: arch: 'x64' ep: 'directml' - ort_version: ${{ parameters.ort_version }} + ort_version: ${{ parameters.ort_dml_version }} os: 'win' - ${{ if eq(parameters.enable_win_cuda, true) }}: @@ -41,7 +45,7 @@ stages: arch: 'x64' cuda_version: ${{ parameters.cuda_version }} ep: 'cuda' - ort_version: ${{ parameters.ort_version }} + ort_version: ${{ parameters.ort_cuda_version }} os: 'win' - ${{ if eq(parameters.enable_linux_cpu, true) }}: @@ -58,5 +62,5 @@ stages: arch: 'x64' cuda_version: ${{ parameters.cuda_version }} ep: 'cuda' - ort_version: ${{ parameters.ort_version }} + ort_version: ${{ parameters.ort_cuda_version }} os: 'linux' diff --git a/.pipelines/stages/py-packaging-stage.yml b/.pipelines/stages/py-packaging-stage.yml index 9b40414f2..d2e220d5a 100644 --- a/.pipelines/stages/py-packaging-stage.yml +++ b/.pipelines/stages/py-packaging-stage.yml @@ -11,6 +11,10 @@ parameters: type: boolean - name: ort_version type: string +- name: ort_cuda_version + type: string +- name: ort_dml_version + type: string - name: cuda_version type: string default: '' @@ -32,7 +36,7 @@ stages: parameters: arch: 'x64' ep: 'directml' - ort_version: ${{ parameters.ort_version }} + ort_version: ${{ parameters.ort_dml_version }} os: 'win' - ${{ if eq(parameters.enable_win_cuda, true) }}: @@ -41,7 +45,7 @@ stages: arch: 'x64' cuda_version: ${{ parameters.cuda_version }} ep: 'cuda' - ort_version: ${{ parameters.ort_version }} + ort_version: ${{ parameters.ort_cuda_version }} os: 'win' @@ -59,7 +63,7 @@ stages: arch: 'x64' cuda_version: ${{ parameters.cuda_version }} ep: 'cuda' - ort_version: ${{ parameters.ort_version }} + ort_version: ${{ parameters.ort_cuda_version }} os: 'linux' From 80473fd84bb52b5ddefc1fd56b255373c5c5e581 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 13:51:25 -0700 Subject: [PATCH 22/27] ort_cuda_version: ${{ parameters.ort_cuda_version }} ort_dml_version: ${{ parameters.ort_dml_version }} --- .pipelines/nuget-publishing.yml | 2 ++ .pipelines/pypl-publishing.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index 4c7ed5e35..1e9dcaf68 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -73,4 +73,6 @@ stages: enable_linux_cuda: ${{ parameters.enable_linux_cuda }} enable_win_dml: ${{ parameters.enable_win_dml }} ort_version: ${{ parameters.ort_version }} + ort_cuda_version: ${{ parameters.ort_cuda_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 af050a11a..7d1e51b00 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -73,5 +73,7 @@ stages: enable_win_cuda: ${{ parameters.enable_win_cuda }} enable_win_dml: ${{ parameters.enable_win_dml }} ort_version: ${{ parameters.ort_version }} + ort_cuda_version: ${{ parameters.ort_cuda_version }} + ort_dml_version: ${{ parameters.ort_dml_version }} cuda_version: ${{ parameters.cuda_version }} From 5185faf48412d116995347da7aa9617f67560172 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 14:50:24 -0700 Subject: [PATCH 23/27] - task: CopyFiles@2 inputs: SourceFolder: '$(Build.Repository.LocalPath)/ort/runtimes/$(os)-$(arch)/native' TargetFolder: '$(Build.Repository.LocalPath)/ort/lib' --- .../stages/jobs/steps/utils/download-ort.yml | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.pipelines/stages/jobs/steps/utils/download-ort.yml b/.pipelines/stages/jobs/steps/utils/download-ort.yml index 1a5e432c2..fd393c62f 100644 --- a/.pipelines/stages/jobs/steps/utils/download-ort.yml +++ b/.pipelines/stages/jobs/steps/utils/download-ort.yml @@ -23,6 +23,10 @@ steps: 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' - ${{ else }}: - script: | mv $(Build.Repository.LocalPath)/$(ort_filename).nupkg $(Build.Repository.LocalPath)/$(ort_filename).zip @@ -34,19 +38,18 @@ steps: 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' - -# TODO: Find out why do we need to to have libonnxruntime.so.ort_stable_version -- script: | - set -e -x - ort_stable_version=$(echo $(ort_version) | cut -d- -f1) - echo $ort_stable_version - cp libonnxruntime.so libonnxruntime.so.$ort_stable_version - displayName: Copy libonnxruntime.so to libonnxruntime.so. - workingDirectory: '$(Build.Repository.LocalPath)/ort/lib' + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.Repository.LocalPath)/ort/runtimes/$(os)-$(arch)/native' + TargetFolder: '$(Build.Repository.LocalPath)/ort/lib' + # TODO: Find out why do we need to to have libonnxruntime.so.ort_stable_version + - script: | + set -e -x + ort_stable_version=$(echo $(ort_version) | cut -d- -f1) + echo $ort_stable_version + cp libonnxruntime.so libonnxruntime.so.$ort_stable_version + displayName: Copy libonnxruntime.so to libonnxruntime.so. + workingDirectory: '$(Build.Repository.LocalPath)/ort/lib' - task: CopyFiles@2 inputs: From 8f5ff33260d80724fbb1daf32816e4faa11378c8 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 16:19:31 -0700 Subject: [PATCH 24/27] Remove pipeline resource --- .pipelines/nuget-publishing.yml | 10 +--------- .pipelines/pypl-publishing.yml | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/.pipelines/nuget-publishing.yml b/.pipelines/nuget-publishing.yml index 1e9dcaf68..8e09c3eb1 100644 --- a/.pipelines/nuget-publishing.yml +++ b/.pipelines/nuget-publishing.yml @@ -54,15 +54,7 @@ resources: endpoint: Microsoft name: pypa/manylinux ref: 5eda9aded5462201e6310105728d33016e637ea7 - pipelines: - - pipeline: ort_package - project: 'Lotus' - source: 'Zip-Nuget-Java-Nodejs Packaging Pipeline' - trigger: - branches: - include: - - main - branch: main + trigger: none stages: - template: stages/nuget-packaging-stage.yml diff --git a/.pipelines/pypl-publishing.yml b/.pipelines/pypl-publishing.yml index 7d1e51b00..b603fcde3 100644 --- a/.pipelines/pypl-publishing.yml +++ b/.pipelines/pypl-publishing.yml @@ -54,15 +54,7 @@ resources: endpoint: Microsoft name: pypa/manylinux ref: 5eda9aded5462201e6310105728d33016e637ea7 - pipelines: - - pipeline: ort_package - project: 'Lotus' - source: 'Zip-Nuget-Java-Nodejs Packaging Pipeline' - trigger: - branches: - include: - - main - branch: main + trigger: none stages: - template: stages/py-packaging-stage.yml From 7f493866b7f5e59bfd521798826609e3c86d0a6d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 16:20:15 -0700 Subject: [PATCH 25/27] remove download-ort-build.yml --- .../jobs/steps/utils/download-ort-build.yml | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 .pipelines/stages/jobs/steps/utils/download-ort-build.yml diff --git a/.pipelines/stages/jobs/steps/utils/download-ort-build.yml b/.pipelines/stages/jobs/steps/utils/download-ort-build.yml deleted file mode 100644 index 1f5e91b23..000000000 --- a/.pipelines/stages/jobs/steps/utils/download-ort-build.yml +++ /dev/null @@ -1,73 +0,0 @@ -parameters: -- name: ep - type: string - default: cpu -- name: os - type: string - default: linux -- name: arch - type: string - default: x64 -steps: - - -- download: ort_package - displayName: 'Download Pipeline Artifact from Zip-Nuget-Java-Nodejs Packaging Pipeline' - ${{ if eq(parameters.ep, 'directml') }}: - artifact: 'drop-nuget-dml' - ${{ elseif eq(parameters.ep, 'cuda') }}: - artifact: 'onnxruntime-${{ parameters.os}}-${{ parameters.ep}}-${{ parameters.arch}}-cuda' - ${{ else }}: - artifact: 'onnxruntime-${{ parameters.os}}-${{ parameters.ep}}-${{ parameters.arch}}' - -- ${{ if eq(parameters.ep, 'directml') }}: - - task: ExtractFiles@1 - inputs: - archiveFilePatterns: '$(Pipeline.Workspace)/ort_package/*/*.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' - flattenFolders: true -- ${{ elseif eq(parameters.os, 'win') }}: - - task: ExtractFiles@1 - inputs: - archiveFilePatterns: '$(Pipeline.Workspace)/ort_package/*/*.zip' - destinationFolder: '$(Build.Repository.LocalPath)/ort' - cleanDestinationFolder: false - overwriteExistingFiles: true - displayName: Unzip OnnxRuntime -- ${{ else }}: - - task: ExtractFiles@1 - inputs: - archiveFilePatterns: '$(Pipeline.Workspace)/ort_package/*/*.tgz' - destinationFolder: '$(Build.Repository.LocalPath)/ort' - cleanDestinationFolder: false - overwriteExistingFiles: true - displayName: Unzip OnnxRuntime - - -- task: DeleteFiles@1 - inputs: - SourceFolder: '$(Build.Repository.LocalPath)/ort/lib' - Contents: '*tensorrt*' - RemoveSourceFolder: false - displayName: 'Remove tensorrt from lib' - continueOnError: true - -- task: DeleteFiles@1 - inputs: - SourceFolder: '$(Build.Repository.LocalPath)/ort/lib' - Contents: '*.pdb' - RemoveSourceFolder: false - displayName: 'Remove .pdb files from lib' - continueOnError: true From 8ff8202fa6990b2790a3ea22ed881e0d582dac9e Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 16:21:46 -0700 Subject: [PATCH 26/27] onnxruntime$(ep) --- .pipelines/stages/jobs/steps/capi-linux-step.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/stages/jobs/steps/capi-linux-step.yml b/.pipelines/stages/jobs/steps/capi-linux-step.yml index 56cc036ee..8a5b11072 100644 --- a/.pipelines/stages/jobs/steps/capi-linux-step.yml +++ b/.pipelines/stages/jobs/steps/capi-linux-step.yml @@ -53,7 +53,7 @@ steps: --container-registry onnxruntimebuildcache \ --manylinux-src manylinux \ --multiple_repos \ - --repository onnxruntime$(ep)build$(arch) + --repository ortgenai$(ep)build$(arch) displayName: 'Get Docker Image' workingDirectory: '$(Build.Repository.LocalPath)' @@ -63,7 +63,7 @@ steps: docker run \ --rm \ --volume $(Build.Repository.LocalPath):/ort_genai_src \ - -w /ort_genai_src/ onnxruntime$(ep)build$(arch) \ + -w /ort_genai_src/ ortgenai$(ep)build$(arch) \ bash -c " \ /usr/bin/cmake --preset linux_gcc_$(ep)_release \ -DENABLE_TESTS=OFF && \ @@ -85,7 +85,7 @@ steps: docker run \ --rm \ --volume $(Build.Repository.LocalPath):/ort_genai_src \ - -w /ort_genai_src/ onnxruntime$(ep)build$(arch) \ + -w /ort_genai_src/ ortgenai$(ep)build$(arch) \ bash -c " \ /usr/bin/cmake --build --preset linux_gcc_$(ep)_release --target package" displayName: 'Package C/C++ API' @@ -103,7 +103,7 @@ steps: docker run \ --rm \ --volume $(Build.Repository.LocalPath):/ort_genai_src \ - -w /ort_genai_src/ onnxruntime$(ep)build$(arch) \ + -w /ort_genai_src/ ortgenai$(ep)build$(arch) \ bash -c " \ /usr/bin/cmake --preset linux_gcc_$(ep)_release \ -DENABLE_TESTS=OFF \ @@ -125,7 +125,7 @@ steps: docker run \ --rm \ --volume $(Build.Repository.LocalPath):/ort_genai_src \ - -w /ort_genai_src/ onnxruntime$(ep)build$(arch) \ + -w /ort_genai_src/ ortgenai$(ep)build$(arch) \ bash -c " \ /usr/bin/cmake --build --preset linux_gcc_$(ep)_release \ -DENABLE_TESTS=OFF \ From 3c7d4f2a77b11cebe66015b75c570069484198d9 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 16:23:18 -0700 Subject: [PATCH 27/27] remove download-ort-build.yml --- .pipelines/stages/jobs/steps/capi-linux-step.yml | 6 ------ .pipelines/stages/jobs/steps/capi-win-step.yml | 5 ----- 2 files changed, 11 deletions(-) diff --git a/.pipelines/stages/jobs/steps/capi-linux-step.yml b/.pipelines/stages/jobs/steps/capi-linux-step.yml index 8a5b11072..16638017d 100644 --- a/.pipelines/stages/jobs/steps/capi-linux-step.yml +++ b/.pipelines/stages/jobs/steps/capi-linux-step.yml @@ -33,12 +33,6 @@ steps: echo "ep=$(ep)" displayName: 'Print Parameters' -#- template: utils/download-ort-build.yml -# parameters: -# ep: ${{ parameters.ep }} -# arch: ${{ parameters.arch }} -# os: 'linux' - - template: utils/download-ort.yml parameters: archiveType: 'tgz' diff --git a/.pipelines/stages/jobs/steps/capi-win-step.yml b/.pipelines/stages/jobs/steps/capi-win-step.yml index 7581c1fdd..4d527cda1 100644 --- a/.pipelines/stages/jobs/steps/capi-win-step.yml +++ b/.pipelines/stages/jobs/steps/capi-win-step.yml @@ -35,11 +35,6 @@ steps: echo "target=${{ parameters.target }}" displayName: 'Print Parameters' -#- template: utils/download-ort-build.yml -# parameters: -# ep: ${{ parameters.ep }} -# arch: ${{ parameters.arch }} -# os: 'win' - template: utils/download-ort.yml parameters: