diff --git a/tools/ci_build/github/azure-pipelines/azure-pipelines-py-packaging.yml b/tools/ci_build/github/azure-pipelines/azure-pipelines-py-packaging.yml new file mode 100644 index 0000000000000..352226fcfa145 --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/azure-pipelines-py-packaging.yml @@ -0,0 +1,182 @@ +jobs: +- job: Ubuntu1604_py_Wheels + pool: Linux-CPU + strategy: + matrix: + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + steps: + - task: ShellScript@2 + displayName: 'Run build script' + inputs: + scriptPath: 'tools/ci_build/github/linux/run_dockerbuild.sh' + args: '-c Release -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -p $(python.version) -x "--build_wheel --use_mkldnn"' + + - task: CopyFiles@2 + displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' + inputs: + SourceFolder: '$(Build.BinariesDirectory)' + Contents: 'Release/dist/onnxruntime-*-manylinux1_x86_64.whl' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: ONNXRuntime python wheel' + inputs: + ArtifactName: onnxruntime + + - script: 'sudo rm -rf $(Agent.BuildDirectory)' + displayName: 'Clean build folders/files' + condition: always() + +- job: Ubuntu1604_py_GPU_Wheels + pool: Linux-GPU + strategy: + matrix: + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + steps: + - task: ShellScript@2 + displayName: 'Run build script' + inputs: + scriptPath: 'tools/ci_build/github/linux/run_dockerbuild.sh' + args: '-c Release -o ubuntu16.04 -d gpu -r $(Build.BinariesDirectory) -p $(python.version) -x "--build_wheel --use_mkldnn"' + + - task: CopyFiles@2 + displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' + inputs: + SourceFolder: '$(Build.BinariesDirectory)' + Contents: 'Release/dist/onnxruntime*-manylinux1_x86_64.whl' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: ONNXRuntime python wheel' + inputs: + ArtifactName: onnxruntime_gpu + + - script: 'sudo rm -rf $(Agent.BuildDirectory)' + displayName: 'Clean build folders/files' + condition: always() + +- job: Windows_py_Wheels + pool: Win-CPU + strategy: + matrix: + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + variables: + buildDirectory: '$(Build.SourcesDirectory)\build' + steps: + - task: CondaEnvironment@1 + inputs: + createCustomEnvironment: true + environmentName: 'py$(python.version)' + packageSpecs: 'python=$(python.version)' + cleanEnvironment: true + + - task: BatchScript@1 + displayName: 'Run build script' + inputs: + filename: 'build.bat' + arguments: ' --build_dir $(buildDirectory) --config Release --build_wheel' + workingFolder: "$(Build.SourcesDirectory)" + + - task: CopyFiles@2 + displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' + inputs: + SourceFolder: '$(buildDirectory)' + Contents: '**\dist\onnxruntime-*.whl' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: ONNXRuntime python wheel' + inputs: + ArtifactName: onnxruntime + + - task: CmdLine@1 + displayName: 'Clean build folders/files' + inputs: + filename: rd + arguments: '/s /q $(Agent.BuildDirectory)' + continueOnError: true + condition: always() + + - task: CmdLine@1 + displayName: 'Deactivating Conda Environment' + inputs: + filename: deactivate + continueOnError: true + condition: always() + +- job: Windows_py_GPU_Wheels + pool: Win-GPU + variables: + buildDirectory: '$(Build.SourcesDirectory)\build' + CUDA_VERSION: '9.1' + strategy: + matrix: + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + steps: + - task: CondaEnvironment@1 + inputs: + createCustomEnvironment: true + environmentName: 'py$(python.version)' + packageSpecs: 'python=$(python.version)' + cleanEnvironment: true + + - task: PowerShell@1 + displayName: 'Set CUDA path' + inputs: + scriptName: 'tools/ci_build/github/windows/set_cuda_path.ps1' + arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-9.1.85-windows10-x64-0 -CudaVersion $(CUDA_VERSION)' + + - task: BatchScript@1 + displayName: 'Setup VS2017 env vars' + inputs: + filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' + arguments: 'amd64 -vcvars_ver=14.11' + modifyEnvironment: true + + - task: BatchScript@1 + displayName: 'Run build script' + inputs: + filename: 'build.bat' + arguments: ' --use_cuda --cuda_home="C:\local\cuda-9.1.85-windows10-x64-0" --cudnn_home="C:\local\cudnn-9.1-windows10-x64-v7.1\cuda" --build_dir $(buildDirectory) --config Release --build_wheel' + workingFolder: "$(Build.SourcesDirectory)" + + - task: CopyFiles@2 + displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' + inputs: + SourceFolder: '$(buildDirectory)' + Contents: '**\dist\onnxruntime_gpu-*.whl' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: ONNXRuntime python wheel' + inputs: + ArtifactName: onnxruntime_gpu + + - task: CmdLine@1 + displayName: 'Clean build folders/files' + inputs: + filename: rd + arguments: '/s /q $(Agent.BuildDirectory)' + continueOnError: true + condition: always() + + - task: CmdLine@1 + displayName: 'Deactivating Conda Environment' + inputs: + filename: deactivate + continueOnError: true + condition: always() diff --git a/tools/ci_build/github/azure-pipelines/azure-pipelines.yml b/tools/ci_build/github/azure-pipelines/azure-pipelines.yml index 94a3e664fcc71..7bfeff5b74416 100644 --- a/tools/ci_build/github/azure-pipelines/azure-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/azure-pipelines.yml @@ -60,14 +60,14 @@ jobs: pool: Win-GPU variables: - CUDA_VERSION: '9.0' + CUDA_VERSION: '9.1' steps: - task: PowerShell@1 displayName: 'Set CUDA path' inputs: scriptName: 'tools/ci_build/github/windows/set_cuda_path.ps1' - arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-9.0.176-windows10-x64-2 -CudaVersion $(CUDA_VERSION)' + arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-9.1.85-windows10-x64-0 -CudaVersion $(CUDA_VERSION)' - task: BatchScript@1 displayName: 'Setup VS2017 env vars' @@ -87,7 +87,7 @@ jobs: - task: BatchScript@1 inputs: filename: build.bat - arguments: ' --enable_onnx_tests --use_cuda --cuda_home="C:\local\cuda-9.0.176-windows10-x64-0" --cudnn_home="C:\local\cudnn-9.0-windows10-x64-v7.0.5-0\cuda"' + arguments: ' --enable_onnx_tests --use_cuda --cuda_home="C:\local\cuda-9.1.85-windows10-x64-0" --cudnn_home="C:\local\cudnn-9.1-windows10-x64-v7.1\cuda"' workingFolder: "$(Build.SourcesDirectory)" - task: CmdLine@1 diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_gpu b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_gpu index bc8602f8d0bb0..8ecbf627df259 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_gpu +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_gpu @@ -1,12 +1,9 @@ -# Tag: nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 -# Created: 2017-11-21T06:34:14.675603521Z -# Label: com.nvidia.build.id: 41212533 -# Label: com.nvidia.build.ref: e0edb5359ecb7bd3d86f0c9bfa18c2260b741ebb -# Label: com.nvidia.cuda.version: 9.0.176 -# Label: com.nvidia.cudnn.version: 7.0.4.31 -# Label: com.nvidia.nccl.version: 2.1.2 +# Tag: nvidia/cuda:9.1-cudnn7-devel-ubuntu16.04 +# Label: com.nvidia.cuda.version: 9.1.85 +# Label: com.nvidia.cudnn.version: 7.1.2.21 +# Label: com.nvidia.nccl.version: 2.2.12 # Ubuntu 16.04.5 -FROM nvidia/cuda@sha256:33add9c50ab76b8f3a92187c0418ed600d5bea27690fda40711122fdc28ce2f4 +FROM nvidia/cuda:9.1-cudnn7-devel-ubuntu16.04 ARG PYTHON_VERSION=3.5 diff --git a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh index 9aacae059ef6b..163342d157f49 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh @@ -45,6 +45,7 @@ if [ $PYTHON_VER != "3.5" ]; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VER} 1 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2 update-alternatives --set python3 /usr/bin/python${PYTHON_VER} + /usr/bin/python${PYTHON_VER} -m pip install --upgrade --force-reinstall numpy fi rm -rf /var/lib/apt/lists/* diff --git a/tools/ci_build/github/linux/run_build.sh b/tools/ci_build/github/linux/run_build.sh index 8ed87f451c99e..083204a6a6678 100755 --- a/tools/ci_build/github/linux/run_build.sh +++ b/tools/ci_build/github/linux/run_build.sh @@ -9,16 +9,19 @@ while getopts c:d:x: parameter_Option do case "${parameter_Option}" in d) BUILD_DEVICE=${OPTARG};; +x) BUILD_EXTR_PAR=${OPTARG};; esac done if [ -z "$AZURE_BLOB_KEY" ]; then echo "AZURE_BLOB_KEY is blank" + BUILD_EXTR_PAR="${BUILD_EXTR_PAR}" + echo "Extra parameters: ${BUILD_EXTR_PAR}" else echo "Downloading test data from azure" mkdir -p /home/onnxruntimedev/models/ azcopy --recursive --source:https://onnxruntimetestdata.blob.core.windows.net/onnx-model-zoo-20181018 --destination:/home/onnxruntimedev/models/ --source-key:$AZURE_BLOB_KEY - BUILD_EXTR_PAR="--enable_onnx_tests" + BUILD_EXTR_PAR="${BUILD_EXTR_PAR} --enable_onnx_tests" fi if [ $BUILD_DEVICE = "gpu" ]; then @@ -28,7 +31,7 @@ if [ $BUILD_DEVICE = "gpu" ]; then --parallel --build_shared_lib \ --use_cuda \ --cuda_home /usr/local/cuda \ - --cudnn_home /usr/local/cudnn-7.0/cuda --build_shared_lib $BUILD_EXTR_PAR + --cudnn_home /usr/local/cudnn-7.1/cuda --build_shared_lib $BUILD_EXTR_PAR /home/onnxruntimedev/Release/onnx_test_runner -e cuda /data/onnx else python3 $SCRIPT_DIR/../../build.py --build_dir /home/onnxruntimedev \ diff --git a/tools/ci_build/github/linux/run_dockerbuild.sh b/tools/ci_build/github/linux/run_dockerbuild.sh index debdb19805cf8..bac014715352e 100755 --- a/tools/ci_build/github/linux/run_dockerbuild.sh +++ b/tools/ci_build/github/linux/run_dockerbuild.sh @@ -25,7 +25,7 @@ echo "bo=$BUILD_OS bd=$BUILD_DEVICE bdir=$BUILD_DIR pv=$PYTHON_VER bex=$BUILD_EX cd $SCRIPT_DIR/docker if [ $BUILD_DEVICE = "gpu" ]; then - IMAGE="ubuntu16.04-cuda9.0-cudnn7.0" + IMAGE="ubuntu16.04-cuda9.1-cudnn7.1" docker build -t "onnxruntime-$IMAGE" --build-arg PYTHON_VERSION=${PYTHON_VER} -f Dockerfile.ubuntu_gpu . else IMAGE="ubuntu16.04"