Skip to main content

Crate onnx_runtime_eager

Crate onnx_runtime_eager 

Source
Expand description

§onnx-runtime-eager

Eager (single-op) execution for the ORT 2.0 runtime (docs/EAGER.md). Dispatch individual ONNX ops to execution-provider kernels without building a graph — a PyTorch-style experience with ONNX op semantics.

This crate is the pure-Rust core of the design. It reuses the existing runtime abstractions rather than inventing parallel ones:

§Phase-1 scope (docs/EAGER.md)

Implemented: EagerContext, EagerContext::dispatch (single-op CPU dispatch), the DomainRegistry, opset resolution ([opset]), and the compiled-KernelCache.

DEFERRED (each is flagged at its hook point):

  • PyO3 / Python bindings (§11), including the Tensor single→tensor / multi→tuple sugar and ops.* typed wrappers (§4.1).
  • Subgraph ops If/Loop/Scan (§7).
  • The opset context-manager / nxrt.device() context (§5.3, §2.2).
  • GPU/CUDA EP dispatch and implicit cross-device transfer.
  • Kernel-provided shape-inference fallback (§9.2).
  • DLPack / numpy interop (§3).

Structs§

CacheStats
Cache instrumentation, exposed for tests and diagnostics.
DomainInfo
Metadata for one registered operator domain.
DomainRegistry
Registry of known operator domains and their default opsets (docs/EAGER.md §6.4).
EagerContext
The process-wide eager execution context (docs/EAGER.md §10.1).
KernelCache
A bounded LRU of compiled kernels (docs/EAGER.md §8.2).
KernelCacheKey
The cache key (docs/EAGER.md §8.2 KernelCacheKey).
Tensor
An owned, device-aware tensor (docs/EAGER.md §3).

Enums§

EagerError
Errors produced while dispatching a single op in eager mode.

Constants§

LATEST_ONNX_OPSET
The latest ONNX opset the runtime targets, used as the default for the standard ("") domain when a domain has no registered default.

Functions§

global_context
Get or lazily initialize the process-global eager context (docs/EAGER.md §10.2).
resolve_opset
Resolve the effective opset for a domain.

Type Aliases§

Result
A convenience Result alias for eager-dispatch operations.