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
GraphandNodedescribe the computation structure.TensorandTensorValuehold data with explicit shapes and dtypes.SimulatorandExecutormanage validation and execution.ModelLoaderprovides 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§
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
Graphfrom 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).
- Cache
Access - 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.
- Graph
Deserialize - Deserialize graphs from JSON representations.
- Graph
Serialize - Serialize graphs into JSON representations.
- I1
- 1-bit signed integer storage.
- I2
- 2-bit signed integer storage.
- I4
- 4-bit signed integer storage.
- Model
Loader - Loads
.oinfmodel 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.
- Tensor
Options - Tensor construction options (shape/stride overrides).
- Timer
- Simple per-thread timing utility for runtime instrumentation.
- Trace
Event - 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§
- Attr
Value - Attribute value used by ops in the graph.
- Cache
Index Expr - Cache index expression (single or slice).
- Cache
Index Value - Index literal or identifier for cache addressing.
- DType
- Supported element dtypes.
- Device
- Execution device selection for a simulation run.
- Memory
Kind - Variable storage classification.
- Node
Kind - Node variants that make up a graph.
- OpKind
- Operation kind supported by the runtime.
- Scalar
Value - Scalar value that can be expanded into tensors.
- Tensor
Value - Runtime tensor value with an enum over concrete dtypes.
- Trace
Event Kind - Kind of trace event emitted during execution.
- Type
Rule - Type inference rule for op outputs.
Traits§
- Fetchable
- Adapter for fetching runtime values by name.
- Format
Value - Format a value for compact human-readable output.
- Tensor
Element - 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.