Skip to content

Commit

Permalink
Add initial support for CoreML ML Program to the CoreML EP. (#19347)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->
Adds infrastructure to create an ML Package containing the Model using
ML Program. Updated coremltools files to v7.1 to bring in new protobuf
definitions along with the tools to write the weight.bin file and create
an ML Package correctly.

Enables building a CoreML Model on all platforms which means all the
operator builder code can be debugged anywhere. Execution of the
generated CoreML model is obviously limited to Apple platforms.

The Conv operator builder has been updated to be able to generate an ML
Program Operation.


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
NeuralNetwork is no longer being developed and ML Program is the
replacement going forward.
  • Loading branch information
skottmckay authored Feb 14, 2024
1 parent 944d8f8 commit 4e51197
Show file tree
Hide file tree
Showing 54 changed files with 2,131 additions and 1,037 deletions.
6 changes: 1 addition & 5 deletions cmake/onnxruntime_providers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ if(onnxruntime_USE_CUDA)
set(PROVIDERS_CUDA onnxruntime_providers_cuda)
endif()
if(onnxruntime_USE_COREML)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(PROVIDERS_COREML onnxruntime_providers_coreml coreml_proto)
else()
set(PROVIDERS_COREML onnxruntime_providers_coreml)
endif()
set(PROVIDERS_COREML onnxruntime_providers_coreml coreml_proto)
endif()
if(onnxruntime_USE_NNAPI_BUILTIN)
set(PROVIDERS_NNAPI onnxruntime_providers_nnapi)
Expand Down
127 changes: 114 additions & 13 deletions cmake/onnxruntime_providers_coreml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ endif()

add_compile_definitions(USE_COREML=1)

# Check if we can build the coremltools code for creating an mlpackage with an mlprogram.
# The coremltools source requires std::filesystem::path which is only available from iOS 13 on.
set(_enable_ML_PROGRAM ON)
if (IOS AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 13.0)
message(WARNING "CoreML ML Program is not supported on iOS < 13.0. Excluding ML Program support from build.")
set(_enable_ML_PROGRAM OFF)
elseif(LINUX)
# uuid-dev is required. we don't bother installing on CIs as it's really for manual developer testing.
find_library(LibUUID_LIBRARY NAMES uuid)
find_path(LibUUID_INCLUDE_DIR NAMES uuid/uuid.h)
if (NOT LibUUID_INCLUDE_DIR)
message(STATUS "uuid/uuid.h was not found as is required for ML Program support. "
"Run `sudo apt install uuid-dev` if you need to test ML Program related CoreML EP code. ")
set(_enable_ML_PROGRAM OFF)
endif()
endif()

if (_enable_ML_PROGRAM)
add_compile_definitions(COREML_ENABLE_MLPROGRAM=1)
endif()

# Compile CoreML proto definition to ${CMAKE_CURRENT_BINARY_DIR}/coreml_proto
set(COREML_PROTO_ROOT ${coremltools_SOURCE_DIR}/mlmodel/format)
file(GLOB coreml_proto_srcs "${COREML_PROTO_ROOT}/*.proto")
Expand All @@ -19,8 +40,8 @@ target_compile_definitions(coreml_proto
PUBLIC $<TARGET_PROPERTY:${PROTOBUF_LIB},INTERFACE_COMPILE_DEFINITIONS>)
set_target_properties(coreml_proto PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
set_target_properties(coreml_proto PROPERTIES COMPILE_FLAGS "-fvisibility-inlines-hidden")
set(_src_sub_dir "coreml_proto/")

set(_src_sub_dir "coreml_proto/")
onnxruntime_protobuf_generate(
APPEND_PATH
GEN_SRC_SUB_DIR ${_src_sub_dir}
Expand Down Expand Up @@ -55,6 +76,10 @@ file(GLOB_RECURSE onnxruntime_providers_shared_utils_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/shared/utils/utils.cc"
)

file(GLOB onnxruntime_providers_coreml_public_headers CONFIGURE_DEPENDS
"${ONNXRUNTIME_INCLUDE_DIR}/core/providers/coreml/*.h"
)

file(GLOB
onnxruntime_providers_coreml_cc_srcs_top CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/coreml/*.h"
Expand All @@ -67,42 +92,118 @@ file(GLOB_RECURSE
"${ONNXRUNTIME_ROOT}/core/providers/coreml/builders/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/builders/*.cc"
)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(REMOVE_ITEM onnxruntime_providers_coreml_cc_srcs_nested
"${ONNXRUNTIME_ROOT}/core/providers/coreml/builders/model_builder.h"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/builders/model_builder.cc"

if(_enable_ML_PROGRAM)
# Add helpers to create mlpackage weights. limit to just the files we need to minimize the changes to make them
# build on Windows and Linux.
file(GLOB
onnxruntime_providers_coreml_milblob_cc_srcs CONFIGURE_DEPENDS
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/*.hpp"
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/*.cpp"
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/Util/*.hpp"
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/Blob/BlobDataType.hpp"
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/Blob/StorageFormat.hpp"
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/Blob/FileWriter.?pp"
"${coremltools_SOURCE_DIR}/mlmodel/src/MILBlob/Blob/StorageWriter.?pp"
)

# Add helpers to create mlpackage
file(GLOB
onnxruntime_providers_coreml_modelpackage_cc_srcs CONFIGURE_DEPENDS
"${coremltools_SOURCE_DIR}/modelpackage/src/ModelPackage.?pp"
"${coremltools_SOURCE_DIR}/modelpackage/src/Utils/JsonMap.?pp"
)

set(coremltools_srcs
${onnxruntime_providers_coreml_milblob_cc_srcs}
${onnxruntime_providers_coreml_modelpackage_cc_srcs}
)

source_group(TREE ${coremltools_SOURCE_DIR} PREFIX coremltools FILES ${coremltools_srcs})
endif()

# Add CoreML objective c++ source code
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
if (APPLE)
file(GLOB
onnxruntime_providers_coreml_objcc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/model.h"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/model.mm"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/host_utils.h"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/host_utils.mm"
)
else()
# add the Model implementation that uses the protobuf types but excludes any actual CoreML dependencies
# by using stub implementations on non-Apple platforms.
file(GLOB
onnxruntime_providers_coreml_objcc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/host_utils.h"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/host_utils_stub.cc"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/model.h"
"${ONNXRUNTIME_ROOT}/core/providers/coreml/model/model_stub.cc"
)
endif()

set(onnxruntime_providers_coreml_cc_srcs
${onnxruntime_providers_coreml_cc_srcs_top}
${onnxruntime_providers_coreml_cc_srcs_nested}
${onnxruntime_providers_shared_utils_cc_srcs}
${onnxruntime_providers_coreml_objcc_srcs}
)

source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_coreml_cc_srcs})
source_group(TREE ${ONNXRUNTIME_ROOT} FILES ${onnxruntime_providers_coreml_cc_srcs})
source_group(TREE ${ONNXRUNTIME_INCLUDE_DIR} FILES ${onnxruntime_providers_coreml_public_headers})

onnxruntime_add_static_library(onnxruntime_providers_coreml
${onnxruntime_providers_coreml_cc_srcs} ${onnxruntime_providers_coreml_objcc_srcs}
${onnxruntime_providers_coreml_public_headers}
${onnxruntime_providers_coreml_cc_srcs}
${coremltools_srcs}
)

onnxruntime_add_include_to_target(onnxruntime_providers_coreml
onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface
onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11
safeint_interface
)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
onnxruntime_add_include_to_target(onnxruntime_providers_coreml coreml_proto)
target_link_libraries(onnxruntime_providers_coreml PRIVATE coreml_proto "-framework Foundation" "-framework CoreML")
add_dependencies(onnxruntime_providers_coreml coreml_proto)

onnxruntime_add_include_to_target(onnxruntime_providers_coreml coreml_proto)
target_link_libraries(onnxruntime_providers_coreml PRIVATE coreml_proto)
add_dependencies(onnxruntime_providers_coreml coreml_proto)

if (APPLE)
target_compile_definitions(onnxruntime_providers_coreml PRIVATE __APPLE__)
endif()

if (_enable_ML_PROGRAM)
# Setup coremltools fp16 and json dependencies for creating an mlpackage.
#
# These are also used by external/xnnpack.cmake. fp16 depends on psimd
FetchContent_Declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd})
onnxruntime_fetchcontent_makeavailable(psimd)
set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR})
FetchContent_Declare(fp16 URL ${DEP_URL_fp16} URL_HASH SHA1=${DEP_SHA1_fp16})
set(FP16_BUILD_TESTS OFF CACHE INTERNAL "")
set(FP16_BUILD_BENCHMARKS OFF CACHE INTERNAL "")
onnxruntime_fetchcontent_makeavailable(fp16)

# need to tweak the include paths to match what the coreml source code expects
target_include_directories(onnxruntime_providers_coreml PRIVATE
${fp16_SOURCE_DIR}/include
${nlohmann_json_SOURCE_DIR}/single_include/nlohmann
${coremltools_SOURCE_DIR}
${coremltools_SOURCE_DIR}/mlmodel/src/
${coremltools_SOURCE_DIR}/modelpackage/src/
)

add_dependencies(onnxruntime_providers_coreml nlohmann_json::nlohmann_json fp16)

if (LINUX)
target_link_libraries(onnxruntime_providers_coreml PRIVATE uuid)
endif()
endif()

if (APPLE)
target_link_libraries(onnxruntime_providers_coreml PRIVATE "-framework Foundation" "-framework CoreML")
endif()

add_dependencies(onnxruntime_providers_coreml ${onnxruntime_EXTERNAL_DEPENDENCIES})

set_target_properties(onnxruntime_providers_coreml PROPERTIES CXX_STANDARD_REQUIRED ON)
Expand Down
18 changes: 4 additions & 14 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,7 @@ if(onnxruntime_USE_ROCM)
endif()

if(onnxruntime_USE_COREML)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_coreml coreml_proto)
else()
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_coreml)
endif()
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_coreml coreml_proto)
endif()

if(onnxruntime_USE_ACL)
Expand Down Expand Up @@ -676,15 +672,9 @@ endif()

if(onnxruntime_USE_COREML)
list(APPEND onnxruntime_test_framework_src_patterns ${TEST_SRC_DIR}/providers/coreml/*)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_coreml coreml_proto)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_coreml coreml_proto)
list(APPEND onnxruntime_test_providers_libs onnxruntime_providers_coreml coreml_proto)
else()
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_coreml)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_coreml)
list(APPEND onnxruntime_test_providers_libs onnxruntime_providers_coreml)
endif()
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_coreml coreml_proto)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_coreml coreml_proto)
list(APPEND onnxruntime_test_providers_libs onnxruntime_providers_coreml coreml_proto)
endif()

if(onnxruntime_USE_XNNPACK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ enum COREMLFlags {
// dynamic shapes. However, the performance may be negatively impacted if inputs have dynamic shapes.
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES = 0x008,

// Create an MLProgram. By default it will create a NeuralNetwork model. Requires Core ML 5 or later.
COREML_FLAG_CREATE_MLPROGRAM = 0x010,

// Keep COREML_FLAG_LAST at the end of the enum definition
// And assign the last COREMLFlag to it
COREML_FLAG_LAST = COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES,
COREML_FLAG_LAST = COREML_FLAG_CREATE_MLPROGRAM,
};

#ifdef __cplusplus
Expand Down
11 changes: 11 additions & 0 deletions objectivec/include/ort_coreml_execution_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property BOOL onlyEnableForDevicesWithANE;

/**
* Only allow CoreML EP to take nodes with inputs with static shapes. By default it will also allow inputs with
* dynamic shapes. However, the performance may be negatively impacted if inputs have dynamic shapes.
*/
@property BOOL onlyAllowStaticInputShapes;

/**
* Create an MLProgram. By default it will create a NeuralNetwork model. Requires Core ML 5 or later.
*/
@property BOOL createMLProgram;

@end

@interface ORTSessionOptions (ORTSessionOptionsCoreMLEP)
Expand Down
5 changes: 4 additions & 1 deletion objectivec/ort_coreml_execution_provider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ - (BOOL)appendCoreMLExecutionProviderWithOptions:(ORTCoreMLExecutionProviderOpti
const uint32_t flags =
(options.useCPUOnly ? COREML_FLAG_USE_CPU_ONLY : 0) |
(options.enableOnSubgraphs ? COREML_FLAG_ENABLE_ON_SUBGRAPH : 0) |
(options.onlyEnableForDevicesWithANE ? COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE : 0);
(options.onlyEnableForDevicesWithANE ? COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE : 0) |
(options.onlyAllowStaticInputShapes ? COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES : 0) |
(options.createMLProgram ? COREML_FLAG_CREATE_MLPROGRAM : 0);

Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CoreML(
[self CXXAPIOrtSessionOptions], flags));
return YES;
Expand Down
24 changes: 20 additions & 4 deletions onnxruntime/core/providers/coreml/builders/coreml_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@

#pragma once

// TODO come up with a more intuitive way of limiting this to Apple platform builds
// E.g., putting CoreML EP files that should be enabled iff `defined(__APPLE__)` in a separate directory.
#if !defined(__APPLE__)
#error "This file should only be included when building on Apple platforms."
#include "onnxruntime_config.h"

#if defined(__GNUC__)
#pragma GCC diagnostic push

// Disable warning from protobuf code.
//
// In file included from coreml_proto/Model.pb.h:30:
// In file included from _deps/protobuf-src/src/google/protobuf/extension_set.h:53:
// _deps/protobuf-src/src/google/protobuf/parse_context.h:328:47:
// error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
#ifdef HAS_SHORTEN_64_TO_32
#pragma GCC diagnostic ignored "-Wshorten-64-to-32"
#endif
#endif

// Model.pb.h is generated in the build output directory from the CoreML protobuf files in
// onnxruntime/core/providers/coreml/coremltools/mlmodel/format
#include "coreml_proto/Model.pb.h"

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

namespace COREML_SPEC = CoreML::Specification;
48 changes: 32 additions & 16 deletions onnxruntime/core/providers/coreml/builders/helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,35 @@
namespace onnxruntime {
namespace coreml {

OpBuilderInputParams MakeOpBuilderParams(const GraphViewer& graph_viewer, uint32_t coreml_flags) {
OpBuilderInputParams MakeOpBuilderParams(const GraphViewer& graph_viewer,
int32_t coreml_version,
uint32_t coreml_flags) {
return OpBuilderInputParams{graph_viewer,
(coreml_flags & COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES) != 0};
coreml_version,
(coreml_flags & COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES) != 0,
(coreml_flags & COREML_FLAG_CREATE_MLPROGRAM) != 0};
}

bool IsNodeSupported(const Node& node, const OpBuilderInputParams& input_params, const logging::Logger& logger) {
const IOpBuilder* GetOpBuilder(const Node& node) {
const auto& op_builders = GetOpBuilders();
if (Contains(op_builders, node.OpType())) {
const auto* op_builder = op_builders.at(node.OpType());
const auto it = op_builders.find(node.OpType());
if (it != op_builders.cend()) {
return it->second;
}

return nullptr;
}

bool IsNodeSupported(const Node& node, const OpBuilderInputParams& input_params, const logging::Logger& logger) {
const auto* op_builder = GetOpBuilder(node);
if (op_builder) {
return op_builder->IsOpSupported(node, input_params, logger);
} else {
return false;
}
}

bool IsInputSupported(const NodeArg& input, const std::string& parent_name,
bool IsInputSupported(const Node& node, const NodeArg& input,
const OpBuilderInputParams& input_params, const logging::Logger& logger) {
if (!input.Exists()) {
// optional input that is not provided
Expand All @@ -48,8 +61,8 @@ bool IsInputSupported(const NodeArg& input, const std::string& parent_name,
std::vector<int64_t> shape;
// We do not support input with no shape
if (!GetShape(input, shape, logger)) {
LOGS(logger, VERBOSE) << "Input [" << input_name << "] of [" << parent_name
<< "] has no shape";
LOGS(logger, VERBOSE) << MakeString("Input [", input_name, "] of Node [", node.Name(), "] type [", node.OpType(),
"] has no shape");
return false;
}

Expand All @@ -63,11 +76,19 @@ bool IsInputSupported(const NodeArg& input, const std::string& parent_name,
// For some undocumented reason, Apple CoreML framework will fail loading the model if the model
// input has dimension > 16384
// See this issue, https://github.com/apple/coremltools/issues/1003
// https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf has maximum texture widths which may be the
// root cause.
if (dim > 16384) {
LOGS(logger, WARNING) << "CoreML does not support input dim > 16384. Input:" << input_name
<< ", shape: " << Shape2String(shape);
return false;
}

if (dim == 0) {
LOGS(logger, WARNING) << "CoreML does not support shapes with dimension values of 0. Input:" << input_name
<< ", shape: " << Shape2String(shape);
return false;
}
}

// Limit input shape rank to 5.
Expand All @@ -87,13 +108,6 @@ std::unordered_set<const Node*> GetSupportedNodes(const GraphViewer& graph_viewe
const logging::Logger& logger) {
std::unordered_set<const Node*> supported_nodes{};

#ifdef __APPLE__
if (!util::HasRequiredBaseOS()) {
LOGS(logger, WARNING) << "All ops will fallback to CPU EP, because we do not have supported OS";
return supported_nodes;
}
#endif

for (const auto& node : graph_viewer.Nodes()) {
const bool supported = IsNodeSupported(node, input_params, logger);
LOGS(logger, VERBOSE) << "Operator type: [" << node.OpType()
Expand Down Expand Up @@ -149,7 +163,9 @@ bool HasNeuralEngine(const logging::Logger& logger) {
#else
// In this case, we are running the EP on non-apple platform, which means we are running the model
// conversion with CoreML EP enabled, for this we always assume the target system has Neural Engine
LOGS(logger, VERBOSE) << "HasNeuralEngine running on non-Apple hardware for model conversion only";
LOGS(logger, INFO) << "HasNeuralEngine running on non-Apple hardware. "
"Returning true to enable model conversion and local testing of CoreML EP implementation. "
"No CoreML model will be compiled or run.";
has_neural_engine = true;
#endif // #ifdef __APPLE__

Expand Down
Loading

1 comment on commit 4e51197

@Oil3
Copy link

@Oil3 Oil3 commented on 4e51197 Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your efforts @skottmckay !
once again I was about to "give up" but I thought let's make another build, and I had messed up one of the files you very recently updated.
Amazing.

It is worth mentioning that onnxruntime is one of the very few, that build on first attempt -when following documentation.
And for this main reason, I kept coming back, it is a very well engineered assembly, and, diplomaticly saying, it was quite surprising to see it was using an old coreml version.

But technically, it is positive: it's been nearly 6 years that the onnx and coreml adventures started, but we are still at the infancy/rise of it all!
OpenAI h helped propel Machine Learning in the spotlight, making it known, bringing more and more men and women with all kinds of backgrounds, into the sector.
I waited end of 2023 - I thought ChatGPT was just a chatbot like those fake hotties of tinder, or those annoying popups from a random website, so very wrong.

Machine Learning, much more than a chatbot, and much more than ChatGPT, it is an extraordinary technology.
A life-changing, groundbreaking, one-in-a-century, kind of invention.
For so many sectors it brings new, powerful tools.
But for research and education, it is a revolution, like the inventions of printing press for information, telegraph for communication, railways for transportation, internet for communication, etc. (and for the lolz, uber for transportation, ).

Onnx is on, I believe, the right path, the path of interoperability.
There can't be a "one global winner" imposing his format: we so much need performance, efficiency and reliability that they all converge in the same direction

I am glad that as soon as you were made aware, you dedicated some time for this.
Apple's MPS documentation is so massive, it's a blessing CoreML natively taps into it. And Apple provides a converter for DirectX shaders.

As sidenotes, with updating CoreML, the roadmap can be updated to support fp16!

Also: mimalloc ram allocator brings massive stability in MacOS while inferring. Seems it betters MacO's particular management of swapL
It runs very well, once again a straightforward build (!!!) and only involves an environment variable before running python, and results are visible immediately.

I'll keep an eye on that roadmap, it'd be a pleasure to contribute in the same direction!
Again, thank you.

Please sign in to comment.