mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix post merge jobs pipeline build issues (#14346)
- Fix debug node inputs outputs nullptr dereference with ONNX optional types. - Fix model test memory leak. - Convert jobs to stages in post-merge-jobs.yml to allow a subset of builds to be enabled when running manually. - Fix buffer overrun in CumSum op exposed by Mimalloc build.
This commit is contained in:
parent
ea7bbd667d
commit
ae0e090c7b
5 changed files with 204 additions and 179 deletions
|
|
@ -478,23 +478,26 @@ void DumpNodeInputs(
|
||||||
|
|
||||||
if (type) {
|
if (type) {
|
||||||
if (type->IsTensorType()) {
|
if (type->IsTensorType()) {
|
||||||
const auto& tensor = *context.Input<Tensor>(i);
|
if (const auto* tensor = context.Input<Tensor>(i); tensor != nullptr) {
|
||||||
const auto& shape = tensor.Shape();
|
const auto& shape = tensor->Shape();
|
||||||
|
|
||||||
const bool is_shape_set = (dump_options.dump_flags & NodeDumpOptions::DumpFlags::Shape) != 0;
|
const bool is_shape_set = (dump_options.dump_flags & NodeDumpOptions::DumpFlags::Shape) != 0;
|
||||||
PrintIf(is_shape_set, MakeString(" Shape: ", shape, "\n"));
|
PrintIf(is_shape_set, MakeString(" Shape: ", shape, "\n"));
|
||||||
|
|
||||||
if ((dump_options.dump_flags & NodeDumpOptions::DumpFlags::InputData) != 0) {
|
if ((dump_options.dump_flags & NodeDumpOptions::DumpFlags::InputData) != 0) {
|
||||||
tensor_metadata.name = input_defs[i]->Name();
|
tensor_metadata.name = input_defs[i]->Name();
|
||||||
tensor_metadata.step = dump_context.iteration;
|
tensor_metadata.step = dump_context.iteration;
|
||||||
tensor_metadata.consumer = node.Name() + ":" + std::to_string(i);
|
tensor_metadata.consumer = node.Name() + ":" + std::to_string(i);
|
||||||
DumpTensor(dump_options, tensor, tensor_metadata, session_state);
|
DumpTensor(dump_options, *tensor, tensor_metadata, session_state);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
std::cout << " is empty optional tensor.\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::cout << " is non-tensor type.\n";
|
std::cout << " is non-tensor type.\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// should never happen...
|
// this could happen with an empty Optional input
|
||||||
std::cout << " was missing data type\n";
|
std::cout << " was missing data type\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -546,23 +549,26 @@ void DumpNodeOutputs(
|
||||||
const auto* type = context.OutputType(i);
|
const auto* type = context.OutputType(i);
|
||||||
if (type) {
|
if (type) {
|
||||||
if (type->IsTensorType()) {
|
if (type->IsTensorType()) {
|
||||||
const auto& tensor = *context.Output<Tensor>(i);
|
if (const auto* tensor = context.Output<Tensor>(i); tensor != nullptr) {
|
||||||
const auto& shape = tensor.Shape();
|
const auto& shape = tensor->Shape();
|
||||||
|
|
||||||
const bool is_shape_set = (dump_options.dump_flags & NodeDumpOptions::DumpFlags::Shape) != 0;
|
const bool is_shape_set = (dump_options.dump_flags & NodeDumpOptions::DumpFlags::Shape) != 0;
|
||||||
PrintIf(is_shape_set, MakeString(" Shape: ", shape, "\n"));
|
PrintIf(is_shape_set, MakeString(" Shape: ", shape, "\n"));
|
||||||
|
|
||||||
if ((dump_options.dump_flags & NodeDumpOptions::DumpFlags::OutputData) != 0) {
|
if ((dump_options.dump_flags & NodeDumpOptions::DumpFlags::OutputData) != 0) {
|
||||||
tensor_metadata.name = output_defs[i]->Name();
|
tensor_metadata.name = output_defs[i]->Name();
|
||||||
tensor_metadata.step = dump_context.iteration;
|
tensor_metadata.step = dump_context.iteration;
|
||||||
tensor_metadata.producer = node.Name() + ":" + std::to_string(i);
|
tensor_metadata.producer = node.Name() + ":" + std::to_string(i);
|
||||||
DumpTensor(dump_options, tensor, tensor_metadata, session_state);
|
DumpTensor(dump_options, *tensor, tensor_metadata, session_state);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
std::cout << " is empty optional tensor.\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::cout << " is non-tensor type.\n";
|
std::cout << " is non-tensor type.\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// should never happen...
|
// should never happen in a successful run
|
||||||
std::cout << "missing data type\n";
|
std::cout << "missing data type\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,13 @@ Memory_LeakCheck::Memory_LeakCheck() noexcept {
|
||||||
g_heap = HeapCreate(0, 0, 0);
|
g_heap = HeapCreate(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print message to debug output and stdout
|
||||||
|
// no trailing newline will be added
|
||||||
|
static void DebugPrint(const char* message) {
|
||||||
|
OutputDebugStringA(message);
|
||||||
|
std::cout << "memleakdbg: " << message;
|
||||||
|
}
|
||||||
|
|
||||||
Memory_LeakCheck::~Memory_LeakCheck() {
|
Memory_LeakCheck::~Memory_LeakCheck() {
|
||||||
SymbolHelper symbols;
|
SymbolHelper symbols;
|
||||||
|
|
||||||
|
|
@ -219,17 +226,17 @@ Memory_LeakCheck::~Memory_LeakCheck() {
|
||||||
string.find("testing::internal::ThreadLocalRegistryImpl::GetThreadLocalsMapLocked") == std::string::npos &&
|
string.find("testing::internal::ThreadLocalRegistryImpl::GetThreadLocalsMapLocked") == std::string::npos &&
|
||||||
string.find("testing::internal::ThreadLocalRegistryImpl::GetValueOnCurrentThread") == std::string::npos) {
|
string.find("testing::internal::ThreadLocalRegistryImpl::GetValueOnCurrentThread") == std::string::npos) {
|
||||||
if (leaked_bytes == 0)
|
if (leaked_bytes == 0)
|
||||||
OutputDebugStringA("\n-----Starting Heap Trace-----\n\n");
|
DebugPrint("\n-----Starting Heap Trace-----\n\n");
|
||||||
|
|
||||||
leak_count++;
|
leak_count++;
|
||||||
leaked_bytes += entry.cbData - sizeof(MemoryBlock);
|
leaked_bytes += entry.cbData - sizeof(MemoryBlock);
|
||||||
OutputDebugStringA(string.c_str());
|
DebugPrint(string.c_str());
|
||||||
OutputDebugStringA("\n");
|
DebugPrint("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leaked_bytes) {
|
if (leaked_bytes) {
|
||||||
OutputDebugStringA("-----Ending Heap Trace-----\n\n");
|
DebugPrint("-----Ending Heap Trace-----\n\n");
|
||||||
|
|
||||||
std::string string;
|
std::string string;
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
|
|
@ -242,7 +249,7 @@ Memory_LeakCheck::~Memory_LeakCheck() {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
OutputDebugStringA("\n----- No memory leaks detected -----\n\n");
|
DebugPrint("\n----- No memory leaks detected -----\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapDestroy(heap);
|
HeapDestroy(heap);
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,8 @@ Status CumSum<T>::Compute(OpKernelContext* ctx) const {
|
||||||
::ZeroOutSliceAtIndex<T>(output_tensor, rank, axis, index, slice_dims, steps, slice_size);
|
::ZeroOutSliceAtIndex<T>(output_tensor, rank, axis, index, slice_dims, steps, slice_size);
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
|
if (index < dim) {
|
||||||
// The next slice is a copy of the input (if exclusive == false then this is the first slice)
|
// The next slice is a copy of the input (if exclusive == false then this is the first slice)
|
||||||
auto input_starts(::GetStarts(rank, axis, 0));
|
auto input_starts(::GetStarts(rank, axis, 0));
|
||||||
auto output_starts(::GetStarts(rank, axis, index));
|
auto output_starts(::GetStarts(rank, axis, index));
|
||||||
|
|
|
||||||
|
|
@ -673,25 +673,24 @@ TEST_P(ModelTest, Run) {
|
||||||
|
|
||||||
for (bool is_single_thread : use_single_thread) {
|
for (bool is_single_thread : use_single_thread) {
|
||||||
for (ExecutionMode execution_mode : execution_modes) {
|
for (ExecutionMode execution_mode : execution_modes) {
|
||||||
OrtSessionOptions* ortso;
|
Ort::SessionOptions ortso{};
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::CreateSessionOptions(&ortso));
|
|
||||||
if (!is_single_thread) {
|
if (!is_single_thread) {
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::DisablePerSessionThreads(ortso));
|
ortso.DisablePerSessionThreads();
|
||||||
} else {
|
} else {
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SetIntraOpNumThreads(ortso, 1));
|
ortso.SetIntraOpNumThreads(1);
|
||||||
}
|
}
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SetSessionExecutionMode(ortso, execution_mode));
|
ortso.SetExecutionMode(execution_mode);
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SetSessionLogId(ortso, ToUTF8String(test_case_name).c_str()));
|
ortso.SetLogId(ToUTF8String(test_case_name).c_str());
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SetSessionLogSeverityLevel(ortso, ORT_LOGGING_LEVEL_ERROR));
|
ortso.SetLogSeverityLevel(ORT_LOGGING_LEVEL_ERROR);
|
||||||
if (provider_name == "cuda") {
|
if (provider_name == "cuda") {
|
||||||
OrtCUDAProviderOptionsV2* cuda_options = nullptr;
|
OrtCUDAProviderOptionsV2* cuda_options = nullptr;
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::CreateCUDAProviderOptions(&cuda_options));
|
ASSERT_ORT_STATUS_OK(OrtApis::CreateCUDAProviderOptions(&cuda_options));
|
||||||
std::unique_ptr<OrtCUDAProviderOptionsV2, decltype(&OrtApis::ReleaseCUDAProviderOptions)> rel_cuda_options(
|
std::unique_ptr<OrtCUDAProviderOptionsV2, decltype(&OrtApis::ReleaseCUDAProviderOptions)> rel_cuda_options(
|
||||||
cuda_options, &OrtApis::ReleaseCUDAProviderOptions);
|
cuda_options, &OrtApis::ReleaseCUDAProviderOptions);
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_CUDA_V2(ortso, cuda_options));
|
ortso.AppendExecutionProvider_CUDA_V2(*cuda_options);
|
||||||
} else if (provider_name == "rocm") {
|
} else if (provider_name == "rocm") {
|
||||||
OrtROCMProviderOptions ep_options;
|
OrtROCMProviderOptions ep_options;
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_ROCM(ortso, &ep_options));
|
ortso.AppendExecutionProvider_ROCM(ep_options);
|
||||||
}
|
}
|
||||||
#ifdef USE_DNNL
|
#ifdef USE_DNNL
|
||||||
else if (provider_name == "dnnl") {
|
else if (provider_name == "dnnl") {
|
||||||
|
|
@ -703,26 +702,26 @@ TEST_P(ModelTest, Run) {
|
||||||
OrtTensorRTProviderOptionsV2 params{0, 0, nullptr, 1000, 1, 1 << 30,
|
OrtTensorRTProviderOptionsV2 params{0, 0, nullptr, 1000, 1, 1 << 30,
|
||||||
1, // enable fp16
|
1, // enable fp16
|
||||||
0, nullptr, 0, 0, 0, 0, 0, nullptr, 0, nullptr, 0, 0, 0};
|
0, nullptr, 0, 0, 0, 0, 0, nullptr, 0, nullptr, 0, 0, 0};
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_TensorRT_V2(ortso, ¶ms));
|
ortso.AppendExecutionProvider_TensorRT_V2(params);
|
||||||
} else {
|
} else {
|
||||||
OrtTensorRTProviderOptionsV2* ep_option;
|
OrtTensorRTProviderOptionsV2* ep_option = nullptr;
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::CreateTensorRTProviderOptions(&ep_option));
|
ASSERT_ORT_STATUS_OK(OrtApis::CreateTensorRTProviderOptions(&ep_option));
|
||||||
std::unique_ptr<OrtTensorRTProviderOptionsV2, decltype(&OrtApis::ReleaseTensorRTProviderOptions)>
|
std::unique_ptr<OrtTensorRTProviderOptionsV2, decltype(&OrtApis::ReleaseTensorRTProviderOptions)>
|
||||||
rel_cuda_options(ep_option, &OrtApis::ReleaseTensorRTProviderOptions);
|
rel_cuda_options(ep_option, &OrtApis::ReleaseTensorRTProviderOptions);
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_TensorRT_V2(ortso, ep_option));
|
ortso.AppendExecutionProvider_TensorRT_V2(*ep_option);
|
||||||
}
|
}
|
||||||
// Enable CUDA fallback
|
// Enable CUDA fallback
|
||||||
OrtCUDAProviderOptionsV2* cuda_options = nullptr;
|
OrtCUDAProviderOptionsV2* cuda_options = nullptr;
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::CreateCUDAProviderOptions(&cuda_options));
|
ASSERT_ORT_STATUS_OK(OrtApis::CreateCUDAProviderOptions(&cuda_options));
|
||||||
std::unique_ptr<OrtCUDAProviderOptionsV2, decltype(&OrtApis::ReleaseCUDAProviderOptions)> rel_cuda_options(
|
std::unique_ptr<OrtCUDAProviderOptionsV2, decltype(&OrtApis::ReleaseCUDAProviderOptions)> rel_cuda_options(
|
||||||
cuda_options, &OrtApis::ReleaseCUDAProviderOptions);
|
cuda_options, &OrtApis::ReleaseCUDAProviderOptions);
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_CUDA_V2(ortso, cuda_options));
|
ortso.AppendExecutionProvider_CUDA_V2(*cuda_options);
|
||||||
} else if (provider_name == "migraphx") {
|
} else if (provider_name == "migraphx") {
|
||||||
OrtMIGraphXProviderOptions ep_options;
|
OrtMIGraphXProviderOptions ep_options;
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_MIGraphX(ortso, &ep_options));
|
ortso.AppendExecutionProvider_MIGraphX(ep_options);
|
||||||
} else if (provider_name == "openvino") {
|
} else if (provider_name == "openvino") {
|
||||||
OrtOpenVINOProviderOptions ep_options;
|
OrtOpenVINOProviderOptions ep_options;
|
||||||
ASSERT_ORT_STATUS_OK(OrtApis::SessionOptionsAppendExecutionProvider_OpenVINO(ortso, &ep_options));
|
ortso.AppendExecutionProvider_OpenVINO(ep_options);
|
||||||
}
|
}
|
||||||
#ifdef USE_NNAPI
|
#ifdef USE_NNAPI
|
||||||
else if (provider_name == "nnapi") {
|
else if (provider_name == "nnapi") {
|
||||||
|
|
@ -760,8 +759,7 @@ TEST_P(ModelTest, Run) {
|
||||||
#ifndef USE_DNNL // potential crash for DNNL pipeline
|
#ifndef USE_DNNL // potential crash for DNNL pipeline
|
||||||
if (data_count > 1 && tests_run_parallel.find(l->GetTestCaseName()) != tests_run_parallel.end()) {
|
if (data_count > 1 && tests_run_parallel.find(l->GetTestCaseName()) != tests_run_parallel.end()) {
|
||||||
LOGS_DEFAULT(ERROR) << "Parallel test for " << l->GetTestCaseName(); // TODO(leca): change level to INFO or even delete the log once verified parallel test working
|
LOGS_DEFAULT(ERROR) << "Parallel test for " << l->GetTestCaseName(); // TODO(leca): change level to INFO or even delete the log once verified parallel test working
|
||||||
Ort::SessionOptions ort_session_options(ortso);
|
std::shared_ptr<TestCaseResult> results = TestCaseRequestContext::Run(tp.get(), *l, *ort_env, ortso, data_count, 1 /*repeat_count*/);
|
||||||
std::shared_ptr<TestCaseResult> results = TestCaseRequestContext::Run(tp.get(), *l, *ort_env, ort_session_options, data_count, 1 /*repeat_count*/);
|
|
||||||
for (EXECUTE_RESULT res : results->GetExcutionResult()) {
|
for (EXECUTE_RESULT res : results->GetExcutionResult()) {
|
||||||
EXPECT_EQ(res, EXECUTE_RESULT::SUCCESS) << "is_single_thread:" << is_single_thread << ", execution_mode:" << execution_mode << ", provider_name:"
|
EXPECT_EQ(res, EXECUTE_RESULT::SUCCESS) << "is_single_thread:" << is_single_thread << ", execution_mode:" << execution_mode << ", provider_name:"
|
||||||
<< provider_name << ", test name:" << results->GetName() << ", result: " << res;
|
<< provider_name << ", test name:" << results->GetName() << ", result: " << res;
|
||||||
|
|
@ -769,8 +767,6 @@ TEST_P(ModelTest, Run) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif // !USE_DNNL
|
#endif // !USE_DNNL
|
||||||
std::unique_ptr<OrtSessionOptions, decltype(&OrtApis::ReleaseSessionOptions)> rel_ort_session_option(
|
|
||||||
ortso, &OrtApis::ReleaseSessionOptions);
|
|
||||||
// TODO(leca): leverage TestCaseRequestContext::Run() to make it short
|
// TODO(leca): leverage TestCaseRequestContext::Run() to make it short
|
||||||
auto default_allocator = std::make_unique<MockedOrtAllocator>();
|
auto default_allocator = std::make_unique<MockedOrtAllocator>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,143 +1,158 @@
|
||||||
jobs:
|
stages:
|
||||||
- template: templates/win-ci-vs-2019.yml
|
- stage: Mimalloc
|
||||||
parameters:
|
dependsOn: []
|
||||||
BuildConfig: 'Debug'
|
jobs:
|
||||||
EnvSetupScript: setup_env.bat
|
- template: templates/win-ci-vs-2019.yml
|
||||||
buildArch: x64
|
parameters:
|
||||||
additionalBuildFlags: --disable_memleak_checker --use_mimalloc
|
BuildConfig: 'Debug'
|
||||||
msbuildPlatform: x64
|
EnvSetupScript: setup_env.bat
|
||||||
isX86: false
|
buildArch: x64
|
||||||
job_name_suffix: x64_mimalloc
|
additionalBuildFlags: --disable_memleak_checker --use_mimalloc
|
||||||
RunOnnxRuntimeTests: true
|
msbuildPlatform: x64
|
||||||
RunStaticCodeAnalysis: false
|
isX86: false
|
||||||
isTraining: false
|
job_name_suffix: x64_mimalloc
|
||||||
ORT_EP_NAME: CPU
|
RunOnnxRuntimeTests: true
|
||||||
GenerateDocumentation: false
|
RunStaticCodeAnalysis: false
|
||||||
EnablePython: false
|
isTraining: false
|
||||||
MachinePool: 'Win-CPU-2021'
|
ORT_EP_NAME: CPU
|
||||||
|
GenerateDocumentation: false
|
||||||
|
EnablePython: false
|
||||||
|
MachinePool: 'Win-CPU-2021'
|
||||||
|
|
||||||
- template: templates/win-ci-vs-2019.yml
|
- stage: NoAbseil
|
||||||
parameters:
|
dependsOn: []
|
||||||
BuildConfig: 'Debug'
|
jobs:
|
||||||
EnvSetupScript: setup_env.bat
|
- template: templates/win-ci-vs-2019.yml
|
||||||
buildArch: x64
|
parameters:
|
||||||
additionalBuildFlags: --cmake_extra_defines onnxruntime_DISABLE_ABSEIL=ON
|
BuildConfig: 'Debug'
|
||||||
msbuildPlatform: x64
|
EnvSetupScript: setup_env.bat
|
||||||
isX86: false
|
buildArch: x64
|
||||||
job_name_suffix: x64_no_absl
|
additionalBuildFlags: --cmake_extra_defines onnxruntime_DISABLE_ABSEIL=ON
|
||||||
RunOnnxRuntimeTests: true
|
msbuildPlatform: x64
|
||||||
RunStaticCodeAnalysis: false
|
isX86: false
|
||||||
isTraining: false
|
job_name_suffix: x64_no_absl
|
||||||
ORT_EP_NAME: CPU
|
RunOnnxRuntimeTests: true
|
||||||
GenerateDocumentation: false
|
RunStaticCodeAnalysis: false
|
||||||
EnablePython: false
|
isTraining: false
|
||||||
MachinePool: 'Win-CPU-2021'
|
ORT_EP_NAME: CPU
|
||||||
|
GenerateDocumentation: false
|
||||||
|
EnablePython: false
|
||||||
|
MachinePool: 'Win-CPU-2021'
|
||||||
|
|
||||||
- template: templates/win-ci-vs-2019.yml
|
- stage: MinimalBuildWithNoExceptions
|
||||||
parameters:
|
dependsOn: []
|
||||||
BuildConfig: 'Debug'
|
jobs:
|
||||||
EnvSetupScript: setup_env.bat
|
- template: templates/win-ci-vs-2019.yml
|
||||||
buildArch: x64
|
parameters:
|
||||||
additionalBuildFlags: --build_shared_lib --minimal_build --disable_exceptions
|
BuildConfig: 'Debug'
|
||||||
msbuildPlatform: x64
|
EnvSetupScript: setup_env.bat
|
||||||
isX86: false
|
buildArch: x64
|
||||||
job_name_suffix: x64_minimal_no_exception
|
additionalBuildFlags: --build_shared_lib --minimal_build --disable_exceptions
|
||||||
RunOnnxRuntimeTests: true
|
msbuildPlatform: x64
|
||||||
RunStaticCodeAnalysis: false
|
isX86: false
|
||||||
isTraining: false
|
job_name_suffix: x64_minimal_no_exception
|
||||||
ORT_EP_NAME: CPU
|
RunOnnxRuntimeTests: true
|
||||||
GenerateDocumentation: false
|
RunStaticCodeAnalysis: false
|
||||||
EnablePython: false
|
isTraining: false
|
||||||
MachinePool: 'Win-CPU-2021'
|
ORT_EP_NAME: CPU
|
||||||
|
GenerateDocumentation: false
|
||||||
|
EnablePython: false
|
||||||
|
MachinePool: 'Win-CPU-2021'
|
||||||
|
|
||||||
- template: templates/win-ci-vs-2019.yml
|
- stage: DebugNodeInputsOutputs
|
||||||
parameters:
|
dependsOn: []
|
||||||
BuildConfig: 'Debug'
|
jobs:
|
||||||
EnvSetupScript: setup_env.bat
|
- template: templates/win-ci-vs-2019.yml
|
||||||
buildArch: x64
|
parameters:
|
||||||
additionalBuildFlags: --build_shared_lib --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=ON
|
BuildConfig: 'Debug'
|
||||||
msbuildPlatform: x64
|
EnvSetupScript: setup_env.bat
|
||||||
isX86: false
|
buildArch: x64
|
||||||
job_name_suffix: x64_debug_node_input_output
|
additionalBuildFlags: --build_shared_lib --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=ON
|
||||||
RunOnnxRuntimeTests: true
|
msbuildPlatform: x64
|
||||||
RunStaticCodeAnalysis: false
|
isX86: false
|
||||||
isTraining: false
|
job_name_suffix: x64_debug_node_input_output
|
||||||
ORT_EP_NAME: CPU
|
RunOnnxRuntimeTests: true
|
||||||
GenerateDocumentation: false
|
RunStaticCodeAnalysis: false
|
||||||
EnablePython: false
|
isTraining: false
|
||||||
MachinePool: 'Win-CPU-2021'
|
ORT_EP_NAME: CPU
|
||||||
|
GenerateDocumentation: false
|
||||||
|
EnablePython: false
|
||||||
|
MachinePool: 'Win-CPU-2021'
|
||||||
|
|
||||||
- job: CodeCoverage
|
- stage: CodeCoverage
|
||||||
workspace:
|
dependsOn: []
|
||||||
clean: all
|
jobs:
|
||||||
timeoutInMinutes: 150
|
- job: CodeCoverage
|
||||||
variables:
|
workspace:
|
||||||
skipComponentGovernanceDetection: true
|
clean: all
|
||||||
pool: 'Linux-CPU'
|
timeoutInMinutes: 150
|
||||||
steps:
|
variables:
|
||||||
- template: templates/set-version-number-variables-step.yml
|
skipComponentGovernanceDetection: true
|
||||||
|
pool: 'Linux-CPU'
|
||||||
|
steps:
|
||||||
|
- template: templates/set-version-number-variables-step.yml
|
||||||
|
|
||||||
- task: CmdLine@2
|
- task: CmdLine@2
|
||||||
|
inputs:
|
||||||
|
script: |
|
||||||
|
set -e
|
||||||
|
ln -s /data/models .
|
||||||
|
#Build onnxruntime and run the instrumented program(unitests)
|
||||||
|
LLVM_PROFILE_FILE="%p.profraw" CFLAGS="-g -fprofile-instr-generate -fcoverage-mapping" CXXFLAGS="-g -fprofile-instr-generate -fcoverage-mapping" CC=clang CXX=clang++ python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir=$(Build.BinariesDirectory) --config Debug --parallel --skip_submodule_sync --build_shared_lib --enable_onnx_tests --cmake_extra_defines RUN_MODELTEST_IN_DEBUG_MODE=ON
|
||||||
|
|
||||||
|
cd Debug
|
||||||
|
./onnxruntime_mlas_test
|
||||||
|
#Merge the mulitple prof data into a single indexed profile data file
|
||||||
|
llvm-profdata merge -sparse -o ort.profdata *.profraw
|
||||||
|
#Create coverage report, output the result to 'report.json'
|
||||||
|
llvm-cov export -summary-only -instr-profile=ort.profdata onnxruntime_test_all -object onnxruntime_mlas_test -object onnxruntime_api_tests_without_env -object onnx_test_runner -object onnxruntime_shared_lib_test -object onnxruntime_global_thread_pools_test -object onnxruntime_api_tests_without_env $(Build.SourcesDirectory)/include/onnxruntime $(Build.SourcesDirectory)/onnxruntime/core $(Build.SourcesDirectory)/onnxruntime/contrib_ops > $(Build.BinariesDirectory)/report.json
|
||||||
|
|
||||||
|
llvm-cov show -instr-profile=ort.profdata onnxruntime_test_all -object onnxruntime_mlas_test -object onnxruntime_api_tests_without_env -object onnx_test_runner -object onnxruntime_shared_lib_test -object onnxruntime_global_thread_pools_test -object onnxruntime_api_tests_without_env $(Build.SourcesDirectory)/include/onnxruntime $(Build.SourcesDirectory)/onnxruntime/core $(Build.SourcesDirectory)/onnxruntime/contrib_ops --format=html -output-dir=$(Build.ArtifactStagingDirectory)
|
||||||
|
workingDirectory: $(Build.BinariesDirectory)
|
||||||
|
|
||||||
|
- task: AzureCLI@2
|
||||||
|
displayName: 'Azure CLI'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: AIInfraBuildOnnxRuntimeOSS
|
||||||
|
scriptType: bash
|
||||||
|
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
|
||||||
|
arguments: '"$(Build.BinariesDirectory)/report.json" "https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=$(Build.BuildId)" x64 linux default'
|
||||||
|
workingDirectory: '$(Build.BinariesDirectory)'
|
||||||
|
|
||||||
|
- task: PublishPipelineArtifact@1
|
||||||
|
displayName: 'Publish Pipeline Artifact'
|
||||||
|
inputs:
|
||||||
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
artifact: html
|
||||||
|
|
||||||
|
- job: Upload
|
||||||
|
workspace:
|
||||||
|
clean: all
|
||||||
|
pool: 'Win-CPU-2021'
|
||||||
|
variables:
|
||||||
|
- name: runCodesignValidationInjection
|
||||||
|
value: false
|
||||||
|
- name: skipComponentGovernanceDetection
|
||||||
|
value: true
|
||||||
|
dependsOn:
|
||||||
|
- CodeCoverage
|
||||||
|
condition: and (succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
submodules: false
|
||||||
|
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
|
displayName: 'Download Pipeline Artifact'
|
||||||
inputs:
|
inputs:
|
||||||
script: |
|
buildType: 'current'
|
||||||
set -e
|
artifactName: 'html'
|
||||||
ln -s /data/models .
|
targetPath: '$(Build.BinariesDirectory)'
|
||||||
#Build onnxruntime and run the instrumented program(unitests)
|
|
||||||
LLVM_PROFILE_FILE="%p.profraw" CFLAGS="-g -fprofile-instr-generate -fcoverage-mapping" CXXFLAGS="-g -fprofile-instr-generate -fcoverage-mapping" CC=clang CXX=clang++ python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir=$(Build.BinariesDirectory) --config Debug --parallel --skip_submodule_sync --build_shared_lib --enable_onnx_tests --cmake_extra_defines RUN_MODELTEST_IN_DEBUG_MODE=ON
|
|
||||||
|
|
||||||
cd Debug
|
- task: AzureFileCopy@4
|
||||||
./onnxruntime_mlas_test
|
displayName: 'AzureBlob File Copy'
|
||||||
#Merge the mulitple prof data into a single indexed profile data file
|
|
||||||
llvm-profdata merge -sparse -o ort.profdata *.profraw
|
|
||||||
#Create coverage report, output the result to 'report.json'
|
|
||||||
llvm-cov export -summary-only -instr-profile=ort.profdata onnxruntime_test_all -object onnxruntime_mlas_test -object onnxruntime_api_tests_without_env -object onnx_test_runner -object onnxruntime_shared_lib_test -object onnxruntime_global_thread_pools_test -object onnxruntime_api_tests_without_env $(Build.SourcesDirectory)/include/onnxruntime $(Build.SourcesDirectory)/onnxruntime/core $(Build.SourcesDirectory)/onnxruntime/contrib_ops > $(Build.BinariesDirectory)/report.json
|
|
||||||
|
|
||||||
llvm-cov show -instr-profile=ort.profdata onnxruntime_test_all -object onnxruntime_mlas_test -object onnxruntime_api_tests_without_env -object onnx_test_runner -object onnxruntime_shared_lib_test -object onnxruntime_global_thread_pools_test -object onnxruntime_api_tests_without_env $(Build.SourcesDirectory)/include/onnxruntime $(Build.SourcesDirectory)/onnxruntime/core $(Build.SourcesDirectory)/onnxruntime/contrib_ops --format=html -output-dir=$(Build.ArtifactStagingDirectory)
|
|
||||||
workingDirectory: $(Build.BinariesDirectory)
|
|
||||||
|
|
||||||
- task: AzureCLI@2
|
|
||||||
displayName: 'Azure CLI'
|
|
||||||
inputs:
|
inputs:
|
||||||
|
SourcePath: '$(Build.BinariesDirectory)\*'
|
||||||
azureSubscription: AIInfraBuildOnnxRuntimeOSS
|
azureSubscription: AIInfraBuildOnnxRuntimeOSS
|
||||||
scriptType: bash
|
Destination: AzureBlob
|
||||||
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
|
storage: onnxruntime
|
||||||
arguments: '"$(Build.BinariesDirectory)/report.json" "https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=$(Build.BuildId)" x64 linux default'
|
ContainerName: '$web'
|
||||||
workingDirectory: '$(Build.BinariesDirectory)'
|
|
||||||
|
|
||||||
- task: PublishPipelineArtifact@1
|
|
||||||
displayName: 'Publish Pipeline Artifact'
|
|
||||||
inputs:
|
|
||||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
||||||
artifact: html
|
|
||||||
|
|
||||||
- job: Upload
|
|
||||||
workspace:
|
|
||||||
clean: all
|
|
||||||
pool: 'Win-CPU-2021'
|
|
||||||
variables:
|
|
||||||
- name: runCodesignValidationInjection
|
|
||||||
value: false
|
|
||||||
- name: skipComponentGovernanceDetection
|
|
||||||
value: true
|
|
||||||
dependsOn:
|
|
||||||
- CodeCoverage
|
|
||||||
condition: and (succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
|
|
||||||
steps:
|
|
||||||
- checkout: self
|
|
||||||
submodules: false
|
|
||||||
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: 'Download Pipeline Artifact'
|
|
||||||
inputs:
|
|
||||||
buildType: 'current'
|
|
||||||
artifactName: 'html'
|
|
||||||
targetPath: '$(Build.BinariesDirectory)'
|
|
||||||
|
|
||||||
- task: AzureFileCopy@4
|
|
||||||
displayName: 'AzureBlob File Copy'
|
|
||||||
inputs:
|
|
||||||
SourcePath: '$(Build.BinariesDirectory)\*'
|
|
||||||
azureSubscription: AIInfraBuildOnnxRuntimeOSS
|
|
||||||
Destination: AzureBlob
|
|
||||||
storage: onnxruntime
|
|
||||||
ContainerName: '$web'
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue