Cache key — the structural signature of a TraceGraph.
Two traces share an executable iff every field below matches. The
input values are not part of the key; only the per-op output meta
influences the compiled graph (because MPSGraph placeholders are
shape-static in Phase 1.2 and Phase 1.6 will introduce a separate
dynamic key variant).
Attributes
op_namesstd::vector<std::string>Op-name sequence in dispatch order. Compared element-wise.
output_shapesstd::vector<Shape>Per-op single-output shape. Phase 1.2 supports one output per node; Phase 1.3+ may append entries for multi-output ops.
output_dtypesstd::vector<Dtype>Per-op single-output dtype.
op_attrsstd::vector<std::vector<std::pair<std::string, AttributeValue>>>Per-op attribute map, serialised in sorted-key order so the hash is deterministic. Required for emitter-divergent attributes that don't show up in shapes (e.g.
dropout's training / p, softmax's axis). Without this two traces with identical structure but different attributes would collide on the same cache entry and one caller would silently receive the other's executable.deviceDeviceDevice on which the executable was compiled (all ops in a trace must agree on one device — Phase 1.2 builder enforces this).