pub fn load_ep_context_nodes(
graph: &Graph,
model_dir: &Path,
eps: &[(EpId, &dyn ExecutionProvider)],
) -> Result<EpContextPlacement, SessionError>Expand description
Consume every com.microsoft::EPContext node in graph (§55.3).
Builds the source-keyed [EpContextRegistry] from eps
(build_ep_context_registry — propagating
EpError::DuplicateContextSource if two EPs claim one key), then for each
EPContext node claims the owning EP by its source attribute, maps the
loader blob + node attributes into the runtime EpContext, and calls
ExecutionProvider::load_context. main_context=1 primaries load first
(deduplicating identical payloads); main_context=0 references resolve
against an already-loaded primary by (source, partition_name) with no
second blob load.
model_dir is the directory of the ONNX model file, needed to resolve
embed_mode=0 external blob paths (identical policy to external weights,
§19.2). Returns the set of handled node ids so the executor can bypass them.
§Errors
EpError::DuplicateContextSource— two EPs declare the samesourcekey.EpError::NoEpForContext— a node’ssourcematches no registered EP.SessionError::DanglingEpContext— amain_context=0reference has no matching primary.- loader errors from
resolve_ep_context(missing payload, bad external path), and any EP error fromExecutionProvider::load_context.