From 4afdced7755c5518b4345e2887e456ee683d5fe9 Mon Sep 17 00:00:00 2001 From: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com> Date: Thu, 26 Nov 2020 03:00:54 -0800 Subject: [PATCH 01/10] [NNAPI EP] Update squeeze ops (#5946) * [NNAPI EP] Update squeeze ops --- .../nnapi/nnapi_builtin/builders/helper.cc | 5 +- .../nnapi/nnapi_builtin/builders/helper.h | 6 +- .../nnapi_builtin/builders/op_builder.cc | 83 +++++++++++-------- .../nnapi/nnapi_builtin/builders/shaper.cc | 23 ++--- .../nnapi/nnapi_builtin/builders/shaper.h | 3 + .../providers/cpu/tensor/squeeze_op_test.cc | 9 ++ 6 files changed, 78 insertions(+), 51 deletions(-) diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.cc index ef0fa3a98a3db..b4241b92d77a4 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.cc @@ -1,6 +1,5 @@ -// -// Created by daquexian on 8/3/18. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #include #include diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.h b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.h index 4bbe1947419f4..44825599bc5c8 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.h +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.h @@ -1,6 +1,6 @@ -// -// Created by daquexian on 5/21/18. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/op_builder.cc index d5e0118dba585..e74add6a145dc 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/op_builder.cc @@ -1767,6 +1767,10 @@ Status ConcatOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const class SqueezeOpBuilder : public BaseOpBuilder { public: void AddInitializersToSkip(ModelBuilder& model_builder, const Node& node) const override; + static Status AddSqueezeOp(ModelBuilder& model_builder, + const std::string& node_name, + const std::string& input, const std::string& output, + vector axes) ORT_MUST_USE_RESULT; private: Status AddToModelBuilderImpl(ModelBuilder& model_builder, const Node& node) const override ORT_MUST_USE_RESULT; @@ -1779,6 +1783,49 @@ void SqueezeOpBuilder::AddInitializersToSkip(ModelBuilder& model_builder, const } } +/* static */ Status SqueezeOpBuilder::AddSqueezeOp(ModelBuilder& model_builder, + const std::string& node_name, + const std::string& input, const std::string& output, + vector axes) { + auto& shaper(model_builder.GetShaper()); + const auto& operand_indices(model_builder.GetOperandIndices()); + const auto& operand_types(model_builder.GetOperandTypes()); + + const auto& input_shape(shaper[input]); + auto input_dims = input_shape.size(); + for (auto& axis : axes) { + axis = static_cast(HandleNegativeAxis(axis, input_dims)); + } + + // Despite the spec of ANEURALNETWORKS_SQUEEZE at + // https://developer.android.com/ndk/reference/group/neural-networks + // states, that the axes (input 1 of ANEURALNETWORKS_SQUEEZE) is optional. + // + // The actual code of NNAPI requires the axes to be provided + // https://android.googlesource.com/platform/frameworks/ml/+/master/nn/common/operations/Squeeze.cpp#31 + if (axes.empty()) { // Squeeze all + for (size_t i = 0; i < input_dims; i++) { + if (input_shape[i] == 1) + axes.push_back(i); + } + } + + const auto axes_name = model_builder.GetUniqueName(node_name + input + "_axes"); + Shape axes_dimen = {static_cast(axes.size())}; + const OperandType axes_operand_type(Type::TENSOR_INT32, axes_dimen); + ORT_RETURN_IF_ERROR(model_builder.AddOperandFromPersistMemoryBuffer(axes_name, axes.data(), axes_operand_type)); + + std::vector input_indices; + input_indices.push_back(operand_indices.at(input)); // input + input_indices.push_back(operand_indices.at(axes_name)); // axes + + ORT_RETURN_IF_ERROR(shaper.Squeeze(input, axes, output)); + const OperandType output_operand_type(operand_types.at(input).type, shaper[output]); + ORT_RETURN_IF_ERROR(model_builder.AddOperation(ANEURALNETWORKS_SQUEEZE, input_indices, + {output}, {output_operand_type}, {false})); + return Status::OK(); +} + /* static */ vector SqueezeOpBuilder::GetAxes(ModelBuilder& model_builder, const Node& node) { vector axes; // Squeeze opset 13 use input as axes @@ -1804,47 +1851,13 @@ void SqueezeOpBuilder::AddInitializersToSkip(ModelBuilder& model_builder, const } Status SqueezeOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const Node& node) const { - auto& shaper(model_builder.GetShaper()); - const auto& operand_indices(model_builder.GetOperandIndices()); - const auto& operand_types(model_builder.GetOperandTypes()); - auto input = node.InputDefs()[0]->Name(); if (model_builder.IsOperandNHWC(input)) { // We want to transpose nhwc operand back to nchw before squeeze ORT_RETURN_IF_ERROR(GetNCHWInput(model_builder, node, 0, input)); } - NodeAttrHelper helper(node); - vector axes = GetAxes(model_builder, node); - const auto& input_shape(shaper[input]); - auto input_dims = input_shape.size(); - for (auto& axis : axes) { - axis = static_cast(HandleNegativeAxis(axis, input_dims)); - } - - if (axes.empty()) { // Squeeze all - for (size_t i = 0; i < input_dims; i++) { - if (input_shape[i] == 1) - axes.push_back(i); - } - } - - const auto axes_name = model_builder.GetUniqueName(node.Name() + input + "_axes"); - Shape axes_dimen = {static_cast(axes.size())}; - shaper.AddShape(axes_name, axes_dimen); - const OperandType axes_operand_type(Type::TENSOR_INT32, axes_dimen); - ORT_RETURN_IF_ERROR(model_builder.AddOperandFromPersistMemoryBuffer(axes_name, axes.data(), axes_operand_type)); - - std::vector input_indices; - input_indices.push_back(operand_indices.at(input)); // input - input_indices.push_back(operand_indices.at(axes_name)); // axes - - const auto& output = node.OutputDefs()[0]->Name(); - ORT_RETURN_IF_ERROR(shaper.Squeeze(input, axes, output)); - const OperandType output_operand_type(operand_types.at(input).type, shaper[output]); - ORT_RETURN_IF_ERROR(model_builder.AddOperation(ANEURALNETWORKS_SQUEEZE, input_indices, - {output}, {output_operand_type}, {false})); - return Status::OK(); + return AddSqueezeOp(model_builder, node.Name(), input, node.OutputDefs()[0]->Name(), GetAxes(model_builder, node)); } #pragma endregion diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.cc index a060ca421b24c..9b06fcfc8a3d2 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.cc @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "core/providers/common.h" #include "core/providers/nnapi/nnapi_builtin/nnapi_lib/NeuralNetworksWrapper.h" @@ -374,17 +377,12 @@ Status Shaper::SqueezeImpl(const std::string& input_name, const std::string& output_name) { const Shape& input_dimen = shape_map_.at(input_name); int32_t input_size = input_dimen.size(); - size_t axes_size = axes.size(); std::unordered_set axes_to_be_squeezed; - if (axes_size == 0) { - for (int32_t idx = 0; idx < input_size; ++idx) { - if (input_dimen[idx] == 1) - axes_to_be_squeezed.insert(idx); - } - } else { - for (const auto& axis : axes) - axes_to_be_squeezed.insert(axis); - } + + // If the Op is squeezing all by not specifying axes, the axes is pre-populate + // with axes of all single dimensions by the caller + for (const auto& axis : axes) + axes_to_be_squeezed.insert(axis); // Make output dimensions std::vector output_dimen; @@ -394,6 +392,11 @@ Status Shaper::SqueezeImpl(const std::string& input_name, output_dimen.push_back(input_dimen[i]); } + // In case of a tensor has all 1's in dimension such as {1,1,1,1} and gets squeezed all + // the output shape will be {1} + if (output_dimen.empty()) + output_dimen.push_back(1); + shape_map_[output_name] = output_dimen; return Status::OK(); } diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.h b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.h index ee3ab17ea9451..b9299454dce44 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.h +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/shaper.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include diff --git a/onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc b/onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc index e07d9845a9d74..39561a6ba5ea4 100644 --- a/onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc +++ b/onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc @@ -35,6 +35,15 @@ TEST(SqueezeOpTest, Squeeze_Empty_Axes_2) { test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider}); } +TEST(SqueezeOpTest, Squeeze_Empty_Axes_3) { + OpTester test("Squeeze"); + // Squeeze all for all 1's shape will end up as a scalar + test.AddInput("data", {1, 1, 1, 1}, std::vector{1.0f}); + test.AddOutput("squeezed", {}, std::vector{1.0f}); + // TensorRT doesn't seem to support missing 'axes' + test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider}); +} + TEST(SqueezeOpTest, Squeeze_1_int32) { OpTester test("Squeeze"); test.AddAttribute("axes", std::vector{0}); From e207589631a41d618f3e87c66de6b2f7e49ef52d Mon Sep 17 00:00:00 2001 From: Moshe David Date: Fri, 27 Nov 2020 01:10:37 +0200 Subject: [PATCH 02/10] [OpenVINO]Fix memory leak in `IsDebugEnabled()` under Windows (#5948) * w * w Co-authored-by: modav --- onnxruntime/core/providers/openvino/backend_utils.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/openvino/backend_utils.cc b/onnxruntime/core/providers/openvino/backend_utils.cc index ad3dcedc70db9..9527920ea4c96 100644 --- a/onnxruntime/core/providers/openvino/backend_utils.cc +++ b/onnxruntime/core/providers/openvino/backend_utils.cc @@ -26,7 +26,9 @@ bool IsDebugEnabled() { #ifdef _WIN32 size_t env_name_len = 0; char* env_name = nullptr; - return (_dupenv_s(&env_name, &env_name_len, "ORT_OPENVINO_ENABLE_DEBUG") == 0 && env_name != nullptr); + bool res = (_dupenv_s(&env_name, &env_name_len, "ORT_OPENVINO_ENABLE_DEBUG") == 0 && env_name != nullptr); + free(env_name); + return res; #else return (std::getenv("ORT_OPENVINO_ENABLE_DEBUG") != nullptr); #endif From 015fbb3dbb8547294171990e1104cdf101be4a7d Mon Sep 17 00:00:00 2001 From: Ivan Stojiljkovic <17503404+ivanst0@users.noreply.github.com> Date: Fri, 27 Nov 2020 00:52:30 +0100 Subject: [PATCH 03/10] Add support for Python 3.8+ on Windows when CUDA is enabled (#5956) --- onnxruntime/python/_pybind_state.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/onnxruntime/python/_pybind_state.py b/onnxruntime/python/_pybind_state.py index e4f8ec4e97a2e..4f0a243899dad 100644 --- a/onnxruntime/python/_pybind_state.py +++ b/onnxruntime/python/_pybind_state.py @@ -5,9 +5,23 @@ import os import platform +import sys import warnings import onnxruntime.capi._ld_preload # noqa: F401 +# Python 3.8 (and later) on Windows doesn't search system PATH when loading DLLs, +# so CUDA location needs to be specified explicitly. +if platform.system() == "Windows" and sys.version_info >= (3, 8): + CUDA_VERSION = "10.2" + CUDNN_VERSION = "8" + cuda_env_variable = "CUDA_PATH_V" + CUDA_VERSION.replace(".", "_") + if cuda_env_variable not in os.environ: + raise ImportError(f"CUDA Toolkit {CUDA_VERSION} not installed on the machine.") + cuda_bin_dir = os.path.join(os.environ[cuda_env_variable], "bin") + if not os.path.isfile(os.path.join(cuda_bin_dir, f"cudnn64_{CUDNN_VERSION}.dll")): + raise ImportError(f"cuDNN {CUDNN_VERSION} not installed on the machine.") + os.add_dll_directory(cuda_bin_dir) + try: from onnxruntime.capi.onnxruntime_pybind11_state import * # noqa except ImportError as e: @@ -21,6 +35,6 @@ # TODO: Add a guard against False Positive error message # As a proxy for checking if the 2019 VC Runtime is installed, # we look for a specific dll only shipped with the 2019 VC Runtime - if platform.system().lower() == 'windows' and not os.path.isfile('c:\\Windows\\System32\\vcruntime140_1.dll'): + if platform.system() == "Windows" and not os.path.isfile("C:\\Windows\\System32\\vcruntime140_1.dll"): warnings.warn("Unless you have built the wheel using VS 2017, " - "please install the 2019 Visual C++ runtime and then try again") + "please install the 2019 Visual C++ runtime and then try again.") From 5f5d4a10bdfb868beadc43c1c023fcf4ab7d0838 Mon Sep 17 00:00:00 2001 From: Moshe David Date: Fri, 27 Nov 2020 05:44:51 +0200 Subject: [PATCH 04/10] [OpenVINO]Fix memory leak upon exception throwing (#5954) 1. Make sure to free the output_shape vector even if Output names mismatch between OpenVINO and ONNX exception is thrown 2. Piggy back this PR to remove un-needed call to fstream close method Authored-by: modav --- onnxruntime/core/providers/openvino/backend_utils.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/onnxruntime/core/providers/openvino/backend_utils.cc b/onnxruntime/core/providers/openvino/backend_utils.cc index 9527920ea4c96..7e5f83e2a238d 100644 --- a/onnxruntime/core/providers/openvino/backend_utils.cc +++ b/onnxruntime/core/providers/openvino/backend_utils.cc @@ -36,7 +36,6 @@ bool IsDebugEnabled() { void DumpOnnxModelProto(const Provider_ModelProto& model_proto, std::string file_name) { std::fstream outfile(file_name, std::ios::out | std::ios::trunc | std::ios::binary); model_proto.SerializeToOstream(outfile); - outfile.close(); } #endif @@ -187,7 +186,7 @@ GetOutputTensor(Ort::CustomOpApi& ort, OrtKernelContext* context, size_t batch_s graph_output_dims.insert(graph_output_dims.begin(), batch_size); } size_t num_dims = graph_output_dims.size(); - auto output_shape = new int64_t[num_dims]; + std::unique_ptr output_shape(new int64_t[num_dims]); for (size_t j = 0; j < num_dims; j++) { output_shape[j] = static_cast(graph_output_dims[j]); } @@ -197,8 +196,7 @@ GetOutputTensor(Ort::CustomOpApi& ort, OrtKernelContext* context, size_t batch_s } int index = it->second; - output_tensor = ort.KernelContext_GetOutput(context, index, output_shape, num_dims); - delete[] output_shape; + output_tensor = ort.KernelContext_GetOutput(context, index, output_shape.get(), num_dims); return output_tensor; } @@ -218,12 +216,11 @@ GetOutputTensor(Ort::CustomOpApi& ort, OrtKernelContext* context, auto shape = node->get_shape(); size_t num_dims = shape.size(); - auto output_shape = new int64_t[num_dims]; + std::unique_ptr output_shape(new int64_t[num_dims]); for (size_t j = 0; j < num_dims; j++) { output_shape[j] = static_cast(shape[j]); } - output_tensor = ort.KernelContext_GetOutput(context, index, output_shape, num_dims); - delete[] output_shape; + output_tensor = ort.KernelContext_GetOutput(context, index, output_shape.get(), num_dims); return output_tensor; } From 06ad516a5d38c479a62961b85fa9ae3ba4b3e9ab Mon Sep 17 00:00:00 2001 From: Moshe David Date: Mon, 30 Nov 2020 02:35:44 +0200 Subject: [PATCH 05/10] w (#5947) Co-authored-by: modav --- include/onnxruntime/core/session/onnxruntime_cxx_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/onnxruntime/core/session/onnxruntime_cxx_api.h b/include/onnxruntime/core/session/onnxruntime_cxx_api.h index bafd5edf04cd7..9907c56a4afb2 100644 --- a/include/onnxruntime/core/session/onnxruntime_cxx_api.h +++ b/include/onnxruntime/core/session/onnxruntime_cxx_api.h @@ -349,7 +349,7 @@ struct Session : Base { // Run that will allocate the output values std::vector Run(const RunOptions& run_options, const char* const* input_names, const Value* input_values, size_t input_count, const char* const* output_names, size_t output_count); - // Run for when there is a list of prealloated outputs + // Run for when there is a list of preallocated outputs void Run(const RunOptions& run_options, const char* const* input_names, const Value* input_values, size_t input_count, const char* const* output_names, Value* output_values, size_t output_count); From bd96f60888dc1eeb919fd18b3821d84c31e7b545 Mon Sep 17 00:00:00 2001 From: Jesse Benson Date: Wed, 18 Nov 2020 09:41:08 -0800 Subject: [PATCH 06/10] Use CUDA's IsAllFinite kernel for ROCm --- onnxruntime/core/providers/rocm/fpgeneric.cu | 2 +- .../training_ops/rocm/math/isfinite.cc | 106 ------------------ .../training_ops/rocm/math/isfinite.cuh | 22 ---- .../training_ops/rocm/math/isfinite.h | 49 -------- tools/ci_build/amd_hipify.py | 3 - 5 files changed, 1 insertion(+), 181 deletions(-) delete mode 100644 orttraining/orttraining/training_ops/rocm/math/isfinite.cc delete mode 100644 orttraining/orttraining/training_ops/rocm/math/isfinite.cuh delete mode 100644 orttraining/orttraining/training_ops/rocm/math/isfinite.h diff --git a/onnxruntime/core/providers/rocm/fpgeneric.cu b/onnxruntime/core/providers/rocm/fpgeneric.cu index 3cbe31d644f71..072bd17cff649 100644 --- a/onnxruntime/core/providers/rocm/fpgeneric.cu +++ b/onnxruntime/core/providers/rocm/fpgeneric.cu @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "hip/hip_runtime.h" +#include #include "core/providers/rocm/cu_inc/common.cuh" #define TRANS_TILE_DIM 32 diff --git a/orttraining/orttraining/training_ops/rocm/math/isfinite.cc b/orttraining/orttraining/training_ops/rocm/math/isfinite.cc deleted file mode 100644 index 9a110f308fe66..0000000000000 --- a/orttraining/orttraining/training_ops/rocm/math/isfinite.cc +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "orttraining/training_ops/rocm/math/isfinite.h" - -using namespace ONNX_NAMESPACE; -using namespace onnxruntime::common; -namespace onnxruntime { -namespace rocm { - -#define REGISTER_ISFINITE_KERNEL_TYPED(T) \ - ONNX_OPERATOR_TYPED_KERNEL_EX( \ - IsFinite, \ - kMSDomain, \ - 1, \ - T, \ - kRocmExecutionProvider, \ - KernelDefBuilder() \ - .TypeConstraint("T", DataTypeImpl::GetTensorType()) \ - .TypeConstraint("T1", DataTypeImpl::GetTensorType()), \ - IsFiniteOp); - -template -Status IsFiniteOp::ComputeInternal(OpKernelContext* context) const { - typedef typename ToHipType::MappedType HipTSrc; - const Tensor& input = *context->Input(0); - Tensor& output = *context->Output(0, input.Shape()); - IsFinite( - reinterpret_cast(input.Data()), - output.MutableData(), input.Shape().Size()); - - return Status::OK(); -} - -REGISTER_ISFINITE_KERNEL_TYPED(MLFloat16) -REGISTER_ISFINITE_KERNEL_TYPED(float) -REGISTER_ISFINITE_KERNEL_TYPED(double) - -#define REGISTER_ISALLFINITE_KERNEL_TYPED(T) \ - ONNX_OPERATOR_TYPED_KERNEL_EX( \ - IsAllFinite, \ - kMSDomain, \ - 1, \ - T, \ - kRocmExecutionProvider, \ - KernelDefBuilder() \ - .OutputMemoryType(0) \ - .TypeConstraint("V", DataTypeImpl::GetTensorType()) \ - .TypeConstraint("T", DataTypeImpl::GetTensorType()), \ - IsAllFiniteOp); - -template -Status IsAllFiniteOp::ComputeInternal(OpKernelContext* context) const { - typedef typename ToHipType::MappedType TSrcCuda; - - // Get Input tensor count. - const auto total_tensor_count = context->InputCount(); - - // Allocate GPU memory to capture the result computed by GPU kernel. - // The GPU result will be copied later to the output which locates - // on CPU memory. - IAllocatorUniquePtr deviceOutput = GetScratchBuffer(1); - HIP_RETURN_IF_ERROR(hipMemsetAsync(deviceOutput.get(), int(true), sizeof(bool))); - - for (int i = 0; i < total_tensor_count; ++i) { - const auto& input = context->Input(i); - IsFinite(reinterpret_cast(input->template Data()), deviceOutput.get(), input->Shape().Size()); - } - - // std::vector> grouped_tensor_pointers(total_tensor_count); - // std::vector tensor_sizes(total_tensor_count); - - // for (int i = 0; i < total_tensor_count; ++i) { - // const auto& input = context->Input(i); - // grouped_tensor_pointers[i] = {const_cast(input->Data())}; - // tensor_sizes[i] = static_cast(input->Shape().Size()); - // IsFinite(const TSrc* input, bool* output, size_t count) - // } - - // typedef IsAllFiniteFunctor TFunctor; - // TFunctor functor; - - // // Check if all values are finite and write true to deviceOutput. - // // Otherwise, false will be written. - // launch_multi_tensor_functor<1, TFunctor, bool*>( - // 2048 * 32, tensor_sizes, grouped_tensor_pointers, functor, deviceOutput.get()); - - // Copy GPU result in deviceOutput to CPU memory. - // Per this operator's schema, it's output is in CPU memory. - Tensor& output = *context->Output(0, {}); - HIP_RETURN_IF_ERROR( - hipMemcpy( - output.MutableData(), - deviceOutput.get(), - sizeof(bool), - hipMemcpyDeviceToHost)); - - return Status::OK(); -} - -REGISTER_ISALLFINITE_KERNEL_TYPED(MLFloat16) -REGISTER_ISALLFINITE_KERNEL_TYPED(float) -REGISTER_ISALLFINITE_KERNEL_TYPED(double) - -} // namespace rocm -} // namespace onnxruntime diff --git a/orttraining/orttraining/training_ops/rocm/math/isfinite.cuh b/orttraining/orttraining/training_ops/rocm/math/isfinite.cuh deleted file mode 100644 index 0b956569d63a5..0000000000000 --- a/orttraining/orttraining/training_ops/rocm/math/isfinite.cuh +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include -#include "core/providers/rocm/cu_inc/common.cuh" -#include "orttraining/training_ops/rocm/math/isfinite.h" - -namespace onnxruntime { -namespace rocm { - -template -__device__ __forceinline__ bool _IsFiniteScalar(const T value) { - return isfinite(value); -} - -template<> -__device__ __forceinline__ bool _IsFiniteScalar(const half value) { - return !__hisinf(value) && !__hisnan(value); -} - -} // namespace rocm -} // namespace onnxruntime \ No newline at end of file diff --git a/orttraining/orttraining/training_ops/rocm/math/isfinite.h b/orttraining/orttraining/training_ops/rocm/math/isfinite.h deleted file mode 100644 index b3f93d66e6b4e..0000000000000 --- a/orttraining/orttraining/training_ops/rocm/math/isfinite.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once -#include "core/common/common.h" -#include "core/framework/op_kernel.h" -#include "core/providers/rocm/rocm_common.h" -#include "core/providers/rocm/multi_tensor/common.cuh" - -constexpr int PARALLEL_LOADS = 4; -constexpr int WARP_THREAD_COUNT = 32; -constexpr int MAX_BLOCK_COUNT = 288; -constexpr int MAX_TENSOR_COUNT = 128; -constexpr int MAX_BLOCK_THREAD_COUNT = 512; - -namespace onnxruntime { -namespace rocm { - -template -void IsFinite(const TSrc* input, bool* output, size_t count); - -template -class IsFiniteOp final : public RocmKernel { - public: - IsFiniteOp(const OpKernelInfo& info) : RocmKernel(info) { - } - - Status ComputeInternal(OpKernelContext* context) const override; -}; - -template -void IsFinite(const TSrc* input, bool* output, size_t N); - -template -class IsAllFiniteOp final : public RocmKernel { - public: - IsAllFiniteOp(const OpKernelInfo& info) : RocmKernel(info) { - } - - Status ComputeInternal(OpKernelContext* context) const override; -}; - -template -struct IsAllFiniteFunctor { - void operator()(ChunkGroup<1> chunks, bool* output); -}; - -} // namespace rocm -} // namespace onnxruntime \ No newline at end of file diff --git a/tools/ci_build/amd_hipify.py b/tools/ci_build/amd_hipify.py index bf26506cb0a7a..52d65bead2a22 100644 --- a/tools/ci_build/amd_hipify.py +++ b/tools/ci_build/amd_hipify.py @@ -253,9 +253,6 @@ 'math/div_grad.h', 'math/div_grad_impl.cu', 'math/div_grad_impl.h', - 'math/isfinite.cc', - 'math/isfinite.cuh', - 'math/isfinite.h', 'math/scale.cc', 'math/scale.cu', 'math/scale.h', From 86e30a2db6f02ab4d2b92800fbf398f7ea641978 Mon Sep 17 00:00:00 2001 From: Jesse Benson Date: Wed, 18 Nov 2020 11:27:50 -0800 Subject: [PATCH 07/10] Update CUDA IsAllFinite kernel --- .../core/graph/optimizer_graph_builder.cc | 2 +- .../core/graph/training_op_defs.cc | 6 ++++- .../training_ops/cuda/math/isfinite.cc | 25 ++++++------------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/orttraining/orttraining/core/graph/optimizer_graph_builder.cc b/orttraining/orttraining/core/graph/optimizer_graph_builder.cc index 4925b009a9bba..465a6af8f0948 100644 --- a/orttraining/orttraining/core/graph/optimizer_graph_builder.cc +++ b/orttraining/orttraining/core/graph/optimizer_graph_builder.cc @@ -348,7 +348,7 @@ Status OptimizerGraphBuilder::AddFiniteGradientCheck( ArgDef& grad_norm_finite_argdef, const std::string& node_name) { const TypeProto* const grad_norm_finite_type = - graph_defs.CreateTypeProto({1}, ONNX_NAMESPACE::TensorProto_DataType_BOOL); + graph_defs.CreateTypeProto({}, ONNX_NAMESPACE::TensorProto_DataType_BOOL); grad_norm_finite_argdef = ArgDef{nodearg_name_generator(node_name), grad_norm_finite_type}; diff --git a/orttraining/orttraining/core/graph/training_op_defs.cc b/orttraining/orttraining/core/graph/training_op_defs.cc index 6130afb64c677..6585940feb8cc 100644 --- a/orttraining/orttraining/core/graph/training_op_defs.cc +++ b/orttraining/orttraining/core/graph/training_op_defs.cc @@ -1843,7 +1843,11 @@ Example 4: "The output scalar. Its value is true if all input " "tensors are finite. Otherwise, the output value would " "be false.", - "T"); + "T") + .TypeAndShapeInferenceFunction([](ONNX_NAMESPACE::InferenceContext& ctx) { + updateOutputShape(ctx, 0, {}); + updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::BOOL); + }); static const char* All_doc = R"DOC( Return true if all elements are true and false otherwise. diff --git a/orttraining/orttraining/training_ops/cuda/math/isfinite.cc b/orttraining/orttraining/training_ops/cuda/math/isfinite.cc index 749a50da2b072..e0ecf15dd2347 100644 --- a/orttraining/orttraining/training_ops/cuda/math/isfinite.cc +++ b/orttraining/orttraining/training_ops/cuda/math/isfinite.cc @@ -44,7 +44,6 @@ REGISTER_ISFINITE_KERNEL_TYPED(double) T, \ kCudaExecutionProvider, \ KernelDefBuilder() \ - .OutputMemoryType(0) \ .TypeConstraint("V", DataTypeImpl::GetTensorType()) \ .TypeConstraint("T", DataTypeImpl::GetTensorType()), \ IsAllFiniteOp); @@ -56,11 +55,11 @@ Status IsAllFiniteOp::ComputeInternal(OpKernelContext* context) const { // Get Input tensor count. const auto total_tensor_count = context->InputCount(); - // Allocate GPU memory to capture the result computed by GPU kernel. - // The GPU result will be copied later to the output which locates - // on CPU memory. - IAllocatorUniquePtr deviceOutput = GetScratchBuffer(1); - CUDA_RETURN_IF_ERROR(cudaMemsetAsync(deviceOutput.get(), int(true), sizeof(bool))); + // Initialize the output to true. GPU kernel will set it to false + // if any value in any tensor is non-finite. + Tensor& output = *context->Output(0, {}); + auto output_data = reinterpret_cast::MappedType*>(output.template MutableData()); + CUDA_RETURN_IF_ERROR(cudaMemsetAsync(output_data, int(true), sizeof(bool))); std::vector> grouped_tensor_pointers(total_tensor_count); std::vector tensor_sizes(total_tensor_count); @@ -74,20 +73,10 @@ Status IsAllFiniteOp::ComputeInternal(OpKernelContext* context) const { typedef IsAllFiniteFunctor TFunctor; TFunctor functor; - // Check if all values are finite and write true to deviceOutput. + // Check if all values are finite and write true to output. // Otherwise, false will be written. launch_multi_tensor_functor<1, TFunctor, bool*>( - 2048 * 32, tensor_sizes, grouped_tensor_pointers, functor, deviceOutput.get()); - - // Copy GPU result in deviceOutput to CPU memory. - // Per this operator's schema, it's output is in CPU memory. - Tensor& output = *context->Output(0, {}); - CUDA_RETURN_IF_ERROR( - cudaMemcpy( - output.MutableData(), - deviceOutput.get(), - sizeof(bool), - cudaMemcpyDeviceToHost)); + 2048 * 32, tensor_sizes, grouped_tensor_pointers, functor, output_data); return Status::OK(); } From 45966d878ad425750f213cb5808e6bb49ea8b4f4 Mon Sep 17 00:00:00 2001 From: Jesse Benson Date: Wed, 18 Nov 2020 14:08:39 -0800 Subject: [PATCH 08/10] Code review feedback --- orttraining/orttraining/training_ops/cuda/math/isfinite.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orttraining/orttraining/training_ops/cuda/math/isfinite.cc b/orttraining/orttraining/training_ops/cuda/math/isfinite.cc index e0ecf15dd2347..c341cf64fe365 100644 --- a/orttraining/orttraining/training_ops/cuda/math/isfinite.cc +++ b/orttraining/orttraining/training_ops/cuda/math/isfinite.cc @@ -55,10 +55,10 @@ Status IsAllFiniteOp::ComputeInternal(OpKernelContext* context) const { // Get Input tensor count. const auto total_tensor_count = context->InputCount(); - // Initialize the output to true. GPU kernel will set it to false - // if any value in any tensor is non-finite. + // Initialize the output to true. GPU kernel will set it + // to false if any value in any tensor is non-finite. Tensor& output = *context->Output(0, {}); - auto output_data = reinterpret_cast::MappedType*>(output.template MutableData()); + auto* output_data = reinterpret_cast::MappedType*>(output.template MutableData()); CUDA_RETURN_IF_ERROR(cudaMemsetAsync(output_data, int(true), sizeof(bool))); std::vector> grouped_tensor_pointers(total_tensor_count); From 1852ade75dc57ad37834a92f57277819c2b142e3 Mon Sep 17 00:00:00 2001 From: Wenbing Li <10278425+wenbingl@users.noreply.github.com> Date: Mon, 30 Nov 2020 11:22:08 -0800 Subject: [PATCH 09/10] Enable the xcode build for Apple Silicon (arm64 MacOS) (#5924) * fix the build script for macos/xcode * add the version check * correct the osx-arch configuration * typo --- .gitignore | 1 + cmake/onnxruntime_mlas.cmake | 18 +++++++++--------- tools/ci_build/build.py | 20 ++++++++++++++------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index bcca060ab44a7..99dc66b819b11 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ cmake-build-debug gen *~ .vs +.DS_Store TestResults/ .idea/ onnxruntime.egg-info diff --git a/cmake/onnxruntime_mlas.cmake b/cmake/onnxruntime_mlas.cmake index 40afbfe11b87a..0e247e13868b3 100644 --- a/cmake/onnxruntime_mlas.cmake +++ b/cmake/onnxruntime_mlas.cmake @@ -124,6 +124,15 @@ if(MSVC) ) endif() else() + if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") + set(ARM64 TRUE) + elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "arm") + set(ARM TRUE) + elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64") + set(X86_64 TRUE) + elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "i386") + set(X86 TRUE) + endif() if (CMAKE_SYSTEM_NAME STREQUAL "Android") if (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a") set(ARM TRUE) @@ -136,15 +145,6 @@ else() endif() elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "iOSCross") set(IOS TRUE) - if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") - set(ARM64 TRUE) - elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "arm") - set(ARM TRUE) - elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64") - set(X86_64 TRUE) - elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "i386") - set(X86 TRUE) - endif() else() execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpmachine diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 4a34919889de1..3b02bac3aa7d0 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -10,9 +10,10 @@ import subprocess import sys import hashlib +import platform from logger import get_logger from amd_hipify import amd_hipify - +from distutils.version import StrictVersion SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) REPO_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, "..", "..")) @@ -285,7 +286,9 @@ def parse_arguments(): "--use_xcode", action='store_true', help="Use Xcode as cmake generator, this is only supported on MacOS.") parser.add_argument( - "--osx_arch", default="arm64", choices=["arm64", "x86_64"], + "--osx_arch", + default="arm64" if platform.machine() == "arm64" else "x86_64", + choices=["arm64", "x86_64"], help="Specify the Target specific architectures for macOS and iOS, This is only supported on MacOS") parser.add_argument( "--apple_deploy_target", type=str, @@ -845,6 +848,13 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home if args.android_cpp_shared: cmake_args += ["-DANDROID_STL=c++_shared"] + if is_macOS() and not args.android: + cmake_args += ["-DCMAKE_OSX_ARCHITECTURES=" + args.osx_arch] + # since cmake 3.19, it uses the xcode latest buildsystem, which is not supported by this project. + cmake_verstr = subprocess.check_output(['cmake', '--version']).decode('utf-8').split()[2] + if args.use_xcode and StrictVersion(cmake_verstr) >= StrictVersion('3.19.0'): + cmake_args += ["-T", "buildsystem=1"] + if args.ios: if is_macOS(): needed_args = [ @@ -870,7 +880,6 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home "-DCMAKE_SYSTEM_NAME=iOS", "-Donnxruntime_BUILD_SHARED_LIB=ON", "-DCMAKE_OSX_SYSROOT=" + args.ios_sysroot, - "-DCMAKE_OSX_ARCHITECTURES=" + args.osx_arch, "-DCMAKE_OSX_DEPLOYMENT_TARGET=" + args.apple_deploy_target, # we do not need protoc binary for ios cross build "-Dprotobuf_BUILD_PROTOC_BINARIES=OFF", @@ -1724,9 +1733,8 @@ def build_protoc_for_host(cmake_path, source_dir, build_dir, args): # CMake < 3.18 has a bug setting system arch to arm64 (if not specified) for Xcode 12, # protoc for host should be built using host architecture # Explicitly specify the CMAKE_OSX_ARCHITECTURES for x86_64 Mac. - import platform - if platform.machine() == 'x86_64': - cmd_args += ['-DCMAKE_OSX_ARCHITECTURES=x86_64'] + cmd_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format( + 'arm64' if platform.machine() == 'arm64' else 'x86_64')] run_subprocess(cmd_args, cwd=protoc_build_dir) # Build step From 2d9dcc4576f86b3eb6705dba1f8699eb52140b4e Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Mon, 30 Nov 2020 12:02:48 -0800 Subject: [PATCH 10/10] Add python 3.9 support (#5874) 1. Add python 3.9 support(except Linux ARM) 2. Add Windows GPU python 3.8 to our packaging pipeline. --- cgmanifests/cgmanifest.json | 14 +++--- cgmanifests/submodules/cgmanifest.json | 44 ++++++++++++++++++ .../generate_submodule_cgmanifest.py | 46 ++++++++++++++++++- cmake/external/pybind11.cmake | 4 +- .../runtest-docker-gpu.sh | 2 +- .../runtest-docker.sh | 2 +- onnxruntime/python/_pybind_state.py | 6 +-- .../c-api-packaging-pipelines.yml | 4 +- .../java-api-packaging-pipelines-gpu.yml | 4 +- .../java-api-packaging-pipelines.yml | 2 +- .../azure-pipelines/linux-ci-pipeline.yml | 2 +- .../linux-cpu-minimal-build-ci-pipeline.yml | 8 ++-- .../linux-dnnl-ci-pipeline.yml | 2 +- .../azure-pipelines/linux-gpu-ci-pipeline.yml | 6 +-- .../linux-gpu-cuda-11-pipeline.yml | 2 +- .../linux-multi-gpu-ci-pipeline.yml | 2 +- .../linux-nocontribops-ci-pipeline.yml | 2 +- .../azure-pipelines/nodejs/templates/cpu.yml | 2 +- .../nuget/templates/cpu-mklml.yml | 2 +- .../templates/cpu-nocontribops-arm64.yml | 2 +- .../nuget/templates/cpu-noopenmp.yml | 2 +- .../azure-pipelines/nuget/templates/cpu.yml | 2 +- .../azure-pipelines/nuget/templates/gpu.yml | 2 +- .../orttraining-linux-ci-pipeline.yml | 2 +- .../templates/py-packaging-stage.yml | 26 +++++++++-- .../set-py-packaging-variables-step.yml | 5 ++ .../manylinux2014_build_scripts/build.sh | 38 +++++++++++---- .../manylinux2014_build_scripts/build_env.sh | 20 ++++---- .../build_utils.sh | 10 ++-- .../python-tag-abi-tag.py | 7 ++- ...equirements.txt => requirements-tools.txt} | 13 +++--- .../requirements.txt | 18 ++++---- .../docker/scripts/manylinux/install_deps.sh | 2 +- 33 files changed, 223 insertions(+), 82 deletions(-) rename tools/ci_build/github/linux/docker/manylinux2014_build_scripts/{py37-requirements.txt => requirements-tools.txt} (50%) diff --git a/cgmanifests/cgmanifest.json b/cgmanifests/cgmanifest.json index c49817e675350..3850e8c909279 100644 --- a/cgmanifests/cgmanifest.json +++ b/cgmanifests/cgmanifest.json @@ -343,7 +343,7 @@ "component": { "type": "git", "git": { - "commitHash": "f97fd8664fa824e5d081d776cf4a811dbf09bca4", + "commitHash": "bc8ce45b35ade9b8f08d88d4d9fdfd12b4f6f310", "repositoryUrl": "https://github.com/pypa/manylinux" }, "comments": "For building our CI build docker image" @@ -363,20 +363,20 @@ "component": { "type": "git", "git": { - "commitHash": "439c93d51f45c50541fc755b597725168ecd939a", + "commitHash": "9cf6752276e6fcfd0c23fdb064ad27f448aaaf75", "repositoryUrl": "https://github.com/python/cpython" }, - "comments": "Python 3.9.0rc1" + "comments": "Python 3.9.0" } }, { "component": { "type": "git", "git": { - "commitHash": "580fbb018fd0844806119614d752b41fc69660f9", + "commitHash": "db455296be5f792b8c12b7cd7f3962b52e4f44ee", "repositoryUrl": "https://github.com/python/cpython" }, - "comments": "Python 3.8.5" + "comments": "Python 3.8.6" } }, { @@ -403,10 +403,10 @@ "component": { "type": "git", "git": { - "commitHash": "e5f6aba872e66bfd86eb592214696a519cded197", + "commitHash": "426b022776672fdf3d71ddd98d89af341c88080f", "repositoryUrl": "https://github.com/python/cpython" }, - "comments": "Python 3.5.9" + "comments": "Python 3.5.10" } }, { diff --git a/cgmanifests/submodules/cgmanifest.json b/cgmanifests/submodules/cgmanifest.json index 5c230d1183c0c..8d0b02067b0a4 100644 --- a/cgmanifests/submodules/cgmanifest.json +++ b/cgmanifests/submodules/cgmanifest.json @@ -1,6 +1,50 @@ { "Version": 1, "Registrations": [ + { + "Component": { + "Type": "other", + "other": { + "Name": "automake", + "Version": "1.16.2", + "DownloadUrl": "http://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz" + }, + "comments": "manylinux dependency" + } + }, + { + "Component": { + "Type": "other", + "other": { + "Name": "libtool", + "Version": "2.4.6", + "DownloadUrl": "http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz" + }, + "comments": "manylinux dependency" + } + }, + { + "Component": { + "Type": "other", + "other": { + "Name": "sqlite", + "Version": "3330000", + "DownloadUrl": "https://www.sqlite.org/2020/sqlite-autoconf-3330000.tar.gz" + }, + "comments": "manylinux dependency" + } + }, + { + "Component": { + "Type": "other", + "other": { + "Name": "git", + "Version": "2.29.1", + "DownloadUrl": "https://www.kernel.org/pub/software/scm/git/git-2.29.1.tar.gz" + }, + "comments": "manylinux dependency" + } + }, { "component": { "type": "git", diff --git a/cgmanifests/submodules/generate_submodule_cgmanifest.py b/cgmanifests/submodules/generate_submodule_cgmanifest.py index b75f8792a9dcf..a1ee7d909e5bb 100644 --- a/cgmanifests/submodules/generate_submodule_cgmanifest.py +++ b/cgmanifests/submodules/generate_submodule_cgmanifest.py @@ -4,10 +4,54 @@ import os import subprocess import sys +import re SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) REPO_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, "..", "..")) +package_name = None +package_filename = None +package_url = None + +registrations = [] + +with open(os.path.join(REPO_DIR,'tools','ci_build','github','linux','docker','manylinux2014_build_scripts','build_env.sh'), "r") as f: + for line in f: + if not line.strip(): + package_name = None + package_filename = None + package_url = None + if package_filename is None: + m = re.match("(.+?)_ROOT=(.*)$",line) + if m != None: + package_name = m.group(1) + package_filename = m.group(2) + else: + m = re.match("(.+?)_AUTOCONF_VERSION=(.*)$",line) + if m != None: + package_name = m.group(1) + package_filename = m.group(2) + elif package_url is None: + m = re.match("(.+?)_DOWNLOAD_URL=(.+)$",line) + if m != None: + package_url = m.group(2) + "/" + package_filename + ".tar.gz" + registration = { + "Component": { + "Type": "other", + "other": { + "Name": package_name.lower(), + "Version": package_filename.split("-")[-1], + "DownloadUrl": package_url, + }, + "comments": "manylinux dependency" + } + } + registrations.append(registration) + package_name = None + package_filename = None + package_url = None + + proc = subprocess.run( ["git", "submodule", "foreach", "--quiet", "--recursive", "{} {} $toplevel/$sm_path".format( sys.executable, os.path.join(SCRIPT_DIR, "print_submodule_info.py"))], @@ -17,7 +61,7 @@ stderr=subprocess.PIPE, universal_newlines=True) -registrations = [] + submodule_lines = proc.stdout.splitlines() for submodule_line in submodule_lines: (absolute_path, url, commit) = submodule_line.split(" ") diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index 5d19c82f82a20..ee2fb29ab0661 100644 --- a/cmake/external/pybind11.cmake +++ b/cmake/external/pybind11.cmake @@ -8,7 +8,7 @@ if(NOT TARGET pybind11::module) set(pybind11_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/pybind11/src/pybind11/include) set(pybind11_URL https://github.com/pybind/pybind11.git) - set(pybind11_TAG v2.4.0) + set(pybind11_TAG v2.6.1) ExternalProject_Add(pybind11 PREFIX pybind11 @@ -21,4 +21,4 @@ if(NOT TARGET pybind11::module) set(pybind11_dep pybind11) else() set(pybind11_lib pybind11::module) -endif() \ No newline at end of file +endif() diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh index c3e3c0e54d9c5..2daad11cba700 100755 --- a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh +++ b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh @@ -27,6 +27,6 @@ docker run --gpus all --rm \ -e "PackageName=$PackageName" \ -e "RunTestCsharp=$RunTestCsharp" \ -e "RunTestNative=$RunTestNative" \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:ch4 \ /bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \ /home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $CurrentOnnxRuntimeVersion diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh index 35a7af89eeb22..7d533aedbbc95 100755 --- a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh +++ b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh @@ -35,6 +35,6 @@ docker run --rm \ -e "DisableMlOps=$DISABLEMLOPS" \ -e "RunTestCsharp=$RunTestCsharp" \ -e "RunTestNative=$RunTestNative" \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ /bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \ /home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $CurrentOnnxRuntimeVersion diff --git a/onnxruntime/python/_pybind_state.py b/onnxruntime/python/_pybind_state.py index 4f0a243899dad..6a398dd52d36f 100644 --- a/onnxruntime/python/_pybind_state.py +++ b/onnxruntime/python/_pybind_state.py @@ -16,10 +16,10 @@ CUDNN_VERSION = "8" cuda_env_variable = "CUDA_PATH_V" + CUDA_VERSION.replace(".", "_") if cuda_env_variable not in os.environ: - raise ImportError(f"CUDA Toolkit {CUDA_VERSION} not installed on the machine.") + raise ImportError("CUDA Toolkit %s not installed on the machine." % CUDA_VERSION) cuda_bin_dir = os.path.join(os.environ[cuda_env_variable], "bin") - if not os.path.isfile(os.path.join(cuda_bin_dir, f"cudnn64_{CUDNN_VERSION}.dll")): - raise ImportError(f"cuDNN {CUDNN_VERSION} not installed on the machine.") + if not os.path.isfile(os.path.join(cuda_bin_dir, "cudnn64_%s.dll" % CUDNN_VERSION)): + raise ImportError("cuDNN %s not installed on the machine." % CUDNN_VERSION) os.add_dll_directory(cuda_bin_dir) try: diff --git a/tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml b/tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml index c8906b7f63758..c6f40af9d0d3a 100644 --- a/tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml @@ -18,7 +18,7 @@ jobs: script: | mkdir -p $HOME/.onnx docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro \ - --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 python3 \ + --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr python3 \ /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release \ --skip_submodule_sync --parallel --build_shared_lib --use_openmp workingDirectory: $(Build.SourcesDirectory) @@ -58,7 +58,7 @@ jobs: script: | mkdir -p $HOME/.onnx docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build \ - --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 \ + --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq \ python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release \ --skip_submodule_sync --parallel --build_shared_lib --use_cuda --cuda_version=10.2 --cuda_home=/usr/local/cuda-10.2 --cudnn_home=/usr/local/cuda-10.2 workingDirectory: $(Build.SourcesDirectory) diff --git a/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines-gpu.yml b/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines-gpu.yml index be320cc43c161..fd641226b61df 100644 --- a/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines-gpu.yml @@ -24,7 +24,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_java --build_shared_lib --use_cuda --cuda_version=10.2 --cuda_home=/usr/local/cuda-10.2 --cudnn_home=/usr/local/cuda-10.2 + docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_java --build_shared_lib --use_cuda --cuda_version=10.2 --cuda_home=/usr/local/cuda-10.2 --cudnn_home=/usr/local/cuda-10.2 workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 displayName: logout @@ -258,7 +258,7 @@ jobs: - task: CmdLine@2 inputs: script: | - docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -v $(OnnxRuntimeVersion) -r /build + docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -v $(OnnxRuntimeVersion) -r /build workingDirectory: $(Build.BinariesDirectory)/final-jar - task: Docker@2 diff --git a/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines.yml b/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines.yml index 7141606b646c9..d1f7750b477da 100644 --- a/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/java-api-packaging-pipelines.yml @@ -26,7 +26,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --build_java --use_openmp --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" + docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --build_java --use_openmp --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" workingDirectory: $(Build.SourcesDirectory) displayName: 'Run build and test' - task: Docker@2 diff --git a/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml index c4caa77ea9d90..b1f406ec11a84 100644 --- a/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml @@ -28,7 +28,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Debug Release \ diff --git a/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml index da6df9c648558..1ddc3a1527db5 100644 --- a/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml @@ -39,7 +39,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=1 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ /bin/bash /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_full_ort_and_create_ort_files.sh workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 @@ -54,7 +54,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=1 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Debug\ @@ -76,7 +76,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=1 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ /bin/bash /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_minimal_ort_and_run_tests.sh workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 @@ -97,7 +97,7 @@ jobs: -e BUILD_ID=$(Build.BuildId) \ -e BUILD_REASON=$(Build.Reason) \ -e DASHBOARD_MYSQL_ORT_PASSWORD=$(dashboard-mysql-ort-password) \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ /bin/bash /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_minimal_ort_android_baseline_and_report_bin_size.sh workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 diff --git a/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml index c19f7cc74f4c4..387444c12f492 100644 --- a/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml @@ -27,7 +27,7 @@ jobs: --volume $HOME/.onnx:/home/onnxruntimedev/.onnx \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:ch1 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:chp \ /opt/python/cp37-cp37m/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build \ --config Debug Release \ diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml index 6bd46764ae157..5ccb002b92ea6 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml @@ -28,8 +28,8 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 \ - python3 /onnxruntime_src/tools/ci_build/build.py \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq \ + /opt/python/cp37-cp37m/bin/python /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Release \ --skip_submodule_sync \ @@ -38,7 +38,7 @@ jobs: --build_wheel \ --enable_onnx_tests --use_cuda --cuda_version=10.2 --cuda_home=/usr/local/cuda-10.2 --cudnn_home=/usr/local/cuda-10.2 \ --enable_pybind --build_java --build_nodejs \ - --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=52 + --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=52 PYTHON_INCLUDE_DIR=/opt/python/cp37-cp37m/include/python3.7m PYTHON_LIBRARY=/usr/lib64/librt.so workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 displayName: logout diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-cuda-11-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-cuda-11-pipeline.yml index 8f9805904f4ef..1fe34ae462730 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-cuda-11-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-cuda-11-pipeline.yml @@ -28,7 +28,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecuda11build:ch5 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecuda11build:chs \ /opt/python/cp37-cp37m/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Debug Release \ diff --git a/tools/ci_build/github/azure-pipelines/linux-multi-gpu-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-multi-gpu-ci-pipeline.yml index f00150adaab01..ab9d6e6d1fb1b 100644 --- a/tools/ci_build/github/azure-pipelines/linux-multi-gpu-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-multi-gpu-ci-pipeline.yml @@ -27,7 +27,7 @@ jobs: --volume $HOME/.onnx:/home/onnxruntimedev/.onnx \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq \ python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Debug Release \ diff --git a/tools/ci_build/github/azure-pipelines/linux-nocontribops-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-nocontribops-ci-pipeline.yml index 5fbff7c72bf44..e70abc7baa65d 100644 --- a/tools/ci_build/github/azure-pipelines/linux-nocontribops-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-nocontribops-ci-pipeline.yml @@ -28,7 +28,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr \ python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Debug Release \ diff --git a/tools/ci_build/github/azure-pipelines/nodejs/templates/cpu.yml b/tools/ci_build/github/azure-pipelines/nodejs/templates/cpu.yml index e6912af3ef8a1..f621c82cc5d70 100644 --- a/tools/ci_build/github/azure-pipelines/nodejs/templates/cpu.yml +++ b/tools/ci_build/github/azure-pipelines/nodejs/templates/cpu.yml @@ -48,7 +48,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx && docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro \ - --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 /bin/bash -c "python3 \ + --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr /bin/bash -c "python3 \ /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --build_nodejs \ --skip_submodule_sync --parallel --build_shared_lib --use_openmp && cd /onnxruntime_src/nodejs && npm pack" workingDirectory: $(Build.SourcesDirectory) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-mklml.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-mklml.yml index 81529acca5c2e..cc4a3d973fe85 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-mklml.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-mklml.yml @@ -40,7 +40,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --use_openmp --enable_onnx_tests --use_mklml && cd /build/Release && make install DESTDIR=/build/linux-x64" + docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --use_openmp --enable_onnx_tests --use_mklml && cd /build/Release && make install DESTDIR=/build/linux-x64" workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 displayName: logout diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-nocontribops-arm64.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-nocontribops-arm64.yml index 69f4053c3e2a3..cd6aeb10cdbbb 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-nocontribops-arm64.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-nocontribops-arm64.yml @@ -82,7 +82,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --enable_onnx_tests --disable_contrib_ops --disable_ml_ops && cd /build/Release && make install DESTDIR=/build/linux-x64" + docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --enable_onnx_tests --disable_contrib_ops --disable_ml_ops && cd /build/Release && make install DESTDIR=/build/linux-x64" workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 displayName: logout diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-noopenmp.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-noopenmp.yml index 9433b6d1a82a7..cf639c1be36d7 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-noopenmp.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu-noopenmp.yml @@ -109,7 +109,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" + docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 displayName: logout diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml index 96f9767795928..c328ba8d661cc 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml @@ -105,7 +105,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:ch3 /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --use_openmp --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" + docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chr /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --use_openmp --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" workingDirectory: $(Build.SourcesDirectory) - task: Docker@2 displayName: logout diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml index 7fc6545265750..7df9055d84600 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml @@ -89,7 +89,7 @@ jobs: inputs: script: | mkdir -p $HOME/.onnx - docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecentosgpubuild:ch4 \ + docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq \ /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --use_cuda --cuda_version=10.2 --cuda_home=/usr/local/cuda-10.2 --cudnn_home=/usr/local/cuda-10.2 --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64" - task: Docker@2 displayName: logout diff --git a/tools/ci_build/github/azure-pipelines/orttraining-linux-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/orttraining-linux-ci-pipeline.yml index d68b704943db4..f7937dae74a29 100644 --- a/tools/ci_build/github/azure-pipelines/orttraining-linux-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/orttraining-linux-ci-pipeline.yml @@ -28,7 +28,7 @@ jobs: -e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:ch1 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:chp \ /opt/python/cp37-cp37m/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Debug Release \ diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 8ef379aac0869..57ecb427462a5 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -79,6 +79,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' steps: - checkout: self clean: true @@ -104,7 +106,7 @@ stages: --volume $HOME/.onnx:/home/onnxruntimedev/.onnx \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:ch1 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:chp \ $(python.manylinux.dir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Release \ @@ -156,6 +158,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' steps: - checkout: self clean: true @@ -181,7 +185,7 @@ stages: --volume $HOME/.onnx:/home/onnxruntimedev/.onnx \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:ch1 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimecpubuild:chp \ $(python.manylinux.dir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Release \ @@ -234,6 +238,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' steps: - checkout: self clean: true @@ -259,7 +265,7 @@ stages: --volume $HOME/.onnx:/home/onnxruntimedev/.onnx \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:ch2 \ + onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntimegpubuild:chq \ $(python.manylinux.dir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Release \ @@ -310,6 +316,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' steps: - checkout: self clean: true @@ -385,6 +393,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' variables: OrtPackageId: 'Microsoft.ML.OnnxRuntime' MsbuildArguments: '-maxcpucount' @@ -513,6 +523,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' variables: OrtPackageId: 'Microsoft.ML.OnnxRuntime' MsbuildArguments: '-maxcpucount' @@ -646,6 +658,10 @@ stages: python.version: '3.6' Python37: python.version: '3.7' + Python38: + python.version: '3.8' + Python39: + python.version: '3.9' steps: - checkout: self clean: true @@ -765,6 +781,8 @@ stages: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' steps: - checkout: self clean: true @@ -816,6 +834,8 @@ stages: pool: 'Linux-CPU' strategy: matrix: + Py38: + python.version: '3.8' Py37: python.version: '3.7' Py36: diff --git a/tools/ci_build/github/azure-pipelines/templates/set-py-packaging-variables-step.yml b/tools/ci_build/github/azure-pipelines/templates/set-py-packaging-variables-step.yml index 6d2e94009f34a..2af5421520e0e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/set-py-packaging-variables-step.yml +++ b/tools/ci_build/github/azure-pipelines/templates/set-py-packaging-variables-step.yml @@ -28,6 +28,11 @@ steps: "python.manylinux.dir": "/opt/python/cp38-cp38", "python.manylinux.include.dir": "/opt/python/cp38-cp38/include/python3.8", } + elif version == "3.9": + variables = { + "python.manylinux.dir": "/opt/python/cp39-cp39", + "python.manylinux.include.dir": "/opt/python/cp39-cp39/include/python3.9", + } else: raise ValueError("Unsupported Python version: '{}'".format(version)) diff --git a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build.sh b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build.sh index 0515890abb6db..816a0cdf9142a 100755 --- a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build.sh +++ b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build.sh @@ -30,6 +30,8 @@ PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel expat-devel ncurses-devel readline-d # Install development packages (except for libgcc which is provided by gcc install) MANYLINUX_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel" +CMAKE_DEPS="openssl-devel zlib-devel libcurl-devel" + # Get build utilities source $MY_DIR/build_utils.sh @@ -93,7 +95,8 @@ yum -y install \ unzip \ which \ ${YASM} \ - ${PYTHON_COMPILE_DEPS} + ${PYTHON_COMPILE_DEPS} \ + ${CMAKE_DEPS} # Install git build_git $GIT_ROOT $GIT_HASH @@ -117,6 +120,17 @@ cd .. rm -rf $SQLITE_AUTOCONF_VERSION* rm /usr/local/lib/libsqlite3.a +# Install a recent version of cmake3 +curl -L -O $CMAKE_DOWNLOAD_URL/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz +check_sha256sum cmake-${CMAKE_VERSION}.tar.gz $CMAKE_HASH +tar -xzf cmake-${CMAKE_VERSION}.tar.gz +cd cmake-${CMAKE_VERSION} +./bootstrap --system-curl --parallel=$(nproc) +make -j$(nproc) +make install +cd .. +rm -rf cmake-${CMAKE_VERSION} + # Install libcrypt.so.1 and libcrypt.so.2 build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH" @@ -127,27 +141,33 @@ build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH" mkdir -p /opt/python build_cpythons $CPYTHON_VERSIONS -PY37_BIN=/opt/python/cp37-cp37m/bin +# Create venv for auditwheel & certifi +TOOLS_PATH=/opt/_internal/tools +/opt/python/cp37-cp37m/bin/python -m venv $TOOLS_PATH +source $TOOLS_PATH/bin/activate +# Install default packages +pip install -U --require-hashes -r $MY_DIR/requirements.txt # Install certifi and auditwheel -$PY37_BIN/pip install --require-hashes -r $MY_DIR/py37-requirements.txt +pip install -U --require-hashes -r $MY_DIR/requirements-tools.txt + +# Make auditwheel available in PATH +ln -s $TOOLS_PATH/bin/auditwheel /usr/local/bin/auditwheel # Our openssl doesn't know how to find the system CA trust store # (https://github.com/pypa/manylinux/issues/53) # And it's not clear how up-to-date that is anyway # So let's just use the same one pip and everyone uses -ln -s $($PY37_BIN/python -c 'import certifi; print(certifi.where())') \ - /opt/_internal/certs.pem -# If you modify this line you also have to modify the versions in the -# Dockerfiles: +ln -s $(python -c 'import certifi; print(certifi.where())') /opt/_internal/certs.pem +# If you modify this line you also have to modify the versions in the Dockerfiles: export SSL_CERT_FILE=/opt/_internal/certs.pem +# Deactivate the tools virtual environment +deactivate # Install patchelf (latest with unreleased bug fixes) and apply our patches build_patchelf $PATCHELF_VERSION $PATCHELF_HASH -ln -s $PY37_BIN/auditwheel /usr/local/bin/auditwheel - # Clean up development headers and other unnecessary stuff for # final image yum -y erase \ diff --git a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_env.sh b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_env.sh index 4ce58c012269d..4b8a18715e54d 100644 --- a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_env.sh +++ b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_env.sh @@ -2,7 +2,7 @@ PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python # of the form .. or ..rc -CPYTHON_VERSIONS="3.5.9 3.6.12 3.7.9 3.8.5 3.9.0rc1" +CPYTHON_VERSIONS="3.5.10 3.6.12 3.7.9 3.8.6 3.9.0" PATCHELF_VERSION=0.12 PATCHELF_HASH=3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56 @@ -15,14 +15,18 @@ LIBTOOL_ROOT=libtool-2.4.6 LIBTOOL_HASH=e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3 LIBTOOL_DOWNLOAD_URL=http://ftp.gnu.org/gnu/libtool -SQLITE_AUTOCONF_VERSION=sqlite-autoconf-3320300 -SQLITE_AUTOCONF_HASH=a31507123c1c2e3a210afec19525fd7b5bb1e19a6a34ae5b998fbd7302568b66 +SQLITE_AUTOCONF_VERSION=sqlite-autoconf-3330000 +SQLITE_AUTOCONF_HASH=106a2c48c7f75a298a7557bcc0d5f4f454e5b43811cc738b7ca294d6956bbb15 SQLITE_AUTOCONF_DOWNLOAD_URL=https://www.sqlite.org/2020 -LIBXCRYPT_VERSION=4.4.16 +CMAKE_VERSION=3.18.3 +CMAKE_HASH=2c89f4e30af4914fd6fb5d00f863629812ada848eee4e2d29ec7e456d7fa32e5 +CMAKE_DOWNLOAD_URL=https://github.com/Kitware/CMake/releases/download + +LIBXCRYPT_VERSION=4.4.17 LIBXCRYPT_DOWNLOAD_URL=https://codeload.github.com/besser82/libxcrypt/tar.gz -LIBXCRYPT_HASH=a98f65b8baffa2b5ba68ee53c10c0a328166ef4116bce3baece190c8ce01f375 +LIBXCRYPT_HASH=7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07 -GIT_ROOT=2.26.2 -GIT_HASH=21b48d1e7e03d0b325967e31a30f4fa878e4fbb6dac6e997b5dc3f41f950a6d3 -GIT_DOWNLOAD_URL=https://github.com/git/git/archive +GIT_ROOT=git-2.29.1 +GIT_HASH=728845a66103d8d1572a656123c2c09d7aa4c0ab8f4c3dc3911e14e18c85ee67 +GIT_DOWNLOAD_URL=https://www.kernel.org/pub/software/scm/git diff --git a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_utils.sh b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_utils.sh index bd3fbfb83bef8..5a36434e2c394 100755 --- a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_utils.sh +++ b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/build_utils.sh @@ -118,11 +118,11 @@ function build_git { local git_sha256=$2 check_var ${git_sha256} check_var ${GIT_DOWNLOAD_URL} - fetch_source v${git_fname}.tar.gz ${GIT_DOWNLOAD_URL} - check_sha256sum v${git_fname}.tar.gz ${git_sha256} - tar -xzf v${git_fname}.tar.gz - (cd git-${git_fname} && make -j$(nproc) install prefix=/usr/local NO_GETTEXT=1 NO_TCLTK=1 > /dev/null) - rm -rf git-${git_fname} v${git_fname}.tar.gz + fetch_source ${git_fname}.tar.gz ${GIT_DOWNLOAD_URL} + check_sha256sum ${git_fname}.tar.gz ${git_sha256} + tar -xzf ${git_fname}.tar.gz + (cd ${git_fname} && make -j$(nproc) install prefix=/usr/local NO_GETTEXT=1 NO_TCLTK=1 > /dev/null) + rm -rf ${git_fname} ${git_fname}.tar.gz } diff --git a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/python-tag-abi-tag.py b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/python-tag-abi-tag.py index 301fbf07a47fe..942394bbb0e84 100644 --- a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/python-tag-abi-tag.py +++ b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/python-tag-abi-tag.py @@ -2,6 +2,9 @@ # See PEP 425 for exactly what these are, but an example would be: # cp27-cp27mu -from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag +from wheel.vendored.packaging.tags import sys_tags -print("{0}{1}-{2}".format(get_abbr_impl(), get_impl_ver(), get_abi_tag())) + +# first tag is always the more specific tag +tag = next(sys_tags()) +print("{0}-{1}".format(tag.interpreter, tag.abi)) diff --git a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/py37-requirements.txt b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements-tools.txt similarity index 50% rename from tools/ci_build/github/linux/docker/manylinux2014_build_scripts/py37-requirements.txt rename to tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements-tools.txt index 91117cf56c796..44c6ded6eaf85 100644 --- a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/py37-requirements.txt +++ b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements-tools.txt @@ -1,13 +1,14 @@ -# pip requirements for cpython 3.7 +# pip requirements for tools # NOTE: certifi has GPG signatures; could download and verify independently. -certifi==2020.6.20 \ - --hash=sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41 \ - --hash=sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3 +certifi==2020.11.8 \ + --hash=sha256:1f422849db327d534e3d0c5f02a263458c3955ec0aae4ff09b95f195c59f4edd \ + --hash=sha256:f05def092c44fbf25834a51509ef6e631dc19765ab8a57b4e7ab85531f0a9cf4 auditwheel==3.2.0 \ --hash=sha256:374a42f5ed95aea02ce9e775bbc4abdf57e84054400bab063616f0ab9bb20ebe # these packages required for auditwheel -pyelftools==0.26 \ - --hash=sha256:cc0ea0de82b240a73ef4056fce44acbb4727dca7d66759371aff2bad457ed711 +pyelftools==0.27 \ + --hash=sha256:5609aa6da1123fccfae2e8431a67b4146aa7fad5b3889f808df12b110f230937 \ + --hash=sha256:cde854e662774c5457d688ca41615f6594187ba7067af101232df889a6b7a66b wheel==0.34.2 \ --hash=sha256:df277cb51e61359aba502208d680f90c0493adec6f0e848af94948778aed386e \ --hash=sha256:8788e9155fe14f54164c1b9eb0a319d98ef02c160725587ad60f14ddc57b6f96 diff --git a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements.txt b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements.txt index 53c0eab5198e1..166fdfc999c59 100644 --- a/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements.txt +++ b/tools/ci_build/github/linux/docker/manylinux2014_build_scripts/requirements.txt @@ -1,11 +1,11 @@ # pip requirements for all cpythons # NOTE: pip has GPG signatures; could download and verify independently. -pip==20.2 \ - --hash=sha256:d75f1fc98262dabf74656245c509213a5d0f52137e40e8f8ed5cc256ddd02923 \ - --hash=sha256:912935eb20ea6a3b5ed5810dde9754fde5563f5ca9be44a8a6e5da806ade970b -wheel==0.34.2 \ - --hash=sha256:df277cb51e61359aba502208d680f90c0493adec6f0e848af94948778aed386e \ - --hash=sha256:8788e9155fe14f54164c1b9eb0a319d98ef02c160725587ad60f14ddc57b6f96 -setuptools==49.2.1 \ - --hash=sha256:1a4299a49e3dfe2d79d774ec70746a97d54feacb283e8b689a2bef3eb62e0fe8 \ - --hash=sha256:88094d17c8d273390659a72e9d93374cd7bfd188c12bf2747b306e2bed48df18 +pip==20.2.4 \ + --hash=sha256:51f1c7514530bd5c145d8f13ed936ad6b8bfcb8cf74e10403d0890bc986f0033 \ + --hash=sha256:85c99a857ea0fb0aedf23833d9be5c40cf253fe24443f0829c7b472e23c364a1 +wheel==0.35.1 \ + --hash=sha256:497add53525d16c173c2c1c733b8f655510e909ea78cc0e29d374243544b77a2 \ + --hash=sha256:99a22d87add3f634ff917310a3d87e499f19e663413a52eb9232c447aa646c9f +setuptools==50.3.2 \ + --hash=sha256:2c242a0856fbad7efbe560df4a7add9324f340cf48df43651e9604924466794a \ + --hash=sha256:ed0519d27a243843b05d82a5e9d01b0b083d9934eaa3d02779a23da18077bd3c diff --git a/tools/ci_build/github/linux/docker/scripts/manylinux/install_deps.sh b/tools/ci_build/github/linux/docker/scripts/manylinux/install_deps.sh index 4f3a6b2085c33..ec5cd472028fe 100755 --- a/tools/ci_build/github/linux/docker/scripts/manylinux/install_deps.sh +++ b/tools/ci_build/github/linux/docker/scripts/manylinux/install_deps.sh @@ -38,7 +38,7 @@ function GetFile { if [ ! -d "/opt/python/cp35-cp35m" ]; then PYTHON_EXES=("/usr/bin/python3") else - PYTHON_EXES=("/opt/python/cp35-cp35m/bin/python3.5" "/opt/python/cp36-cp36m/bin/python3.6" "/opt/python/cp37-cp37m/bin/python3.7" "/opt/python/cp38-cp38/bin/python3.8") + PYTHON_EXES=("/opt/python/cp35-cp35m/bin/python3.5" "/opt/python/cp36-cp36m/bin/python3.6" "/opt/python/cp37-cp37m/bin/python3.7" "/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9") fi os_major_version=$(cat /etc/redhat-release | tr -dc '0-9.'|cut -d \. -f1)