Skip to content

Commit a0ff994

Browse files
Write parameters based on output shapes not the amount of names
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)
1 parent 5746ba9 commit a0ff994

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
@@ -1359,7 +1359,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
13591359
}
13601360

13611361
auto prog_output_shapes = prog.get_output_shapes();
1362-
for (std::size_t i = 0; i < output_names.size(); ++i) {
1362+
for (std::size_t i = 0; i < prog_output_shapes.size(); ++i) {
13631363
auto out_len = prog_output_shapes[i].lengths();
13641364
options.set_input_parameter_shape(output_names[i], out_len);
13651365
}

0 commit comments

Comments
 (0)