mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Fix some build issues on MacOS with Xcode 14.3. (#15878)
- Fix flatbuffers flatc warning, unused-but-set-variable. - Address `-Wshorten-64-to-32` warnings (fix in our code, allow in dependencies' code). - Update CI builds to use Xcode 14.3. - Update minimum iOS version to 12.0. - Update Mac hosted agents to MacOS 13 where possible.
This commit is contained in:
parent
b8858f034e
commit
1261d0b8ba
43 changed files with 271 additions and 134 deletions
|
|
@ -21,7 +21,7 @@ permissions:
|
|||
jobs:
|
||||
build:
|
||||
name: Generate Objective-C API docs
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
|||
|
|
@ -552,30 +552,31 @@ if (WIN32)
|
|||
endif()
|
||||
|
||||
else()
|
||||
check_cxx_compiler_flag(-Wambiguous-reversed-operator HAS_AMBIGUOUS_REVERSED_OPERATOR)
|
||||
check_cxx_compiler_flag(-Wbitwise-instead-of-logical HAS_BITWISE_INSTEAD_OF_LOGICAL)
|
||||
check_cxx_compiler_flag(-Wcast-function-type HAS_CAST_FUNCTION_TYPE)
|
||||
check_cxx_compiler_flag(-Wcatch-value HAS_CATCH_VALUE)
|
||||
check_cxx_compiler_flag(-Wclass-memaccess HAS_CLASS_MEMACCESS)
|
||||
check_cxx_compiler_flag(-Wdeprecated-anon-enum-enum-conversion HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION)
|
||||
check_cxx_compiler_flag(-Wdeprecated-builtins HAS_DEPRECATED_BUILTINS)
|
||||
check_cxx_compiler_flag(-Wdeprecated-copy HAS_DEPRECATED_COPY)
|
||||
check_cxx_compiler_flag(-Wdeprecated-declarations HAS_DEPRECATED_DECLARATIONS)
|
||||
check_cxx_compiler_flag(-Wenum-constexpr-conversion HAS_ENUM_CONSTEXPR_CONVERSION)
|
||||
check_cxx_compiler_flag(-Wformat-truncation HAS_FORMAT_TRUNCATION)
|
||||
check_cxx_compiler_flag(-Wignored-attributes HAS_IGNORED_ATTRIBUTES)
|
||||
check_cxx_compiler_flag(-Wmaybe-uninitialized HAS_MAYBE_UNINITIALIZED)
|
||||
check_cxx_compiler_flag(-Wmissing-braces HAS_MISSING_BRACES)
|
||||
check_cxx_compiler_flag(-Wnonnull-compare HAS_NONNULL_COMPARE)
|
||||
check_cxx_compiler_flag(-Wparentheses HAS_PARENTHESES)
|
||||
check_cxx_compiler_flag(-Wshorten-64-to-32 HAS_SHORTEN_64_TO_32)
|
||||
check_cxx_compiler_flag(-Wstrict-aliasing HAS_STRICT_ALIASING)
|
||||
check_nvcc_compiler_flag(-Wstrict-aliasing NVCC_HAS_STRICT_ALIASING)
|
||||
check_cxx_compiler_flag(-Wtautological-pointer-compare HAS_TAUTOLOGICAL_POINTER_COMPARE)
|
||||
check_cxx_compiler_flag(-Wundefined-var-template HAS_UNDEFINED_VAR_TEMPLATE)
|
||||
check_cxx_compiler_flag(-Wunused-but-set-parameter HAS_UNUSED_BUT_SET_PARAMETER)
|
||||
check_cxx_compiler_flag(-Wunused-but-set-variable HAS_UNUSED_BUT_SET_VARIABLE)
|
||||
check_cxx_compiler_flag(-Wunused-variable HAS_UNUSED_VARIABLE)
|
||||
check_cxx_compiler_flag(-Wcast-function-type HAS_CAST_FUNCTION_TYPE)
|
||||
check_cxx_compiler_flag(-Wparentheses HAS_PARENTHESES)
|
||||
check_cxx_compiler_flag(-Wuseless-cast HAS_USELESS_CAST)
|
||||
check_cxx_compiler_flag(-Wnonnull-compare HAS_NONNULL_COMPARE)
|
||||
check_cxx_compiler_flag(-Wtautological-pointer-compare HAS_TAUTOLOGICAL_POINTER_COMPARE)
|
||||
check_cxx_compiler_flag(-Wcatch-value HAS_CATCH_VALUE)
|
||||
check_cxx_compiler_flag(-Wmissing-braces HAS_MISSING_BRACES)
|
||||
check_cxx_compiler_flag(-Wignored-attributes HAS_IGNORED_ATTRIBUTES)
|
||||
check_cxx_compiler_flag(-Wdeprecated-copy HAS_DEPRECATED_COPY)
|
||||
check_cxx_compiler_flag(-Wdeprecated-declarations HAS_DEPRECATED_DECLARATIONS)
|
||||
check_cxx_compiler_flag(-Wclass-memaccess HAS_CLASS_MEMACCESS)
|
||||
check_cxx_compiler_flag(-Wmaybe-uninitialized HAS_MAYBE_UNINITIALIZED)
|
||||
check_cxx_compiler_flag(-Wstrict-aliasing HAS_STRICT_ALIASING)
|
||||
check_nvcc_compiler_flag(-Wstrict-aliasing NVCC_HAS_STRICT_ALIASING)
|
||||
check_cxx_compiler_flag(-Wambiguous-reversed-operator HAS_AMBIGUOUS_REVERSED_OPERATOR)
|
||||
check_cxx_compiler_flag(-Wdeprecated-anon-enum-enum-conversion HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION)
|
||||
check_cxx_compiler_flag(-Wundefined-var-template HAS_UNDEFINED_VAR_TEMPLATE)
|
||||
check_cxx_compiler_flag(-Wformat-truncation HAS_FORMAT_TRUNCATION)
|
||||
check_cxx_compiler_flag(-Wbitwise-instead-of-logical HAS_BITWISE_INSTEAD_OF_LOGICAL)
|
||||
check_cxx_compiler_flag(-Wenum-constexpr-conversion HAS_ENUM_CONSTEXPR_CONVERSION)
|
||||
check_cxx_compiler_flag(-Wdeprecated-builtins HAS_DEPRECATED_BUILTINS)
|
||||
check_function_exists(reallocarray HAS_REALLOCARRAY)
|
||||
|
||||
if (HAS_TAUTOLOGICAL_POINTER_COMPARE)
|
||||
|
|
|
|||
13
cmake/external/onnx_minimal.cmake
vendored
13
cmake/external/onnx_minimal.cmake
vendored
|
|
@ -27,18 +27,6 @@ target_compile_definitions(onnx_proto PUBLIC $<TARGET_PROPERTY:protobuf::libprot
|
|||
set(_src_prefix "onnx/")
|
||||
onnxruntime_protobuf_generate(NO_SRC_INCLUDES GEN_SRC_PREFIX ${_src_prefix} IMPORT_DIRS ${ONNX_SOURCE_ROOT} TARGET onnx_proto)
|
||||
|
||||
if (WIN32)
|
||||
target_compile_options(onnx_proto PRIVATE "/wd4146" "/wd4125" "/wd4456" "/wd4267" "/wd4309")
|
||||
else()
|
||||
if(HAS_UNUSED_VARIABLE)
|
||||
target_compile_options(onnx_proto PRIVATE "-Wno-unused-variable")
|
||||
endif()
|
||||
|
||||
if(HAS_UNUSED_BUT_SET_VARIABLE)
|
||||
target_compile_options(onnx_proto PRIVATE "-Wno-unused-but-set-variable")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For reference, this would be the full ONNX source include. We only need data_type_utils in this build.
|
||||
# file(GLOB_RECURSE onnx_src CONFIGURE_DEPENDS
|
||||
# "${ONNX_SOURCE_ROOT}/onnx/*.h"
|
||||
|
|
@ -99,4 +87,3 @@ else()
|
|||
target_compile_options(onnx PRIVATE "-Wno-unused-but-set-variable")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ set(FLATBUFFERS_INSTALL OFF CACHE BOOL "FLATBUFFERS_INSTALL" FORCE)
|
|||
set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "FLATBUFFERS_BUILD_FLATHASH" FORCE)
|
||||
set(FLATBUFFERS_BUILD_FLATLIB ON CACHE BOOL "FLATBUFFERS_BUILD_FLATLIB" FORCE)
|
||||
if(Patch_FOUND)
|
||||
set(ONNXRUNTIME_FLATBUFFERS_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/flatbuffers/flatbuffers_cmake.patch)
|
||||
set(ONNXRUNTIME_FLATBUFFERS_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/flatbuffers/flatbuffers.patch)
|
||||
else()
|
||||
set(ONNXRUNTIME_FLATBUFFERS_PATCH_COMMAND "")
|
||||
endif()
|
||||
|
|
@ -119,7 +119,7 @@ if(CMAKE_CROSSCOMPILING AND NOT ONNX_CUSTOM_PROTOC_EXECUTABLE AND NOT CMAKE_OSX_
|
|||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||
FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_win32} URL_HASH SHA1=${DEP_SHA1_protoc_win32})
|
||||
FetchContent_Populate(protoc_binary)
|
||||
endif()
|
||||
endif()
|
||||
if(protoc_binary_SOURCE_DIR)
|
||||
message("Use prebuilt protoc")
|
||||
set(ONNX_CUSTOM_PROTOC_EXECUTABLE ${protoc_binary_SOURCE_DIR}/bin/protoc.exe)
|
||||
|
|
|
|||
25
cmake/external/protobuf_function.cmake
vendored
25
cmake/external/protobuf_function.cmake
vendored
|
|
@ -33,6 +33,7 @@
|
|||
#sed -i 's/protobuf_generate/onnxruntime_protobuf_generate/g' protobuf-config.cmake.orig
|
||||
#replace 'protobuf::protoc' with ${PROTOC_EXECUTABLE} and ${PROTOC_DEPS}
|
||||
#remove OUTDIR
|
||||
#add compile options to generated C++ source files to work around warnings
|
||||
|
||||
function(onnxruntime_protobuf_generate)
|
||||
include(CMakeParseArguments)
|
||||
|
|
@ -166,6 +167,30 @@ function(onnxruntime_protobuf_generate)
|
|||
endforeach()
|
||||
|
||||
set_source_files_properties(${_generated_srcs_all} PROPERTIES GENERATED TRUE)
|
||||
|
||||
if(onnxruntime_protobuf_generate_LANGUAGE STREQUAL cpp)
|
||||
# work around warnings from protobuf generated C++ code
|
||||
# TODO remove these if possible when upgrading protobuf. hopefully we don't need to add to them.
|
||||
|
||||
set(_warning_options)
|
||||
|
||||
if(MSVC)
|
||||
# google\protobuf\has_bits.h(74,0): Warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
|
||||
list(APPEND _warning_options "/wd4267")
|
||||
else()
|
||||
# TODO remove when we upgrade to a protobuf version where this is fixed (looks like it is addressed in version 22.0+)
|
||||
# google/protobuf/parse_context.h:328:47: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
|
||||
# int chunk_size = buffer_end_ + kSlopBytes - ptr;
|
||||
if(HAS_SHORTEN_64_TO_32)
|
||||
list(APPEND _warning_options "-Wno-error=shorten-64-to-32")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(_warning_options)
|
||||
set_source_files_properties(${_generated_srcs_all} PROPERTIES COMPILE_OPTIONS ${_warning_options})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(onnxruntime_protobuf_generate_OUT_VAR)
|
||||
set(${onnxruntime_protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -878,12 +878,6 @@ onnxruntime_add_static_library(onnx_test_data_proto ${TEST_SRC_DIR}/proto/tml.pr
|
|||
add_dependencies(onnx_test_data_proto onnx_proto ${onnxruntime_EXTERNAL_DEPENDENCIES})
|
||||
#onnx_proto target should mark this definition as public, instead of private
|
||||
target_compile_definitions(onnx_test_data_proto PRIVATE "-DONNX_API=")
|
||||
if(WIN32)
|
||||
target_compile_options(onnx_test_data_proto PRIVATE "/wd4100" "/wd4125" "/wd4127" "/wd4267" "/wd4456" "/wd4800" "/wd6011" "/wd6387" "/wd28182")
|
||||
else()
|
||||
#Once we upgrade protobuf to 3.17.3+, we can remove this
|
||||
target_compile_options(onnx_test_data_proto PRIVATE "-Wno-unused-parameter")
|
||||
endif()
|
||||
onnxruntime_add_include_to_target(onnx_test_data_proto onnx_proto)
|
||||
target_include_directories(onnx_test_data_proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set_target_properties(onnx_test_data_proto PROPERTIES FOLDER "ONNXRuntimeTest")
|
||||
|
|
|
|||
36
cmake/patches/flatbuffers/flatbuffers.patch
Normal file
36
cmake/patches/flatbuffers/flatbuffers.patch
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3987eac9..5e5462f1 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -223,7 +223,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
"${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
endif(CYGWIN)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
- "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow")
|
||||
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow -Wno-error=stringop-overflow")
|
||||
set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||
diff --git a/src/idl_gen_rust.cpp b/src/idl_gen_rust.cpp
|
||||
index 55b8439b..dc03e8a8 100644
|
||||
--- a/src/idl_gen_rust.cpp
|
||||
+++ b/src/idl_gen_rust.cpp
|
||||
@@ -406,7 +406,8 @@ class RustGenerator : public BaseGenerator {
|
||||
// example: f(A, D::E) -> super::D::E
|
||||
// does not include leaf object (typically a struct type).
|
||||
|
||||
- size_t i = 0;
|
||||
+ // fix unused but set variable warning
|
||||
+ //size_t i = 0;
|
||||
std::stringstream stream;
|
||||
|
||||
auto s = src->components.begin();
|
||||
@@ -417,7 +418,7 @@ class RustGenerator : public BaseGenerator {
|
||||
if (*s != *d) { break; }
|
||||
++s;
|
||||
++d;
|
||||
- ++i;
|
||||
+ //++i;
|
||||
}
|
||||
|
||||
for (; s != src->components.end(); ++s) { stream << "super::"; }
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3987eac..5e5462f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -223,7 +223,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
"${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
endif(CYGWIN)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
- "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow")
|
||||
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow -Wno-error=stringop-overflow")
|
||||
set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||
|
|
@ -35,16 +35,23 @@ diff --git a/onnx/onnx_pb.h b/onnx/onnx_pb.h
|
|||
index 0aab3e26..0f859267 100644
|
||||
--- a/onnx/onnx_pb.h
|
||||
+++ b/onnx/onnx_pb.h
|
||||
@@ -47,10 +47,21 @@
|
||||
@@ -47,10 +47,28 @@
|
||||
#define ONNX_API ONNX_IMPORT
|
||||
#endif
|
||||
|
||||
+// onnx/onnx-operators-ml.pb.h:1178:25: required from here
|
||||
+// protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: error: unused parameter ‘prototype’ [-Werror=unused-parameter]
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
+
|
||||
+// In file included from onnx/onnx-ml.pb.h:30:
|
||||
+// In file included from google/protobuf/extension_set.h:53:
|
||||
+// google/protobuf/parse_context.h:328:47: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
|
||||
+#if defined(__has_warning)
|
||||
+#if __has_warning("-Wshorten-64-to-32")
|
||||
+#pragma GCC diagnostic ignored "-Wshorten-64-to-32"
|
||||
+#endif
|
||||
+#endif // defined(__has_warning)
|
||||
+
|
||||
+#endif // defined(__GNUC__)
|
||||
+
|
||||
#ifdef ONNX_ML
|
||||
#include "onnx/onnx-ml.pb.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <queue>
|
||||
#include <math.h>
|
||||
#include "core/common/common.h"
|
||||
#include "core/common/narrow.h"
|
||||
#include "core/common/safeint.h"
|
||||
#include "core/common/span_utils.h"
|
||||
#include "core/framework/allocator.h"
|
||||
|
|
@ -208,7 +209,7 @@ void BeamSearchScorer::Finalize(ISequences& sequences,
|
|||
for (size_t beam_index = 0; beam_index < num_beams_; beam_index++) {
|
||||
size_t batch_beam_index = batch_index * num_beams_ + beam_index;
|
||||
float final_score = final_beam_scores[batch_beam_index];
|
||||
auto final_tokens = sequences.GetSequence(batch_beam_index);
|
||||
auto final_tokens = sequences.GetSequence(narrow<int>(batch_beam_index));
|
||||
beam_hyp.Add(final_tokens, final_score);
|
||||
}
|
||||
}
|
||||
|
|
@ -241,8 +242,8 @@ void BeamSearchScorer::Finalize(ISequences& sequences,
|
|||
}
|
||||
|
||||
beam_hyp.Output(
|
||||
num_return_sequences,
|
||||
max_length_,
|
||||
narrow<int>(num_return_sequences),
|
||||
narrow<int>(max_length_),
|
||||
batch_output,
|
||||
batch_sequence_score);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ std::vector<std::string> GetStackTrace() {
|
|||
void* array[kCallstackLimit];
|
||||
char** strings = nullptr;
|
||||
|
||||
size_t size = backtrace(array, kCallstackLimit);
|
||||
int size = backtrace(array, kCallstackLimit);
|
||||
stack.reserve(size);
|
||||
strings = backtrace_symbols(array, size);
|
||||
|
||||
|
|
@ -34,8 +34,8 @@ std::vector<std::string> GetStackTrace() {
|
|||
// >addr2line -f -C -e /home/me/src/github/onnxruntime/build/Linux/Debug/onnxruntime_test_all +0x3f46cc
|
||||
|
||||
// hide GetStackTrace so the output starts with the 'real' location
|
||||
constexpr size_t start_frame = 1;
|
||||
for (size_t i = start_frame; i < size; i++) {
|
||||
constexpr int start_frame = 1;
|
||||
for (int i = start_frame; i < size; i++) {
|
||||
stack.push_back(strings[i]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ Status AddPReluWeight(ModelBuilder& model_builder, const Node& node,
|
|||
|
||||
auto& weight_values = *prelu.mutable_alpha()->mutable_floatvalue();
|
||||
weight_values.Clear();
|
||||
weight_values.Resize(num_channels, value);
|
||||
weight_values.Resize(narrow<int>(num_channels), value);
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ Status Dropout<T1, T2>::Compute(OpKernelContext* context) const {
|
|||
// generate mask
|
||||
{
|
||||
RandomGenerator& generator = generator_ != nullptr ? *generator_.get() : RandomGenerator::Default();
|
||||
std::default_random_engine rng(generator.NextSeed());
|
||||
std::default_random_engine rng(gsl::narrow_cast<std::default_random_engine::result_type>(generator.NextSeed()));
|
||||
std::uniform_real_distribution<float> dist{0.0f, 1.0f};
|
||||
mask_arr = Eigen::ArrayX<bool>::NullaryExpr(
|
||||
mask_arr.size(),
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "string_normalizer.h"
|
||||
#include "core/common/common.h"
|
||||
#include "core/framework/tensor.h"
|
||||
#include "onnxruntime_config.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <codecvt>
|
||||
|
|
@ -13,12 +14,22 @@
|
|||
#else
|
||||
#include <limits>
|
||||
#include <iconv.h>
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
#include <locale>
|
||||
#include <functional>
|
||||
#include <unordered_set>
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// Allow deprecated-declarations warning - std::wstring_convert is deprecated.
|
||||
// TODO find a suitable replacement
|
||||
// Note: GNU libiconv (e.g., on Apple platforms) is not suitable due to its LGPL license.
|
||||
#if defined(HAS_DEPRECATED_DECLARATIONS)
|
||||
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
|
||||
#endif // defined(HAS_DEPRECATED_DECLARATIONS)
|
||||
#endif // defined(__GNUC__)
|
||||
|
||||
namespace onnxruntime {
|
||||
|
||||
ONNX_CPU_OPERATOR_KERNEL(
|
||||
|
|
@ -76,7 +87,7 @@ using Utf8Converter = std::wstring_convert<std::codecvt_utf8<wchar_t>>;
|
|||
|
||||
const std::string default_locale("en-US");
|
||||
|
||||
#else // MS_VER
|
||||
#else // _MSC_VER
|
||||
|
||||
class Locale {
|
||||
public:
|
||||
|
|
@ -111,10 +122,12 @@ class Locale {
|
|||
};
|
||||
|
||||
#if defined(__APPLE__) || defined(__ANDROID__)
|
||||
|
||||
using Utf8Converter = std::wstring_convert<std::codecvt_utf8<wchar_t>>;
|
||||
|
||||
#else
|
||||
|
||||
// All others (Linux)
|
||||
// All others (not Windows, Apple, or Android)
|
||||
class Utf8Converter {
|
||||
public:
|
||||
Utf8Converter(const std::string&, const std::wstring&) {}
|
||||
|
|
@ -186,11 +199,11 @@ class Utf8Converter {
|
|||
}
|
||||
};
|
||||
|
||||
#endif // __APPLE__
|
||||
#endif
|
||||
|
||||
const std::string default_locale("en_US.UTF-8"); // All non-MS
|
||||
|
||||
#endif // MS_VER
|
||||
#endif // _MSC_VER
|
||||
|
||||
template <class ForwardIter>
|
||||
Status CopyCaseAction(ForwardIter first, ForwardIter end, OpKernelContext* ctx,
|
||||
|
|
|
|||
|
|
@ -12,9 +12,13 @@ limitations under the License.
|
|||
/* Modifications Copyright (c) Microsoft. */
|
||||
|
||||
#include "non_max_suppression.h"
|
||||
#include "non_max_suppression_helper.h"
|
||||
|
||||
#include <queue>
|
||||
#include <utility>
|
||||
|
||||
#include "core/common/narrow.h"
|
||||
#include "non_max_suppression_helper.h"
|
||||
|
||||
// TODO:fix the warnings
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4244)
|
||||
|
|
@ -89,7 +93,7 @@ Status NonMaxSuppressionBase::PrepareCompute(OpKernelContext* ctx, PrepareContex
|
|||
|
||||
pc.num_batches_ = boxes_dims[0];
|
||||
pc.num_classes_ = scores_dims[1];
|
||||
pc.num_boxes_ = boxes_dims[1];
|
||||
pc.num_boxes_ = narrow<int>(boxes_dims[1]);
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <type_traits>
|
||||
|
||||
#include "core/common/gsl.h"
|
||||
#include "core/framework/data_types.h"
|
||||
#include "core/framework/error_code_helper.h"
|
||||
#include "core/framework/onnxruntime_typeinfo.h"
|
||||
|
|
@ -60,7 +61,7 @@ ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetOutputCount, _In_ const OrtKernelC
|
|||
|
||||
ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetInput, _In_ const OrtKernelContext* context, _In_ size_t index, _Out_ const OrtValue** out) {
|
||||
API_IMPL_BEGIN
|
||||
*out = reinterpret_cast<const OrtValue*>(reinterpret_cast<const onnxruntime::OpKernelContextInternal*>(context)->GetInputMLValue(index));
|
||||
*out = reinterpret_cast<const OrtValue*>(reinterpret_cast<const onnxruntime::OpKernelContextInternal*>(context)->GetInputMLValue(gsl::narrow_cast<int>(index)));
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
};
|
||||
|
|
@ -68,7 +69,7 @@ ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetInput, _In_ const OrtKernelContext
|
|||
ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetOutput, _Inout_ OrtKernelContext* context, _In_ size_t index, _In_ const int64_t* dim_values, size_t dim_count, _Out_ OrtValue** out) {
|
||||
API_IMPL_BEGIN
|
||||
onnxruntime::TensorShape shape(dim_values, dim_count);
|
||||
*out = reinterpret_cast<OrtValue*>(reinterpret_cast<onnxruntime::OpKernelContextInternal*>(context)->OutputMLValue(index, shape));
|
||||
*out = reinterpret_cast<OrtValue*>(reinterpret_cast<onnxruntime::OpKernelContextInternal*>(context)->OutputMLValue(gsl::narrow_cast<int>(index), shape));
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
};
|
||||
|
|
@ -306,7 +307,7 @@ ORT_API_STATUS_IMPL(OrtApis::KernelInfoGetConstantInput_tensor, _In_ const OrtKe
|
|||
_Out_ int* is_constant, _Outptr_ const OrtValue** out) {
|
||||
API_IMPL_BEGIN
|
||||
const auto* op_info = reinterpret_cast<const onnxruntime::OpKernelInfo*>(info);
|
||||
*is_constant = static_cast<int>(op_info->TryGetConstantInput(index, out));
|
||||
*is_constant = static_cast<int>(op_info->TryGetConstantInput(gsl::narrow_cast<int>(index), out));
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
};
|
||||
|
|
@ -433,7 +434,7 @@ KernelCreateInfo CreateKernelCreateInfo(const std::string& domain, const OrtCust
|
|||
// to work with newer versions (> 12) of the ORT binary.
|
||||
if (op->version > 12) {
|
||||
for (size_t i = 0; i < input_count; i++) {
|
||||
def_builder.InputMemoryType(op->GetInputMemoryType(op, i), i);
|
||||
def_builder.InputMemoryType(op->GetInputMemoryType(op, i), gsl::narrow_cast<int>(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +506,7 @@ ONNX_NAMESPACE::OpSchema CreateSchema(const std::string& domain, const OrtCustom
|
|||
undefined++;
|
||||
}
|
||||
std::string input_name = "Input" + std::to_string(i);
|
||||
schema.Input(i, input_name, "", input_name, option, is_homogeneous, min_arity);
|
||||
schema.Input(gsl::narrow_cast<int>(i), input_name, "", input_name, option, is_homogeneous, min_arity);
|
||||
// support all types as input here in schema, and handle the type inference in TypeShapeInference func
|
||||
schema.TypeConstraint(input_name, DataTypeImpl::ToString(DataTypeImpl::AllTensorTypes()), "all types");
|
||||
}
|
||||
|
|
@ -543,7 +544,7 @@ ONNX_NAMESPACE::OpSchema CreateSchema(const std::string& domain, const OrtCustom
|
|||
}
|
||||
}
|
||||
std::string output_name = "Output" + std::to_string(i);
|
||||
schema.Output(i, output_name, "", output_name, option, is_homogeneous, min_arity);
|
||||
schema.Output(gsl::narrow_cast<int>(i), output_name, "", output_name, option, is_homogeneous, min_arity);
|
||||
// support all types as input here in schema, and handle the type inference in TypeShapeInference func
|
||||
schema.TypeConstraint(output_name, DataTypeImpl::ToString(DataTypeImpl::AllTensorTypes()), "all types");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/common/narrow.h"
|
||||
#include "core/platform/env_var_utils.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "test/common/tensor_op_test_utils.h"
|
||||
|
|
@ -392,29 +393,29 @@ static void RunModelWithRandomInput(
|
|||
constexpr int hidden_size = 768;
|
||||
constexpr int num_heads = 12;
|
||||
|
||||
int token_count = 0;
|
||||
int64_t token_count = 0;
|
||||
std::vector<int32_t> cum_seq_len(batch_size + 1);
|
||||
cum_seq_len[0] = 0;
|
||||
|
||||
int original_offset = 0;
|
||||
int token_offset_idx = 0;
|
||||
int64_t original_offset = 0;
|
||||
int64_t token_offset_idx = 0;
|
||||
std::vector<int32_t> token_offset(batch_size * sequence_length);
|
||||
for (int b = 0; b < batch_size; b++) {
|
||||
int actual_seq_len = (sequence_length / (b + 1));
|
||||
for (int64_t b = 0; b < batch_size; b++) {
|
||||
int64_t actual_seq_len = (sequence_length / (b + 1));
|
||||
token_count += actual_seq_len;
|
||||
cum_seq_len[b + 1] = token_count;
|
||||
cum_seq_len[b + 1] = narrow<int32_t>(token_count);
|
||||
|
||||
original_offset = b * sequence_length;
|
||||
for (int s = 0; s < actual_seq_len; s++) {
|
||||
token_offset[token_offset_idx++] = original_offset++;
|
||||
for (int64_t s = 0; s < actual_seq_len; s++) {
|
||||
token_offset[token_offset_idx++] = narrow<int32_t>(original_offset++);
|
||||
}
|
||||
}
|
||||
|
||||
for (int b = 0; b < batch_size; b++) {
|
||||
int actual_seq_len = (sequence_length / (b + 1));
|
||||
for (int64_t b = 0; b < batch_size; b++) {
|
||||
int64_t actual_seq_len = (sequence_length / (b + 1));
|
||||
original_offset = b * sequence_length + actual_seq_len;
|
||||
for (int s = actual_seq_len; s < sequence_length; s++) {
|
||||
token_offset[token_offset_idx++] = original_offset++;
|
||||
for (int64_t s = actual_seq_len; s < sequence_length; s++) {
|
||||
token_offset[token_offset_idx++] = narrow<int32_t>(original_offset++);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ void TransformerTester(const std::function<void(ModelTestBuilder& helper)>& buil
|
|||
const std::function<void(InferenceSessionWrapper& session)>& check_transformed_graph,
|
||||
TransformerLevel baseline_level,
|
||||
TransformerLevel target_level,
|
||||
const std::vector<int64_t>& opset_versions,
|
||||
const std::vector<int>& opset_versions,
|
||||
double per_sample_tolerance,
|
||||
double relative_per_sample_tolerance,
|
||||
std::unique_ptr<GraphTransformer> transformer,
|
||||
|
|
@ -127,13 +127,13 @@ Status TestGraphTransformer(const std::function<void(ModelTestBuilder& helper)>&
|
|||
const logging::Logger& logger, std::unique_ptr<GraphTransformer> transformer,
|
||||
TransformerLevel level, unsigned steps, const std::function<Status(Graph&)>& pre_graph_checker,
|
||||
const std::function<Status(Graph&)>& post_graph_checker) {
|
||||
const std::vector<int64_t> opset_versions{opset_version};
|
||||
const std::vector<int> opset_versions{opset_version};
|
||||
return TestGraphTransformer(build_test_case, opset_versions, logger, std::move(transformer),
|
||||
level, steps, pre_graph_checker, post_graph_checker);
|
||||
}
|
||||
|
||||
Status TestGraphTransformer(const std::function<void(ModelTestBuilder& helper)>& build_test_case,
|
||||
const std::vector<int64_t>& opset_versions,
|
||||
const std::vector<int>& opset_versions,
|
||||
const logging::Logger& logger, std::unique_ptr<GraphTransformer> transformer,
|
||||
TransformerLevel level, unsigned steps, const std::function<Status(Graph&)>& pre_graph_checker,
|
||||
const std::function<Status(Graph&)>& post_graph_checker) {
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ void TransformerTester(const std::function<void(ModelTestBuilder& helper)>& buil
|
|||
const std::function<void(InferenceSessionWrapper& session)>& check_transformed_graph,
|
||||
TransformerLevel baseline_level,
|
||||
TransformerLevel target_level,
|
||||
const std::vector<int64_t>& opset_versions,
|
||||
const std::vector<int>& opset_versions,
|
||||
double per_sample_tolerance = 0.0,
|
||||
double relative_per_sample_tolerance = 0.0,
|
||||
std::unique_ptr<GraphTransformer> transformer = nullptr, // must be null in this case.
|
||||
|
|
@ -454,7 +454,7 @@ Status TestGraphTransformer(const std::function<void(ModelTestBuilder& helper)>&
|
|||
* @param post_graph_checker The graph checker function after applying the transformer
|
||||
*/
|
||||
Status TestGraphTransformer(const std::function<void(ModelTestBuilder& helper)>& build_test_case,
|
||||
const std::vector<int64_t>& opset_versions,
|
||||
const std::vector<int>& opset_versions,
|
||||
const logging::Logger& logger, std::unique_ptr<GraphTransformer> transformer,
|
||||
TransformerLevel level, unsigned steps, const std::function<Status(Graph&)>& pre_graph_checker,
|
||||
const std::function<Status(Graph&)>& post_graph_checker);
|
||||
|
|
|
|||
|
|
@ -2170,7 +2170,7 @@ TEST(QDQTransformerTests, Clip) {
|
|||
epsilon);
|
||||
};
|
||||
|
||||
std::vector<int64_t> opsets{12, 18, 19};
|
||||
std::vector<int> opsets{12, 18, 19};
|
||||
for (auto opset : opsets) {
|
||||
test_case(.0235294122248888f, static_cast<int8_t>(-128), 0, opset); // [0, 6]
|
||||
test_case(.02f, static_cast<int8_t>(-128), 0, opset); // [0, 5.1]
|
||||
|
|
|
|||
|
|
@ -1669,6 +1669,11 @@ def run_android_tests(args, source_dir, build_dir, config, cwd):
|
|||
|
||||
|
||||
def run_ios_tests(args, source_dir, config, cwd):
|
||||
simulator_device_name = subprocess.check_output(
|
||||
["bash", os.path.join(source_dir, "tools", "ci_build", "github", "apple", "get_simulator_device_name.sh")],
|
||||
text=True,
|
||||
).strip()
|
||||
|
||||
xc_test_schemes = [
|
||||
"onnxruntime_test_all_xc",
|
||||
]
|
||||
|
|
@ -1691,7 +1696,7 @@ def run_ios_tests(args, source_dir, config, cwd):
|
|||
"-scheme",
|
||||
xc_test_scheme,
|
||||
"-destination",
|
||||
"platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)",
|
||||
f"platform=iOS Simulator,OS=latest,name={simulator_device_name}",
|
||||
],
|
||||
cwd=cwd,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"--use_coreml",
|
||||
"--skip_tests",
|
||||
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
|
||||
"--apple_deploy_target=11.0",
|
||||
"--apple_deploy_target=12.0",
|
||||
"--use_xnnpack"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@
|
|||
"--use_coreml",
|
||||
"--skip_tests",
|
||||
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
|
||||
"--apple_deploy_target=11.0"
|
||||
"--apple_deploy_target=12.0"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
8
tools/ci_build/github/apple/get_simulator_device_name.sh
Executable file
8
tools/ci_build/github/apple/get_simulator_device_name.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Get a suitable simulator device type name.
|
||||
# This picks one with name containing "iPhone" with the largest minRuntimeVersion value.
|
||||
xcrun simctl list devicetypes "iPhone" --json | \
|
||||
jq --raw-output '.devicetypes | max_by(.minRuntimeVersion) | .name'
|
||||
|
|
@ -114,6 +114,11 @@ def _test_ios_packages(args):
|
|||
|
||||
# run the tests
|
||||
if not args.prepare_test_project_only:
|
||||
simulator_device_name = subprocess.check_output(
|
||||
["bash", str(REPO_DIR / "tools" / "ci_build" / "github" / "apple" / "get_simulator_device_name.sh")],
|
||||
text=True,
|
||||
).strip()
|
||||
|
||||
subprocess.run(
|
||||
[
|
||||
"xcrun",
|
||||
|
|
@ -124,7 +129,7 @@ def _test_ios_packages(args):
|
|||
"-scheme",
|
||||
"ios_package_test",
|
||||
"-destination",
|
||||
"platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)",
|
||||
f"platform=iOS Simulator,OS=latest,name={simulator_device_name}",
|
||||
],
|
||||
shell=False,
|
||||
check=True,
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ stages:
|
|||
jobs:
|
||||
- job: Test_CPU_EP
|
||||
pool:
|
||||
# We need macOS-12 to run the Android emulator for now.
|
||||
# https://github.com/actions/runner-images/issues/7671
|
||||
vmImage: 'macOS-12'
|
||||
workspace:
|
||||
clean: all
|
||||
|
|
@ -261,6 +263,8 @@ stages:
|
|||
|
||||
- job: Test_NNAPI_EP
|
||||
pool:
|
||||
# We need macOS-12 to run the Android emulator for now.
|
||||
# https://github.com/actions/runner-images/issues/7671
|
||||
vmImage: 'macOS-12'
|
||||
timeoutInMinutes: 90
|
||||
workspace:
|
||||
|
|
@ -354,6 +358,8 @@ stages:
|
|||
jobs:
|
||||
- job: NNAPI_EP_MASTER
|
||||
pool:
|
||||
# We need macOS-12 to run the Android emulator for now.
|
||||
# https://github.com/actions/runner-images/issues/7671
|
||||
vmImage: 'macOS-12'
|
||||
timeoutInMinutes: 180
|
||||
workspace:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ jobs:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
variables:
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.14'
|
||||
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
|
||||
|
|
@ -13,6 +13,8 @@ jobs:
|
|||
- script: brew install coreutils ninja
|
||||
displayName: Install coreutils and ninja
|
||||
|
||||
- template: templates/use-xcode-version.yml
|
||||
|
||||
- template: templates/mac-build-step-with-cache.yml
|
||||
parameters:
|
||||
WithCache: true
|
||||
|
|
@ -21,6 +23,7 @@ jobs:
|
|||
CacheDir: $(CCACHE_DIR)
|
||||
BuildStep:
|
||||
- script: |
|
||||
set -e
|
||||
python3 tools/ci_build/build.py \
|
||||
--build_dir build \
|
||||
--skip_submodule_sync \
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ jobs:
|
|||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
variables:
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.14'
|
||||
PROTO_CACHE_DIR: $(Pipeline.Workspace)/proto_ccache
|
||||
ORT_CACHE_DIR: $(Pipeline.Workspace)/ort_ccache
|
||||
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
|
||||
|
|
@ -24,6 +23,14 @@ jobs:
|
|||
env:
|
||||
CCACHE_DIR: $(PROTO_CACHE_DIR)
|
||||
|
||||
- template: templates/use-xcode-version.yml
|
||||
# TODO figure out XNNPACK EP test failures
|
||||
# Failing tests:
|
||||
# -[XnnpackEP TestConvTranspose_qdq]
|
||||
# -[XnnpackEP TestQDQConvS8S8_per_channel]
|
||||
parameters:
|
||||
xcodeVersion: "13.1"
|
||||
|
||||
- template: templates/mac-build-step-with-cache.yml
|
||||
parameters:
|
||||
WithCache: true
|
||||
|
|
@ -33,7 +40,6 @@ jobs:
|
|||
ChangeEveryCommit: true
|
||||
BuildStep:
|
||||
- script: |
|
||||
sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
|
||||
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py \
|
||||
--skip_submodule_sync \
|
||||
--build_dir $(Build.BinariesDirectory)/iOS \
|
||||
|
|
@ -43,7 +49,7 @@ jobs:
|
|||
--ios \
|
||||
--ios_sysroot iphonesimulator \
|
||||
--osx_arch x86_64 \
|
||||
--apple_deploy_target 11.0 \
|
||||
--apple_deploy_target 12.0 \
|
||||
--use_xcode \
|
||||
--config RelWithDebInfo \
|
||||
--build_apple_framework \
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@ jobs:
|
|||
displayName: "iOS Packaging"
|
||||
|
||||
pool:
|
||||
vmImage: "macOS-12"
|
||||
vmImage: "macOS-13"
|
||||
|
||||
variables:
|
||||
xcodeVersion: "14.3"
|
||||
|
||||
timeoutInMinutes: 300
|
||||
|
||||
|
|
@ -44,6 +47,12 @@ jobs:
|
|||
addToPath: true
|
||||
architecture: "x64"
|
||||
|
||||
- template: templates/use-xcode-version.yml
|
||||
parameters:
|
||||
xcodeVersion: ${{ variables.xcodeVersion }}
|
||||
|
||||
- template: templates/install-appcenter.yml
|
||||
|
||||
- script: |
|
||||
pip install -r tools/ci_build/github/apple/ios_packaging.requirements.txt
|
||||
displayName: "Install Python requirements"
|
||||
|
|
@ -115,11 +124,13 @@ jobs:
|
|||
xcWorkspacePath: '$(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/ios_package_test.xcworkspace'
|
||||
sdk: 'iphoneos'
|
||||
scheme: 'ios_package_test'
|
||||
xcodeVersion: 'specifyPath'
|
||||
xcodeDeveloperDir: '/Applications/Xcode_${{ variables.xcodeVersion }}.app/Contents/Developer'
|
||||
signingOption: 'manual'
|
||||
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
|
||||
provisioningProfileName: 'iOS Team Provisioning Profile'
|
||||
args: '-derivedDataPath $(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/DerivedData'
|
||||
workingDirectory: $(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/
|
||||
workingDirectory: '$(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/'
|
||||
displayName: '[Mobile] Build iphone arm64 tests'
|
||||
|
||||
- script: |
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ jobs:
|
|||
- job: ObjCStaticAnalysis
|
||||
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
|
||||
timeoutInMinutes: 30
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ stages:
|
|||
clean: all
|
||||
timeoutInMinutes: 120
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
|
||||
variables:
|
||||
- name: OnnxRuntimeBuildDirectory
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ stages:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
|
||||
variables:
|
||||
- name: OnnxRuntimeBuildDirectory
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ stages:
|
|||
parameters:
|
||||
job_name: Test_MAC_Wheels
|
||||
machine_pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
itemPattern: '*/*mac*x86_64.whl'
|
||||
- template: templates/py-package-smoking-test.yml
|
||||
parameters:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ jobs:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
# We need macOS-12 to run the Android emulator for now.
|
||||
# https://github.com/actions/runner-images/issues/7671
|
||||
vmImage: 'macOS-12'
|
||||
variables:
|
||||
- name: runCodesignValidationInjection
|
||||
|
|
@ -46,6 +48,8 @@ jobs:
|
|||
|
||||
- template: use-android-ndk.yml
|
||||
|
||||
- template: install-appcenter.yml
|
||||
|
||||
- script: |
|
||||
python3 $(Build.SourcesDirectory)/tools/python/run_android_emulator.py \
|
||||
--android-sdk-root ${ANDROID_SDK_ROOT} \
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ stages:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
timeoutInMinutes: 300
|
||||
steps:
|
||||
- template: set-version-number-variables-step.yml
|
||||
|
|
@ -788,7 +788,7 @@ stages:
|
|||
|
||||
- template: ../nuget/templates/test_macos.yml
|
||||
parameters:
|
||||
AgentPool : macOS-12
|
||||
AgentPool : macOS-13
|
||||
ArtifactSuffix: 'CPU'
|
||||
|
||||
- template: ../nodejs/templates/test_win.yml
|
||||
|
|
@ -896,7 +896,7 @@ stages:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
variables:
|
||||
- name: runCodesignValidationInjection
|
||||
value: false
|
||||
|
|
@ -911,6 +911,8 @@ stages:
|
|||
artifactName: 'onnxruntime-java'
|
||||
targetPath: '$(Build.BinariesDirectory)/final-jar'
|
||||
|
||||
- template: use-xcode-version.yml
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: |
|
||||
|
|
@ -922,7 +924,6 @@ stages:
|
|||
popd
|
||||
wget https://oss.sonatype.org/service/local/repositories/releases/content/org/junit/platform/junit-platform-console-standalone/1.6.2/junit-platform-console-standalone-1.6.2.jar -P ./
|
||||
wget https://oss.sonatype.org/service/local/repositories/releases/content/com/google/protobuf/protobuf-java/3.21.7/protobuf-java-3.21.7.jar -P ./
|
||||
sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
|
||||
DYLD_LIBRARY_PATH=./test:${DYLD_LIBRARY_PATH}
|
||||
java -jar ./junit-platform-console-standalone-1.6.2.jar -cp .:./test:./protobuf-java-3.21.7.jar:./onnxruntime-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner
|
||||
workingDirectory: '$(Build.BinariesDirectory)/final-jar'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
# Install appcenter CLI
|
||||
|
||||
parameters:
|
||||
- name: appcenterVersion
|
||||
type: string
|
||||
default: "2.13.7"
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
set -e -x
|
||||
npm install -g appcenter-cli@${{ parameters.appcenterVersion }}
|
||||
displayName: Install appcenter CLI ${{ parameters.appcenterVersion }}
|
||||
|
|
@ -51,7 +51,7 @@ stages:
|
|||
- MacOS_C_API_Packaging_CPU_arm64
|
||||
- MacOS_C_API_Packaging_CPU_universal2
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
|
|
@ -83,7 +83,7 @@ stages:
|
|||
- job: MacOS_C_API_Package_Publish_x86_64
|
||||
dependsOn: MacOS_C_API_Packaging_CPU_x86_64
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
|
|
@ -96,4 +96,4 @@ stages:
|
|||
condition: 'succeededOrFailed()'
|
||||
- template: component-governance-component-detection-steps.yml
|
||||
parameters:
|
||||
condition: 'succeeded'
|
||||
condition: 'succeeded'
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
PROTO_CACHE_DIR: $(Pipeline.Workspace)/ccache_proto
|
||||
ORT_CACHE_DIR: $(Pipeline.Workspace)/ccache_ort
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
timeoutInMinutes: 300
|
||||
steps:
|
||||
- checkout: self
|
||||
|
|
@ -55,6 +55,8 @@ jobs:
|
|||
|
||||
- template: set-version-number-variables-step.yml
|
||||
|
||||
- template: use-xcode-version.yml
|
||||
|
||||
- template: mac-build-step-with-cache.yml
|
||||
parameters:
|
||||
WithCache: ${{ parameters.WithCache }}
|
||||
|
|
@ -72,7 +74,6 @@ jobs:
|
|||
export ONNX_ML=1
|
||||
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
|
||||
python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt'
|
||||
sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
|
||||
displayName: 'Install dependencies'
|
||||
env:
|
||||
CCACHE_DIR: $(PROTO_CACHE_DIR)
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ stages:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
variables:
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.15'
|
||||
strategy:
|
||||
|
|
@ -362,6 +362,8 @@ stages:
|
|||
inputs:
|
||||
versionSpec: $(PythonVersion)
|
||||
|
||||
- template: use-xcode-version.yml
|
||||
|
||||
- script: |
|
||||
set -e -x
|
||||
pushd .
|
||||
|
|
@ -375,7 +377,6 @@ stages:
|
|||
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
|
||||
export _PYTHON_HOST_PLATFORM=macosx-${{variables.MACOSX_DEPLOYMENT_TARGET}}-x86_64
|
||||
python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt'
|
||||
sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
|
||||
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_onnx_tests --build_wheel ${{ parameters.build_py_parameters }}
|
||||
displayName: 'Command Line Script'
|
||||
|
||||
|
|
@ -401,7 +402,7 @@ stages:
|
|||
workspace:
|
||||
clean: all
|
||||
pool:
|
||||
vmImage: 'macOS-12'
|
||||
vmImage: 'macOS-13'
|
||||
variables:
|
||||
MACOSX_DEPLOYMENT_TARGET: '11.0'
|
||||
strategy:
|
||||
|
|
@ -432,6 +433,8 @@ stages:
|
|||
system_profiler SPSoftwareDataType SPHardwareDataType
|
||||
displayName: 'Mac machine info'
|
||||
|
||||
- template: use-xcode-version.yml
|
||||
|
||||
# Don't remove _PYTHON_HOST_PLATFORM, it's used to generate correct package name
|
||||
# Setting _PYTHON_HOST_PLATFORM overwrites the value return by get_platform()
|
||||
# Ref: https://wiki.debian.org/Python/MultiArch
|
||||
|
|
@ -448,7 +451,6 @@ stages:
|
|||
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
|
||||
export _PYTHON_HOST_PLATFORM=macosx-${{variables.MACOSX_DEPLOYMENT_TARGET}}-arm64
|
||||
python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt'
|
||||
sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
|
||||
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_tests --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=arm64 --build_wheel ${{ parameters.build_py_parameters }}
|
||||
displayName: 'Command Line Script'
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ stages:
|
|||
jobs:
|
||||
- job: ReactNative_CI
|
||||
pool:
|
||||
# We need macOS-12 to run the Android emulator for now.
|
||||
# https://github.com/actions/runner-images/issues/7671
|
||||
vmImage: 'macOS-12'
|
||||
variables:
|
||||
runCodesignValidationInjection: false
|
||||
|
|
@ -68,14 +70,14 @@ stages:
|
|||
versionSpec: "3.9"
|
||||
addToPath: true
|
||||
rchitecture: "x64"
|
||||
|
||||
|
||||
- task: JavaToolInstaller@0
|
||||
displayName: Use jdk 11
|
||||
inputs:
|
||||
versionSpec: '11'
|
||||
jdkArchitectureOption: 'x64'
|
||||
jdkSourceOption: 'PreInstalled'
|
||||
|
||||
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '16.x'
|
||||
|
|
@ -130,7 +132,7 @@ stages:
|
|||
--variant Full \
|
||||
--build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json \
|
||||
-b="--path_to_protoc_exe" -b "$(Build.BinariesDirectory)/installed/bin/protoc"
|
||||
|
||||
|
||||
# Mobile build:
|
||||
# python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_ios_pods.py \
|
||||
# --build_dir $(Build.BinariesDirectory)/ios_framework_mobile \
|
||||
|
|
@ -167,7 +169,7 @@ stages:
|
|||
contents: onnxruntime-android-*.aar
|
||||
targetFolder: $(Build.SourcesDirectory)/js/react_native/android/libs
|
||||
displayName: Copy Android package to React Native directory
|
||||
|
||||
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js'
|
||||
|
|
@ -295,13 +297,13 @@ stages:
|
|||
detox build --configuration android.emu.release
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e'
|
||||
displayName: Build React Native Detox Android e2e Tests
|
||||
|
||||
|
||||
- script: |
|
||||
JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml \
|
||||
detox test --record-logs all --configuration android.emu.release
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e'
|
||||
displayName: Run React Native Detox Android e2e Tests
|
||||
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml'
|
||||
|
|
@ -309,12 +311,12 @@ stages:
|
|||
testRunTitle: 'React Native Detox Android e2e Test Results'
|
||||
condition: succeededOrFailed()
|
||||
displayName: Publish React Native Detox Android e2e Test Results
|
||||
|
||||
|
||||
- script: |
|
||||
detox build --configuration ios.sim.release
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e'
|
||||
displayName: Build React Native Detox iOS e2e Tests
|
||||
|
||||
|
||||
- script: |
|
||||
JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \
|
||||
detox test --record-logs all --configuration ios.sim.release
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
# Specify use of a specific Xcode version.
|
||||
|
||||
parameters:
|
||||
- name: xcodeVersion
|
||||
type: string
|
||||
default: "14.3"
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
set -e -x
|
||||
XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ parameters.xcodeVersion }}.app/Contents/Developer"
|
||||
sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}"
|
||||
|
||||
displayName: Use Xcode ${{ parameters.xcodeVersion }}
|
||||
|
|
@ -11,6 +11,6 @@
|
|||
"--build_apple_framework",
|
||||
"--use_coreml",
|
||||
"--skip_tests",
|
||||
"--apple_deploy_target=11.0"
|
||||
"--apple_deploy_target=12.0"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@
|
|||
"--enable_reduced_operator_type_support",
|
||||
"--use_coreml",
|
||||
"--skip_tests",
|
||||
"--apple_deploy_target=11.0"
|
||||
"--apple_deploy_target=12.0"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue