MLCompilerBridge
Tools for streamlining communication with ML models for compiler optimizations.
|
Namespaces | |
namespace | MLConfig |
Classes | |
class | Agent |
Agent is a wrapper around the ONNXModel class, interfaces with the Environment class to support ML/RL model inference via ONNXModel. More... | |
class | BaseSerDes |
class | BitstreamSerDes |
BitstreamSerDes - Bitstream Serialization/Deserialization which sends header information followed by the raw data. More... | |
class | Environment |
class | gRPCModelRunner |
This class is used to create the grpc model runner object. More... | |
class | JsonSerDes |
JsonSerDes - Json Serialization/Deserialization using LLVM's json library. More... | |
class | MLModelRunner |
MLModelRunner - The main interface for interacting with the ML models. More... | |
class | NoopSavedModelImpl |
A mock class satisfying the interface expected by ReleaseModeModelRunner for its TGen parameter. More... | |
class | ONNXModelRunner |
ONNXModelRunner is the main user facing class that interfaces with the Environment and Agent classes to support ML/RL model inference via ONNXModel. More... | |
class | PipeModelRunner |
A MLModelRunner that asks for advice from an external agent, or host. More... | |
class | ProtobufSerDes |
ProtobufSerDes - Protobuf Serialization/Deserialization to support gRPC communication. More... | |
class | TensorflowSerDes |
TensorflowSerDes - Serialization/Deserialization to support TF AOT models. More... | |
class | TensorSpec |
class | TFModelRunner |
TFModelRunner - TF Compiled model implementation of the MLModelRunner. More... | |
Typedefs | |
typedef llvm::SmallVector< float, 300 > | Observation |
using | RealType = float |
using | IntegerType = int |
Enumerations | |
enum class | SerDesKind : int { Unknown , Json , Bitstream , Protobuf , Tensorflow } |
This is the base class for SerDes. More... | |
enum class | TensorType { Invalid , _TENSOR_TYPE_ENUM_MEMBERS , Total } |
Functions | |
template<class T > | |
bool | isEmbeddedModelEvaluatorValid () |
template<> | |
bool | isEmbeddedModelEvaluatorValid< NoopSavedModelImpl > () |
std::string | tensorValueToString (const char *Buffer, const TensorSpec &Spec) |
For debugging. | |
llvm::Optional< TensorSpec > | getTensorSpecFromJSON (llvm::LLVMContext &Ctx, const llvm::json::Value &Value) |
Construct a TensorSpec from a JSON dictionary of the form: { "name": <string>, "port": <int>, "type": <string. | |
StringRef | toString (TensorType TT) |
llvm::Optional< TensorSpec > | getTensorSpecFromJSON (LLVMContext &Ctx, const json::Value &Value) |
using MLBridge::IntegerType = int |
Definition at line 29 of file DataTypes.h.
typedef llvm::SmallVector<float, 300> MLBridge::Observation |
using MLBridge::RealType = float |
Definition at line 28 of file DataTypes.h.
|
strong |
This is the base class for SerDes.
It defines the interface for the serialization and deserialization of the data structures used for the communication by the MLModelRunner. Currently, (int, float) or (long, double), char and bool are supported. Vectors of these types are supported as well.
Enumerator | |
---|---|
Unknown | |
Json | |
Bitstream | |
Protobuf | |
Tensorflow |
Definition at line 46 of file baseSerDes.h.
|
strong |
Enumerator | |
---|---|
Invalid | |
_TENSOR_TYPE_ENUM_MEMBERS | |
Total |
Definition at line 45 of file TensorSpec.h.
llvm::Optional< TensorSpec > MLBridge::getTensorSpecFromJSON | ( | llvm::LLVMContext & | Ctx, |
const llvm::json::Value & | Value ) |
Construct a TensorSpec from a JSON dictionary of the form: { "name": <string>, "port": <int>, "type": <string.
Use LLVM's types, e.g. float, double, int64_t>, "shape": <array of ints> } For the "type" field, see the C++ primitive types used in TFUTILS_SUPPORTED_TYPES.
llvm::Optional< TensorSpec > MLBridge::getTensorSpecFromJSON | ( | LLVMContext & | Ctx, |
const json::Value & | Value ) |
Definition at line 68 of file TensorSpec.cpp.
bool MLBridge::isEmbeddedModelEvaluatorValid | ( | ) |
Definition at line 104 of file TFModelRunner.h.
|
inline |
Definition at line 106 of file TFModelRunner.h.
std::string MLBridge::tensorValueToString | ( | const char * | Buffer, |
const TensorSpec & | Spec ) |
For debugging.
Definition at line 110 of file TensorSpec.cpp.
StringRef MLBridge::toString | ( | TensorType | TT | ) |
Definition at line 45 of file TensorSpec.cpp.