Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GatherElements] Clamp the indices to prevent out-of-bound reading #149

Open
shiyi9801 opened this issue Feb 19, 2025 · 2 comments
Open
Labels

Comments

@shiyi9801
Copy link
Owner

If the index is out-of-bound, both OV CPU and GPU EP will throw runtime error: promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to execute 'readTensor' on 'MLContext': Tensor has been destroyed or context is lost."

Error log

[7060:18672:0219/131050.003:FATAL:graph_impl_ort.cc(121)] : NOTREACHED hit. [WebNN] Ort Status: Non-zero status code returned while running GatherElements node. Name:'_0' Status Message: D:\onnxruntime\onnxruntime\core\providers\cpu\tensor\gather_elements.cc:150 onnxruntime::core_impl GatherElements op: Out of range value in index tensor
Stacktrace:
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x104DEC7
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x18F4AD2
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x19DD8F6
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x19D8930
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x18F656F
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x18F80A8
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x18F66AF
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x35E444
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x368971
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x18F567C
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x17BFF71
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x17BBCC4
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x17BBDFE
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x2D993B
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x2DAA56
(0): onnxruntime!OrtSessionOptionsAppendExecutionProvider_CPU+0x161FBE
(0): chrome!webnn::ort::GraphImplOrt::ComputeResources::OrtRunSync+0x536
(0): chrome!base::internal::Invoker<base::internal::FunctorTraits<void (__cdecl webnn::ort::GraphImplOrt::ComputeResources::*&& __ptr64)

@huningxin
Copy link
Collaborator

Does OV default EP have the same behavior?

@shiyi9801
Copy link
Owner Author

Does OV default EP have the same behavior?

Yes it has the same error

@huningxin huningxin added ort and removed ov-ep labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants