onnxruntime
1aae736a - Handle kernel type string resolution errors without throwing (#33828)

Commit
6 days ago
Handle kernel type string resolution errors without throwing (#33828) ### Description During kernel matching in `MatchKernelDefTypes`, type constraints are resolved against the node's arguments via `IKernelTypeStrResolver::ResolveKernelTypeStr`. Previously, resolution failures, out-of-range input argument indices, or missing `NodeArg` type protos triggered `ORT_THROW_IF_ERROR` or `ORT_ENFORCE`, which bypass normal `VerifyKernelDef` / `TryFindKernel` status reporting and abort the process when `ORT_NO_EXCEPTIONS` is enabled. This change updates `MatchKernelDefTypes` to record those failures in `mismatch_reason` and return `false` so `KernelRegistry::TryFindKernel` and `InferenceSession::Initialize` surface a descriptive failure `Status` instead. It also adds `OrtModelTest.RejectsMissingKernelTypeStrResolverEntryOnInitialize` to cover initializing an ORT format model with a missing `KernelTypeStrResolver` entry. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
Parents
Loading