calibration_profile_store.h#
-
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 core
-
namespace runtime
Typedefs
Enums
-
enum class CalibrationProfileKind#
Identifies whether a calibration profile is machine-specific or portable.
Values:
-
enumerator kExact#
-
enumerator kPortable#
-
enumerator kExact#
-
enum class CalibrationProfileStoreStatus#
Classifies profile loading and mutation results.
Values:
-
enumerator kOk#
-
enumerator kNotFound#
-
enumerator kDisabled#
-
enumerator kUnreadable#
-
enumerator kMalformed#
-
enumerator kUnsupportedVersion#
-
enumerator kPolicyRejected#
-
enumerator kWriteFailed#
-
enumerator kOk#
-
enum class CalibrationProfileRejectionReason#
Explains why a stored profile was not selected.
Values:
-
enumerator kDifferentBackend#
-
enumerator kDifferentOperator#
-
enumerator kOutdatedImplementation#
-
enumerator kDifferentModel#
-
enumerator kDifferentProcessor#
-
enumerator kDifferentThreadCount#
-
enumerator kDifferentStructure#
-
enumerator kPolicyRejected#
-
enumerator kDifferentBackend#
-
struct CalibrationMeasurement#
- #include <calibration_profile_store.h>
Stores one named calibration measurement.
Public Functions
-
bool operator==(const CalibrationMeasurement&) const = default#
-
bool operator==(const CalibrationMeasurement&) const = default#
-
struct CalibrationProfile#
- #include <calibration_profile_store.h>
Stores a serialized backend policy and the measurements used to select it.
policyis opaque to onnx-light. Backends serialize and validate it through callbacks passed to :cpp:class:CalibrationProfileStore.Public Functions
-
bool operator==(const CalibrationProfile&) const = default#
-
bool operator==(const CalibrationProfile&) const = default#
-
struct CalibrationProfileKey#
- #include <calibration_profile_store.h>
Identifies a backend calibration profile.
Exact profiles use
model_digest,processor, andthread_count. Portable profiles instead usestructural_properties.Public Functions
-
bool operator==(const CalibrationProfileKey&) const = default#
-
bool operator==(const CalibrationProfileKey&) const = default#
-
struct CalibrationProfileLookupOptions#
- #include <calibration_profile_store.h>
Controls exact/portable profile resolution.
-
struct CalibrationProfileLookupReport#
- #include <calibration_profile_store.h>
Reports profile selection and every rejected candidate.
Public Members
-
std::optional<CalibrationProfile> profile#
-
std::vector<CalibrationProfileRejection> rejections#
-
std::optional<CalibrationProfile> profile#
-
struct CalibrationProfileRejection#
- #include <calibration_profile_store.h>
Reports one rejected candidate.
Public Members
-
class CalibrationProfileStore#
- #include <calibration_profile_store.h>
Stores backend calibration profiles in memory and, optionally, on disk.
Mutations are synchronized between threads and processes. Persistent updates merge the latest disk contents and atomically replace the store file.
Public Functions
-
explicit CalibrationProfileStore(CalibrationProfileStoreOptions options = {})#
-
CalibrationProfileStoreReport Reload()#
Reloads profiles from persistent storage.
Existing in-memory profiles remain unchanged when the file is malformed, incompatible, or unreadable.
-
CalibrationProfileStoreReport Store(const CalibrationProfileKey &key, std::vector<CalibrationMeasurement> measurements, const CalibrationPolicySerializer &serialize, const CalibrationPolicyValidator &validate = {})#
Stores calibration results after backend serialization and validation.
The serializer is invoked exactly once. A rejected payload is not stored.
-
CalibrationProfileLookupReport Lookup(const CalibrationProfileLookupOptions &options, const CalibrationPolicyValidator &validate = {}) const#
Resolves an override, exact profile, or portable profile in that order.
-
CalibrationProfileStoreReport InstallOverride(const CalibrationProfileKey &key, const CalibrationPolicySerializer &serialize, const CalibrationPolicyValidator &validate = {})#
Installs and persists an explicit user override.
-
CalibrationProfileStoreReport ClearOverride(const CalibrationProfileKey &key)#
Clears matching user overrides.
-
CalibrationProfileStoreReport Invalidate(std::string_view backend, std::optional<std::string_view> implementation_version = std::nullopt)#
Invalidates profiles for a backend and, optionally, one implementation version.
An absent version invalidates every version owned by the backend.
-
std::vector<CalibrationProfile> Inspect() const#
Returns a snapshot of every in-memory profile.
-
inline bool persistence_enabled() const noexcept#
Returns whether persistent reads and writes are enabled.
Public Static Functions
Private Functions
-
CalibrationProfileStoreReport Mutate(const std::function<size_t(std::vector<CalibrationProfile>&)>&)#
-
explicit CalibrationProfileStore(CalibrationProfileStoreOptions options = {})#
-
struct CalibrationProfileStoreOptions#
- #include <calibration_profile_store.h>
Controls persistent storage.
-
enum class CalibrationProfileKind#
-
namespace runtime
-
namespace core