onnxruntime/onnxruntime/core/common
Edward Chen 454f77cd94
Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791)
# Motivation
Currently, ORT minimal builds use kernel def hashes to map from nodes to
kernels to execute when loading the model. As the kernel def hashes must
be known ahead of time, this works for statically registered kernels.
This works well for the CPU EP.
For this approach to work, the kernel def hashes must also be known at
ORT format model conversion time, which means the EP with statically
registered kernels must also be enabled then. This is not an issue for
the always-available CPU EP. However, we do not want to require that any
EP which statically registers kernels is always available too.
Consequently, we explore another approach to match nodes to kernels that
does not rely on kernel def hashes. An added benefit of this is the
possibility of moving away from kernel def hashes completely, which
would eliminate the maintenance burden of keeping the hashes stable.

# Approach
In a full build, ORT uses some information from the ONNX op schema to
match a node to a kernel. We want to avoid including the ONNX op schema
in a minimal build to reduce binary size. Essentially, we take the
necessary information from the ONNX op schema and make it available in a
minimal build.
We decouple the ONNX op schema from the kernel matching logic. The
kernel matching logic instead relies on per-op information which can
either be obtained from the ONNX op schema or another source.
This per-op information must be available in a minimal build when there
are no ONNX op schemas. We put it in the ORT format model.
Existing uses of kernel def hashes to look up kernels are replaced
with the updated kernel matching logic. We no longer store
kernel def hashes in the ORT format model’s session state and runtime
optimization representations. We no longer keep the logic to
generate and ensure stability of kernel def hashes.
2022-09-20 14:24:59 -07:00
..
logging Fix log timestamps being off by one hour when DST is in effect. (#11385) 2022-09-20 11:45:35 -07:00
cpuid_arch_definition.h Fix unused function warning for decodeMIDR(). (#12069) 2022-07-06 09:18:01 -07:00
cpuid_info.cc Fixed compilation error for ARM architecture (#11223) 2022-04-15 09:24:21 -07:00
cpuid_info.h Fix unused function warning for decodeMIDR(). (#12069) 2022-07-06 09:18:01 -07:00
cpuid_uarch.cc Fix unused function warning for decodeMIDR(). (#12069) 2022-07-06 09:18:01 -07:00
cpuid_uarch.h Fix unused function warning for decodeMIDR(). (#12069) 2022-07-06 09:18:01 -07:00
denormal.cc Remove OpenMP code (#10032) 2021-12-15 00:58:42 -08:00
helper.cc Enable more static analysis warnings and enable the analyzer for training cpu (#10176) 2022-01-27 11:17:20 -08:00
path.cc [TVM EP] support build on Windows (#11851) 2022-07-13 10:48:42 +02:00
path.h [TVM EP] support build on Windows (#11851) 2022-07-13 10:48:42 +02:00
path_string.h Refactor InferenceSession Load member functions. (#12430) 2022-08-03 16:28:26 -07:00
path_utils.h adding concat logic when initial path is empty (#4525) 2020-07-16 23:46:12 -07:00
profiler.cc Add type and shape information to profiled numbers (#10773) 2022-03-07 10:17:58 -08:00
profiler.h Execution Provider Profiler (#8406) 2021-09-28 13:59:52 -07:00
profiler_common.cc Add first pass of rocm kernel profiler (#10911) 2022-08-26 19:38:03 -07:00
safeint.h [js/web] update emsdk to v2.0.26 (#8653) 2021-08-26 15:31:34 -07:00
status.cc Change onnxruntime::make_unique to std::make_unique (#7502) 2021-04-29 17:04:53 -07:00
string_utils.h Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791) 2022-09-20 14:24:59 -07:00
threadpool.cc Changes for AIX compilation to get CPU of running thread. hz is inter… (#12744) 2022-09-13 11:06:35 +10:00
type_list.h Enable type reduction for ConstantOfShape CPU kernel. (#6594) 2021-02-12 18:27:25 +10:00
type_set_utils.h Add support for op kernel type control required types, require int64 for some ops (#6832) 2021-03-01 19:04:29 -08:00
type_utils.h QDQ implementation (#7033) 2021-03-25 09:17:23 -07:00
utf8_util.h