Skip to main content

Crate openinfer_simulator

Crate openinfer_simulator 

Source
Expand description

§OpenInfer

OpenInfer is an inference graph and execution framework for machine-learning workloads. It provides a graph model, a runtime, and tensor utilities that can execute on CPU (and optionally Vulkan) backends.

§Quick start

use openinfer::{graph, Device, ModelLoader, Simulator};
let model = ModelLoader::default();
let g = graph! {
    block main {
        // ... graph nodes ...
    }
};
let sim = Simulator::new(&model, &g, Device::Cpu)?;
let _executor = sim.with_trace().make_executor()?;

§Key concepts

  • Graph and Node describe the computation structure.
  • Tensor and TensorValue hold data with explicit shapes and dtypes.
  • Simulator and Executor manage validation and execution.
  • ModelLoader provides external state and parameters.

§Module map

  • graph: graph nodes, blocks, and serialization.
  • runtime: executor, validation, and tracing.
  • tensor: tensor containers and dtype utilities.
  • ops: op registry and kernel dispatch.

Modules§

logging

Macros§

critical
Emit a critical message via the logging subsystem.
error
Emit an error message via the logging subsystem.
fetch_executor
graph
Build an OpenInfer Graph from the DSL input.
insert_executor
log
Emit a raw log message using println!.
trace
Emit a trace message via the logging subsystem.
try_fetch_executor
try_insert_executor
vk_trace
Emit a Vulkan trace message via the logging subsystem.
warning
Emit a warning message via the logging subsystem.

Structs§

BF16
Brain-float16 (BF16) scalar storage.
Bitset
Packed bitset storage type.
Block
A named block of nodes (control-flow unit).
CacheAccess
Describes a cache access pattern in a node.
Executor
Executes a graph against a model and mutable runtime state.
F8
8-bit float storage (custom format).
F16
IEEE 754 half-precision (F16) scalar storage.
Graph
Graph structure containing blocks and variable declarations.
GraphDeserialize
Deserialize graphs from JSON representations.
GraphSerialize
Serialize graphs into JSON representations.
I1
1-bit signed integer storage.
I2
2-bit signed integer storage.
I4
4-bit signed integer storage.
ModelLoader
Loads .oinf model files and exposes tensors/metadata.
Node
A graph node with index and kind.
OpAttr
Named attribute for an op invocation.
OpAttrs
Collection of op attributes.
Random
Random tensor generator for a specific element type.
Simulator
High-level entry point for validating and executing a graph.
T1
1-bit ternary storage.
T2
2-bit ternary storage.
Tensor
Owned tensor container with shape and stride metadata.
TensorOptions
Tensor construction options (shape/stride overrides).
Timer
Simple per-thread timing utility for runtime instrumentation.
TraceEvent
Execution trace record for a single node.
U1
1-bit unsigned integer storage.
U2
2-bit unsigned integer storage.
U4
4-bit unsigned integer storage.
VarDecl
Variable declaration within a graph.
VarInfo
Metadata about a variable stored in a model file.

Enums§

AttrValue
Attribute value used by ops in the graph.
CacheIndexExpr
Cache index expression (single or slice).
CacheIndexValue
Index literal or identifier for cache addressing.
DType
Supported element dtypes.
Device
Execution device selection for a simulation run.
MemoryKind
Variable storage classification.
NodeKind
Node variants that make up a graph.
OpKind
Operation kind supported by the runtime.
ScalarValue
Scalar value that can be expanded into tensors.
TensorValue
Runtime tensor value with an enum over concrete dtypes.
TraceEventKind
Kind of trace event emitted during execution.
TypeRule
Type inference rule for op outputs.

Traits§

Fetchable
Adapter for fetching runtime values by name.
FormatValue
Format a value for compact human-readable output.
TensorElement
Element type that can be converted to/from TensorValue.

Functions§

format_truncated
Format a slice with head/tail truncation.
op_schema
Lookup the schema for a specific op kind.