Expand description
com.microsoft::EPContext dump / writer path (§55.4) — the inverse of
the load path in crate::epcontext.
After the session partitions a graph and an EP compiles a claimed subgraph,
it asks that EP for its compiled context (save_context) and hands the
result here. This module:
- builds one
com.microsoft::EPContextNodeper compiled partition, carrying the §55.2 attributes (source,ep_sdk_version,partition_name,main_context,embed_mode,ep_cache_context); - handles
embed_mode: inline the compiled blob into theep_cache_contextSTRING attribute (byte-exact, via the byte-preserving IR string attr), or write it to an external sidecar.binnext to the output model and store the relative path (mirroring the §19.2 external-data convention so the produced model round-trips through the §55.3 load path); - replaces each partition’s nodes with its single EPContext node, wiring the partition’s boundary inputs/outputs to the node’s variadic i/o; and
- serialises the resulting model to
<orig_stem>_ctx.onnx(or an explicit output path) via thecrate::encoderseam.
§Model-agnostic (§55.6 HARD RULE)
Nothing here hardcodes a vendor/op/model name. The EPContext op-type/domain
come from the shared constants in crate::epcontext; every source key,
SDK version, partition name, and blob comes from the caller (ultimately from
the EP via its trait). Adding a new compiled EP needs no change here.
Structs§
- EpContext
Dump Config - Configuration for the EPContext dump path (§55.4).
- EpContext
Partition - One EP-compiled partition to serialise into an
EPContextnode (§55.4).
Functions§
- dump_
ep_ context - Dump
modelto a*_ctx.onnxcontext-cache model, replacing each compiledpartition’s subgraph with a singlecom.microsoft::EPContextnode (§55.4).