Skip to content

Commit 283f1d3

Browse files
Write parameters based on output shapes not the amount of names (#26092)
Running into a case where the amount of names being larger than inputs from the MIGraphX program causes us to go out of bounds and try to index outputs that don't exist. This leads to undefined/broken behavior (faults) ### Description <!-- Describe your changes. --> This fixes an out of bounds condition that occurs when output_names() errornoursly is used to bind size of the amount of inputs used for setting parameters in MIGraphX EP ### 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. --> Seeing this in some cases for user data
1 parent 8b81d9b commit 283f1d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
13731373
}
13741374

13751375
auto prog_output_shapes = prog.get_output_shapes();
1376-
for (std::size_t i = 0; i < output_names.size(); ++i) {
1376+
for (std::size_t i = 0; i < prog_output_shapes.size(); ++i) {
13771377
auto out_len = prog_output_shapes[i].lengths();
13781378
options.set_input_parameter_shape(output_names[i], out_len);
13791379
}

0 commit comments

Comments
 (0)