portable_parallel_tuning.h#
Defines
-
ONNX_LIGHT_REGISTER_PARALLEL_TUNING_SCHEMA(ClassName)#
Defines
ClassName::RegisterTuningSchemas()for oneParallelTunableKernelsubclass.Expects
kSupportedElementTypes,kPortableParallelMinimum, andkTuningAbito be in scope at the point of invocation (typically declared in the kernel’s anonymous namespace, right above the macro invocation), and registersClassName(stringified) as the schema name so it always matches the kernel’s class name.
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Maps the upstream compatibility macro to onnx-light’s explicit proto ABI annotation. This keeps declarations from vendored ONNX headers visible when
lib_onnx_protouses hidden visibility by default.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.-
namespace onnx_kernels
-
namespace tuning
Functions
-
core::runtime::KernelTuningKey MakePortableTuningKey(std::string_view kernel, int32_t element_type, uint32_t tuning_abi = 1)#
Returns the tuning key for one portable onnx-light kernel implementation.
Returns: The exact key for
kernelandelement_type.
-
bool IsSupportedElementType(int32_t element_type, std::span<const int32_t> supported_element_types)#
Returns whether an element type is supported by a kernel.
Returns:
truewhenelement_typeappears insupported_element_types.
-
void RegisterParallelTuningSchemas(std::string_view kernel, std::span<const int32_t> supported_element_types, int64_t portable_minimum_elements, uint32_t tuning_abi = 1)#
Registers one parallel tuning schema for every supported element type.
-
void ConfigureParallelTuning(std::string_view kernel, const core::runtime::KernelTuningParameters ¶meters, ParallelTuning &tuning, uint32_t tuning_abi = 1)#
Validates and copies resolved parallel parameters into a typed configuration.
-
class ParallelTunableKernel : public onnx_light::core::runtime::KernelBase#
- #include <portable_parallel_tuning.h>
Implements the shared runtime contract for one parallel-tunable kernel.
Subclassed by onnx_light::onnx_kernels::kernel::Acos, onnx_light::onnx_kernels::kernel::Acosh, onnx_light::onnx_kernels::kernel::AffineGrid, onnx_light::onnx_kernels::kernel::Asin, onnx_light::onnx_kernels::kernel::Asinh, onnx_light::onnx_kernels::kernel::Atan, onnx_light::onnx_kernels::kernel::Atanh, onnx_light::onnx_kernels::kernel::Attention, onnx_light::onnx_kernels::kernel::BatchNormalization, onnx_light::onnx_kernels::kernel::BitShift, onnx_light::onnx_kernels::kernel::BitwiseAnd, onnx_light::onnx_kernels::kernel::BitwiseOr, onnx_light::onnx_kernels::kernel::BitwiseXor, onnx_light::onnx_kernels::kernel::Cast, onnx_light::onnx_kernels::kernel::Ceil, onnx_light::onnx_kernels::kernel::Conv, onnx_light::onnx_kernels::kernel::ConvInteger, onnx_light::onnx_kernels::kernel::ConvTranspose, onnx_light::onnx_kernels::kernel::Cos, onnx_light::onnx_kernels::kernel::Cosh, onnx_light::onnx_kernels::kernel::DFT, onnx_light::onnx_kernels::kernel::Div, onnx_light::onnx_kernels::kernel::Equal, onnx_light::onnx_kernels::kernel::Erf, onnx_light::onnx_kernels::kernel::FlexAttention, onnx_light::onnx_kernels::kernel::Floor, onnx_light::onnx_kernels::kernel::GlobalAveragePool, onnx_light::onnx_kernels::kernel::GlobalLpPool, onnx_light::onnx_kernels::kernel::GlobalMaxPool, onnx_light::onnx_kernels::kernel::Greater, onnx_light::onnx_kernels::kernel::GreaterOrEqual, onnx_light::onnx_kernels::kernel::GroupNormalization, onnx_light::onnx_kernels::kernel::HardSwish, onnx_light::onnx_kernels::kernel::InstanceNormalization, onnx_light::onnx_kernels::kernel::LayerNormalization, onnx_light::onnx_kernels::kernel::Less, onnx_light::onnx_kernels::kernel::LessOrEqual, onnx_light::onnx_kernels::kernel::LinearAttention, onnx_light::onnx_kernels::kernel::Log, onnx_light::onnx_kernels::kernel::LogSoftmax, onnx_light::onnx_kernels::kernel::LpNormalization, onnx_light::onnx_kernels::kernel::MatMul, onnx_light::onnx_kernels::kernel::MeanVarianceNormalization, onnx_light::onnx_kernels::kernel::Mish, onnx_light::onnx_kernels::kernel::Mod, onnx_light::onnx_kernels::kernel::Neg, onnx_light::onnx_kernels::kernel::Or, onnx_light::onnx_kernels::kernel::PRelu, onnx_light::onnx_kernels::kernel::Pow, onnx_light::onnx_kernels::kernel::QLinearConv, onnx_light::onnx_kernels::kernel::RMSNormalization, onnx_light::onnx_kernels::kernel::Reciprocal, onnx_light::onnx_kernels::kernel::ReduceMean, onnx_light::onnx_kernels::kernel::ReduceSum, onnx_light::onnx_kernels::kernel::Relu, onnx_light::onnx_kernels::kernel::Round, onnx_light::onnx_kernels::kernel::STFT, onnx_light::onnx_kernels::kernel::Sigmoid, onnx_light::onnx_kernels::kernel::Sign, onnx_light::onnx_kernels::kernel::Sin, onnx_light::onnx_kernels::kernel::Sinh, onnx_light::onnx_kernels::kernel::Softmax, onnx_light::onnx_kernels::kernel::Softplus, onnx_light::onnx_kernels::kernel::Softsign, onnx_light::onnx_kernels::kernel::Sqrt, onnx_light::onnx_kernels::kernel::StringConcat, onnx_light::onnx_kernels::kernel::Sub, onnx_light::onnx_kernels::kernel::SwiGLU, onnx_light::onnx_kernels::kernel::Tan, onnx_light::onnx_kernels::kernel::Tanh, onnx_light::onnx_kernels::kernel::Transpose, onnx_light::onnx_kernels::kernel::Where, onnx_light::onnx_kernels::kernel::Xor
Public Functions
-
ParallelTunableKernel(const core::runtime::KernelContext &ctx, std::string_view kernel, std::span<const int32_t> supported_element_types, int64_t portable_minimum_elements, uint32_t tuning_abi = 1)#
-
virtual core::runtime::KernelTuningKey TuningKey(int32_t element_type) const override#
Returns the tuning key for this implementation and
element_type.The default returns an undefined key, indicating that the kernel has no tuning schema. Tunable kernels override this together with :cpp:func:
Configure.
-
virtual void Configure(const core::runtime::KernelTuningParameters ¶meters) override#
Validates and copies resolved parameters into this kernel’s typed, immutable configuration.
Called at most once, while a :cpp:class:
RuntimeSessioninitializes the kernel and before its first :cpp:func:Run.
-
inline const ParallelTuning &tuning() const noexcept#
Returns the immutable configuration used by the execution path.
-
ParallelTunableKernel(const core::runtime::KernelContext &ctx, std::string_view kernel, std::span<const int32_t> supported_element_types, int64_t portable_minimum_elements, uint32_t tuning_abi = 1)#
-
core::runtime::KernelTuningKey MakePortableTuningKey(std::string_view kernel, int32_t element_type, uint32_t tuning_abi = 1)#
-
namespace tuning
-
namespace onnx_kernels