runtime#
The runtime sub-namespace of onnx_core (core::runtime) hosts the
generic execution engine: the runtime value types
(Tensor, Sequence, Map),
RuntimeContext, the node/graph/function/model traversal
(RunNode(), RunNodes(), RunGraph(),
RunFunction(), RunModel()),
random-number helpers, and low-level cast/promotion helpers shared by many
kernels.
onnx_core never depends on onnx_kernels, so the kernel dispatch
table starts out empty: it is a mutable registry
(RegisterKernelFn()) that onnx_kernels populates with its
per-operator trampolines (see kernel_dispatch_table.h)
via onnx_light::onnx_kernels::RegisterKernelFunctions(). Any
consumer of the runtime (Python bindings, tests, examples, …) must call
that function once before using RunNode() / RunModel()
or any other entry point that dispatches to a registered kernel.
Control-flow operators (If, Loop, Scan) are the one exception
to “all kernels live in onnx_kernels”: since running their subgraphs
recursively calls RunGraph(), which must live in onnx_core,
their kernel classes live here too, under runtime/controlflow, to avoid
a dependency from onnx_core back onto onnx_kernels.
- simple_tensor.h
- simple_sequence.h
- simple_map.h
- runtime_context.h
- kernel_context.h
- runtime_parameters.h
- run_nodes.h
- runtime_session.h
- kernel_dispatch_table.h
- cpu_executor.h
- cpu_execution_policy.h
- parallel_region_collector.h
- kernel_tuning.h
- kernel_tuning_cache.h
- parallel_for.h
- tensor_compare.h
- node_helpers.h
- temporary_buffer.h
- random.h
- cast_float8.h
- cast_helper.h
- cast_sub_byte.h
- elementwise_helpers.h
- float16_promote.h
- controlflow