mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Abjindal/eager windows ci pipeline (#9587)
* adding eager ci pipelines files * adding import torch before onnxruntime * finding os environ path * finding os environ path corrected * print OS environ path variables * adding environ path for torch * changing python version * changing python python for torch libs * removing import torch statements * removing unncecessary torch path * removing path variable * add dll_path * test for python 3.7 * adding dll directory path for python 3.8+ * print dll directory path for python 3.8+ * adding requirements file * change requirements directory * print more * adding dll dir path * removing setup eager file * adding details for dll directory * adding details for dll directory more * adding import torch in onnxruntime init file * removing dll dir path and moving requirements file * enabling pipeline for py3.7 * remove enter * removing debug build * removing openmp * adding comments for torch dll loading and cases of failure * cleaning up the pipeline
This commit is contained in:
parent
74dc48f61c
commit
dfe4d0a330
3 changed files with 93 additions and 0 deletions
|
|
@ -1547,6 +1547,12 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
|
|||
build_dir, config, "external", "tvm", config))
|
||||
if args.use_tensorrt:
|
||||
dll_path_list.append(os.path.join(args.tensorrt_home, 'lib'))
|
||||
# Adding the torch lib path for loading DLLs for onnxruntime in eager mode
|
||||
# This works for Python 3.7 and below, and doesn't work for Python 3.8+
|
||||
# User will need to import torch before onnxruntime and it will work for all versions
|
||||
if args.build_eager_mode and is_windows():
|
||||
import torch
|
||||
dll_path_list.append(os.path.join(os.path.dirname(torch.__file__), 'lib'))
|
||||
|
||||
dll_path = None
|
||||
if len(dll_path_list) > 0:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
parameters:
|
||||
- name: RunOnnxRuntimeTests
|
||||
displayName: Run Tests?
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
- job: 'build'
|
||||
pool: 'Win-CPU-2019'
|
||||
strategy:
|
||||
matrix:
|
||||
x64_release:
|
||||
BuildConfig: 'RelWithDebInfo'
|
||||
EnvSetupScript: setup_env.bat
|
||||
buildArch: x64
|
||||
additionalBuildFlags: --use_dnnl --build_java --build_nodejs
|
||||
msbuildPlatform: x64
|
||||
isX86: false
|
||||
variables:
|
||||
OrtPackageId: 'Microsoft.ML.OnnxRuntime'
|
||||
MsbuildArguments: '-maxcpucount'
|
||||
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
setVcvars: true
|
||||
ALLOW_RELEASED_ONNX_OPSET_ONLY: '0'
|
||||
timeoutInMinutes: 120
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.7'
|
||||
addToPath: true
|
||||
architecture: $(buildArch)
|
||||
|
||||
- task: BatchScript@1
|
||||
displayName: 'setup env'
|
||||
inputs:
|
||||
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\$(EnvSetupScript)'
|
||||
modifyEnvironment: true
|
||||
workingFolder: '$(Build.BinariesDirectory)'
|
||||
|
||||
- script: |
|
||||
set ORT_DOXY_SRC=$(Build.SourcesDirectory)
|
||||
set ORT_DOXY_OUT=$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)
|
||||
mkdir %ORT_DOXY_SRC%
|
||||
mkdir %ORT_DOXY_OUT%
|
||||
"C:\Program Files\doxygen\bin\doxygen.exe" $(Build.SourcesDirectory)\tools\ci_build\github\Doxyfile_csharp.cfg
|
||||
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
displayName: 'API Documentation Check and generate'
|
||||
|
||||
- script: |
|
||||
python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\windows\eager\requirements.txt
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
displayName: 'Install python modules'
|
||||
|
||||
- task: BatchScript@1
|
||||
displayName: 'setup env 2'
|
||||
inputs:
|
||||
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\$(EnvSetupScript)'
|
||||
modifyEnvironment: true
|
||||
workingFolder: '$(Build.BinariesDirectory)'
|
||||
|
||||
- task: PythonScript@0
|
||||
displayName: 'Build Eager mode'
|
||||
inputs:
|
||||
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
|
||||
arguments: '--config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --build_eager_mode --enable_training --enable_pybind --config Release --parallel'
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish unit test results'
|
||||
inputs:
|
||||
testResultsFiles: '**/*.results.xml'
|
||||
searchFolder: '$(Build.BinariesDirectory)/$(BuildConfig)'
|
||||
testRunTitle: 'Unit Test Run'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- template: templates/component-governance-component-detection-steps.yml
|
||||
parameters :
|
||||
condition : 'succeeded'
|
||||
5
tools/ci_build/github/windows/eager/requirements.txt
Normal file
5
tools/ci_build/github/windows/eager/requirements.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
setuptools
|
||||
wheel
|
||||
numpy
|
||||
typing_extensions
|
||||
torch
|
||||
Loading…
Reference in a new issue