Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Exception in iosDynamicFramework Post-Merge workflow #21262

Merged
merged 20 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tools/ci_build/github/apple/test_ios_framework_build_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"build_osx_archs": {
"iphoneos": [
"arm64"
],
"iphonesimulator": [
"arm64",
"x86_64"
]
},
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF"
],
"iphoneos": [
"--ios",
"--apple_deploy_target=13.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=13.0"
]
}
}
5 changes: 3 additions & 2 deletions tools/ci_build/github/azure-pipelines/post-merge-jobs.yml
Original file line number Diff line number Diff line change
@@ -446,14 +446,15 @@ stages:
python tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
--build_dynamic_framework \
tools/ci_build/github/apple/default_full_apple_framework_build_settings.json
tools/ci_build/github/apple/test_ios_framework_build_settings.json
displayName: "Build iOS dynamic framework"

- script: |
python tools/ci_build/github/apple/test_apple_packages.py \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--variant Full
--variant Full \
--skip_macos_test
displayName: "Test pod with iOS framework"

- stage: IosMinimalTrainingBuild

Unchanged files with check annotations Beta

# This sets the default behaviour, overriding core.autocrlf

Check warning on line 1 in .gitattributes

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "behaviour" is a misspelling of "behavior" Raw Output: ./.gitattributes:1:24: "behaviour" is a misspelling of "behavior"
* text=auto
# All source files should have unix line-endings in the repository,
uint32_t size;
WINML_THROW_IF_FAILED(descriptor_native->GetName(&feature_name, &size));
// Case insensetive comparison of onnx name in feature descriptor, and passed in name

Check warning on line 33 in winml/lib/Api/LearningModelBinding.cpp

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "insensetive" is a misspelling of "insensitive" Raw Output: ./winml/lib/Api/LearningModelBinding.cpp:33:12: "insensetive" is a misspelling of "insensitive"
if (_wcsicmp(feature_name, name.c_str()) == 0) {
return descriptor;
}
size_t num_elements, size_t element_size_in_bytes, wfc::IIterable<wss::IBuffer> const& buffers
);
// Privte constructor as this type should be created as a shared_ptr

Check warning on line 18 in winml/lib/Api/impl/NumericData.h

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "Privte" is a misspelling of "Private" Raw Output: ./winml/lib/Api/impl/NumericData.h:18:5: "Privte" is a misspelling of "Private"
numeric_data(size_t num_elements, size_t element_size_in_bytes, wfc::IIterable<wss::IBuffer> const& buffers);
gsl::span<byte> buffer_at(size_t index);
gsl::span<byte> combined_buffer();
testDataPath.replace(environmentVariableFetchSuceeded, testDataPathFolderName.length(), testDataPathFolderName);
} else {
throw std::exception(
"WINML_TEST_DATA_PATH environment variable path needs to be shorter to accomodate the maximum path size of %d\n",

Check warning on line 173 in winml/test/model/model_tests.cpp

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "accomodate" is a misspelling of "accommodate" Raw Output: ./winml/test/model/model_tests.cpp:173:77: "accomodate" is a misspelling of "accommodate"
MAX_PATH
);
}
bool ShouldSkip(
const std::wstring& model_file_name, const std::wstring& image_file_name, const InputImageSource input_image_source
) {
// Case that the tensor's shape doesn't match model's shape should be skiped

Check warning on line 214 in winml/test/image/imagetests.cpp

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "skiped" is a misspelling of "skipped" Raw Output: ./winml/test/image/imagetests.cpp:214:74: "skiped" is a misspelling of "skipped"
if ((L"1080.jpg" == image_file_name || L"kitten_224.png" == image_file_name) && (InputImageSource::FromGPUResource == input_image_source || InputImageSource::FromCPUResource == input_image_source)) {
return true;
}
// Case that the images's shape doesn't match model's shape which expects free dimension should be skiped.

Check warning on line 219 in winml/test/image/imagetests.cpp

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "skiped" is a misspelling of "skipped" Raw Output: ./winml/test/image/imagetests.cpp:219:103: "skiped" is a misspelling of "skipped"
// Because the fns-candy is not real model that can handle free dimensional input
if ((L"1080.jpg" == image_file_name || L"kitten_224.png" == image_file_name) && L"fns-candy_Bgr8_freeDimInput.onnx" == model_file_name) {
return true;
}
#define WINML_SKIP_TEST(message) \
WINML_SUPRESS_UNREACHABLE_BELOW( \

Check warning on line 51 in winml/test/common/taefTestMacros.h

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "SUPRESS" is a misspelling of "SUPPRESS" Raw Output: ./winml/test/common/taefTestMacros.h:51:8: "SUPRESS" is a misspelling of "SUPPRESS"
Log::Result(TestResults::Skipped, std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(message).c_str()); \
return; \
)
constexpr bool alwaysFalse() {
return false;
}
#define WINML_SUPRESS_UNREACHABLE_BELOW(statement) \

Check warning on line 21 in winml/test/common/test.h

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "SUPRESS" is a misspelling of "SUPPRESS" Raw Output: ./winml/test/common/test.h:21:14: "SUPRESS" is a misspelling of "SUPPRESS"
if (alwaysTrue()) { \
statement; \
}
#define INSTANTIATE_TEST_SUITE_P INSTANTIATE_TEST_CASE_P
#endif
#define WINML_SKIP_TEST(message) WINML_SUPRESS_UNREACHABLE_BELOW(GTEST_SKIP() << message)

Check warning on line 67 in winml/test/common/googleTestMacros.h

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "SUPRESS" is a misspelling of "SUPPRESS" Raw Output: ./winml/test/common/googleTestMacros.h:67:39: "SUPRESS" is a misspelling of "SUPPRESS"
#define WINML_EXPECT_NO_THROW(statement) EXPECT_NO_THROW(statement)
#define WINML_EXPECT_TRUE(statement) EXPECT_TRUE(statement)
LearningModelDevice device(nullptr);
WINML_EXPECT_NO_THROW(device = LearningModelDevice(LearningModelDeviceKind::Cpu));
// the model input shape. the batch size, n, is overriden to 5

Check warning on line 318 in winml/test/api/LearningModelSessionAPITest.cpp

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "overriden" is a misspelling of "overridden" Raw Output: ./winml/test/api/LearningModelSessionAPITest.cpp:318:50: "overriden" is a misspelling of "overridden"
uint32_t n = 5;
int64_t c = 3, h = 720, w = 720;
#include <climits>
#include <cstring>
#include <algorithm>
#include <chrono>

Check warning on line 23 in include/onnxruntime/core/common/common.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 <chrono> is an unapproved C++11 header. [build/c++11] [5] Raw Output: include/onnxruntime/core/common/common.h:23: <chrono> is an unapproved C++11 header. [build/c++11] [5]
#include <functional>
#include <memory>
#include <numeric>
#define ORT_WHERE ::onnxruntime::CodeLocation(__FILE__, __LINE__, static_cast<const char*>(__FUNCTION__))
#define ORT_WHERE_WITH_STACK \
::onnxruntime::CodeLocation(__FILE__, __LINE__, static_cast<const char*>(__PRETTY_FUNCTION__), ::onnxruntime::GetStackTrace())

Check warning on line 96 in include/onnxruntime/core/common/common.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: include/onnxruntime/core/common/common.h:96: Lines should be <= 120 characters long [whitespace/line_length] [2]
#ifdef ORT_NO_EXCEPTIONS
} \
} while (0)
inline long long TimeDiffMicroSeconds(TimePoint start_time) {

Check warning on line 252 in include/onnxruntime/core/common/common.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Use int16/int64/etc, rather than the C type long [runtime/int] [4] Raw Output: include/onnxruntime/core/common/common.h:252: Use int16/int64/etc, rather than the C type long [runtime/int] [4]
auto end_time = std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time).count();
}
inline long long TimeDiffMicroSeconds(TimePoint start_time, TimePoint end_time) {

Check warning on line 257 in include/onnxruntime/core/common/common.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Use int16/int64/etc, rather than the C type long [runtime/int] [4] Raw Output: include/onnxruntime/core/common/common.h:257: Use int16/int64/etc, rather than the C type long [runtime/int] [4]
return std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time).count();
}
return item_;
}
const T** operator->() const { return &(operator*()); };

Check warning on line 53 in include/onnxruntime/core/common/const_pointer_container.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 You don't need a ; after a } [readability/braces] [4] Raw Output: include/onnxruntime/core/common/const_pointer_container.h:53: You don't need a ; after a } [readability/braces] [4]
private:
const_iterator current_;
//
//-----------------------------------------------------------------------------
#pragma once
#include "onnxruntime_config.h"

Check warning on line 8 in include/onnxruntime/core/common/eigen_common_wrapper.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Include the directory when naming header files [build/include_subdir] [4] Raw Output: include/onnxruntime/core/common/eigen_common_wrapper.h:8: Include the directory when naming header files [build/include_subdir] [4]
// build/external/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h:162:71:
// error: ignoring attributes on template argument "Eigen::PacketType<const float, Eigen::DefaultDevice>::type {aka __vector(4) float}" [-Werror=ignored-attributes]

Check warning on line 10 in include/onnxruntime/core/common/eigen_common_wrapper.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: include/onnxruntime/core/common/eigen_common_wrapper.h:10: Lines should be <= 120 characters long [whitespace/line_length] [2]
#if defined(__GNUC__)
#pragma GCC diagnostic push
#if __GNUC__ >= 6
#endif
// cmake/external/eigen\Eigen/src/Core/util/Meta.h:454:25:
// error: 'result_of<Eigen::internal::scalar_product_op<unsigned long long> (const unsigned long long &, const unsigned long long &)>'

Check warning on line 30 in include/onnxruntime/core/common/eigen_common_wrapper.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: include/onnxruntime/core/common/eigen_common_wrapper.h:30: Lines should be <= 120 characters long [whitespace/line_length] [2]
// is deprecated [-Werror,-Wdeprecated-declarations]
// typedef typename std::result_of<T>::type type1;
#ifdef HAS_DEPRECATED_DECLARATIONS
class NotImplementedException : public std::logic_error {
public:
explicit NotImplementedException(const char* _Message = "Function not yet implemented") noexcept : std::logic_error(_Message){};

Check warning on line 20 in include/onnxruntime/core/common/exceptions.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: include/onnxruntime/core/common/exceptions.h:20: Lines should be <= 120 characters long [whitespace/line_length] [2]

Check warning on line 20 in include/onnxruntime/core/common/exceptions.h

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 You don't need a ; after a } [readability/braces] [4] Raw Output: include/onnxruntime/core/common/exceptions.h:20: You don't need a ; after a } [readability/braces] [4]
explicit NotImplementedException(const std::string& _Message = "Function not yet implemented") noexcept : std::logic_error(_Message){};
};