-
Notifications
You must be signed in to change notification settings - Fork 57
CVS-175119-[OVEP] Fixed possibility of array index out of bounds in subgraph partitioning #838
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
base: ovep-develop
Are you sure you want to change the base?
Conversation
| omit_subgraph = false; | ||
| } else if (j < total_clusters - 1) { | ||
| bool append_node = false; | ||
| while (j < total_clusters && !append_node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add the increment part of loop so that the additional check can be removed.
something like
while (++j < total_clusters && !append_node)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Preetha, I have made that change, thanks for pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Preetha, due to this change of adding the increment part in the loop, an issue was created.
Old logic (larger loop)
In the case where j < total_clusters is true but append node is also true (the loop is not entered), j is not incremented
New logic (shorter loop)
In the case ++j is still < total_clusters but append node is true, the loop is not entered but j is aldready incremented (unlike the first logic).
so, just after the loop, in this block
if (append_node) {
connected_clusters[j].emplace_back(index);
}
incorrect value of j is used which causes some model to fail.
So we cant use "while (++j < total_clusters && !append_node)"
Is there a way to optimize the loop logic but retain the j if we exit the loop due to append_node == true
…onnxruntime into rajeev/get_capability_fix
… incremented if append_node == true
Models with nodes like QLinear, DQLinear and similar ones were crashing while running perf test, due to an issue in the sub graph partitioning logic