onnxruntime
856c546c - Fix EpGraphAssignmentInfo missing issue on nodes assigned to CPU-EP by InsertCastTransformer (#28268)

Commit
46 days ago
Fix EpGraphAssignmentInfo missing issue on nodes assigned to CPU-EP by InsertCastTransformer (#28268) ### Description <!-- Describe your changes. --> - Pass `on_partition_assignment_fn` into `InsertCastTransformer` so that CPU assignments made during cast insertion are recorded with the same callback used by `GraphPartitioner`. - Avoid duplicated records in `ForceSingleNodeCPUFloat16ToFloat32` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> - `InferenceSession::TransformGraph()` records EP-to-node assignments via `on_partition_assignment_fn`, which is invoked by `GraphPartitioner` during **step 4** (graph partitioning). However, **step 6** (`InsertCastTransformer`) can silently assign nodes to the CPU EP after this recording window has closed. - Specifically, `InsertCastTransformer::ApplyImpl()` assigns them to CPU EP via `node->SetExecutionProviderType(kCpuExecutionProvider)`. Because this happens after `GraphPartitioner` has already run, `on_partition_assignment_fn` is never invoked for these nodes, resulting in an empty or incomplete `GetEpGraphAssignmentInfo()` for models that contain FP16 ops not supported by any registered EP (e.g. a FP16 Relu model with no FP16-capable EP).
Author
Parents
Loading