[OpenVINO EP] Fix get/set_float_initializer_data for raw_data backed float initializers - #31138
Open
wangw-1991 wants to merge 3 commits into
Open
[OpenVINO EP] Fix get/set_float_initializer_data for raw_data backed float initializers#31138wangw-1991 wants to merge 3 commits into
wangw-1991 wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
|
@fdwr Can you help review this? Thanks. |
fdwr
reviewed
Jul 29, 2026
Contributor
Author
|
Hi @ankitm3k, could you help review this change? Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
get_float_initializer_data/set_float_initializer_dataassumed a float initializer always stores its value in the typedfloat_datafield. When the value lives inraw_datainstead,float_data(0)reads out of bounds andset_float_data(0, ...)writes out of bounds — both undefined behaviour.Both functions now select the field that actually holds the data: use
float_datawhen it is non-empty, otherwise read/writeraw_data(guarded by size checks).Testing
Adds
openvino_ov_protobuf_utils_test.cccovering get/set against bothfloat_dataandraw_databacked float scalars. Because the OpenVINO EP is built as a shared-library module with hidden symbols,ov_protobuf_utils.cppis compiled directly intoonnxruntime_provider_testso the tests can link.