Skip to main content

Module epcontext

Module epcontext 

Source
Expand description

com.microsoft::EPContext node support — the load path (§55.3).

An EPContext node is the on-disk / interchange form of a compiled-EP context (§55.1): an ordinary ONNX contrib node (op_type = "EPContext", domain = "com.microsoft") that either embeds a pre-compiled vendor blob inline or references it in an external file. This module provides:

  • EpContextNode — a typed view over an ordinary IR Node, parsing the §55.2 attributes. No new IR node kind is introduced.
  • ep_context_nodes — enumerate the EPContext nodes in a Graph.
  • resolve_ep_context — turn the ep_cache_context attribute into an EpContextBlob (inline bytes, or a read-only mmap of an external file resolved relative to the model directory, §55.3).

The loader never interprets the blob bytes — they are opaque vendor payload handed to whichever EP claims the node’s source key (§55.6), which is out of scope here (owned by the session + ep-api).

Structs§

EpContextNode
A typed view over a com.microsoft::EPContext node in the Graph IR (§55.3). Backed by an ordinary Node plus its attributes — no separate IR node kind. Constructed via EpContextNode::from_node or enumerated with ep_context_nodes.

Enums§

EmbedMode
Whether the payload lives inline in the node or in an external file (§55.2).
EpContextBlob
Where the compiled blob physically lives after load-time resolution (§55.3).

Functions§

ep_context_node_ids
The NodeIds of the EPContext nodes in graph, in node-arena order.
ep_context_nodes
Enumerate the com.microsoft::EPContext nodes in graph as typed views (§55.3, recognition helper). The session dispatches each one on its source key via the EpContextRegistry (§55.6, owned by ep-api/session).
is_ep_context_op
Whether (op_type, domain) identifies a com.microsoft::EPContext node.
resolve_ep_context
Resolve the payload for one EPContext node (§55.3).