LLVM 20.0.0git
|
MLModelRunner interface: abstraction of a mechanism for evaluating a ML model. More...
#include "llvm/Analysis/MLModelRunner.h"
Public Types | |
enum class | Kind : int { Unknown , Release , Development , NoOp , Interactive } |
Public Member Functions | |
MLModelRunner (const MLModelRunner &)=delete | |
MLModelRunner & | operator= (const MLModelRunner &)=delete |
virtual | ~MLModelRunner ()=default |
template<typename T > | |
T | evaluate () |
template<typename T , typename I > | |
T * | getTensor (I FeatureID) |
template<typename T , typename I > | |
const T * | getTensor (I FeatureID) const |
void * | getTensorUntyped (size_t Index) |
const void * | getTensorUntyped (size_t Index) const |
Kind | getKind () const |
virtual void | switchContext (StringRef Name) |
Protected Member Functions | |
MLModelRunner (LLVMContext &Ctx, Kind Type, size_t NumInputs) | |
virtual void * | evaluateUntyped ()=0 |
void | setUpBufferForTensor (size_t Index, const TensorSpec &Spec, void *Buffer) |
Protected Attributes | |
LLVMContext & | Ctx |
const Kind | Type |
MLModelRunner interface: abstraction of a mechanism for evaluating a ML model.
More abstractly, evaluating a function that has as tensors as arguments, described via TensorSpecs, and returns a tensor. Currently, the latter is assumed to be a scalar, in absence of more elaborate scenarios. NOTE: feature indices are expected to be consistent all accross MLModelRunners (pertaining to the same model), and also Loggers (see TFUtils.h)
Definition at line 26 of file MLModelRunner.h.
|
strong |
Enumerator | |
---|---|
Unknown | |
Release | |
Development | |
NoOp | |
Interactive |
Definition at line 52 of file MLModelRunner.h.
|
delete |
|
virtualdefault |
|
inlineprotected |
Definition at line 57 of file MLModelRunner.h.
Definition at line 33 of file MLModelRunner.h.
References evaluateUntyped().
Referenced by llvm::MLPriorityAdvisor::getPriorityImpl().
|
protectedpure virtual |
Referenced by evaluate().
|
inline |
Definition at line 53 of file MLModelRunner.h.
References Type.
Definition at line 37 of file MLModelRunner.h.
References getTensorUntyped().
Referenced by llvm::extractInstructionFeatures(), llvm::extractMBBFrequency(), and llvm::MLPriorityAdvisor::getPriorityImpl().
Definition at line 42 of file MLModelRunner.h.
References getTensorUntyped().
|
inline |
|
inline |
Definition at line 48 of file MLModelRunner.h.
References Index.
|
delete |
|
inlineprotected |
Definition at line 63 of file MLModelRunner.h.
References Index.
Referenced by llvm::InteractiveModelRunner::InteractiveModelRunner(), and llvm::NoInferenceModelRunner::NoInferenceModelRunner().
|
inlinevirtual |
Reimplemented in llvm::InteractiveModelRunner.
Definition at line 54 of file MLModelRunner.h.
Referenced by llvm::MLPriorityAdvisor::MLPriorityAdvisor().
|
protected |
Definition at line 72 of file MLModelRunner.h.
Referenced by llvm::InteractiveModelRunner::InteractiveModelRunner().
Definition at line 73 of file MLModelRunner.h.
Referenced by getKind().