Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,13 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
calibrate_and_quantize(prog, t_, quant_params, fp16_enable_, bf16_enable_, int8_enable_,
fp8_enable_, int8_calibration_cache_available_, dynamic_range_map_);
compile_program(prog, t_, exhaustive_tune_);
save_compiled_model(prog, model_cache_file);
try {
save_compiled_model(prog, model_cache_file);
} catch (const std::exception& e) {
LOGS_DEFAULT(WARNING) << ">>>>>> exception caught at Compile::save_compiled_model: " << e.what();
} catch (...) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do a catch all here as we want to be explicit in what exceptions we're expecting and those that we aren't. If there's an MIGraphX API fail we're hitting since that's what save_compiled_model uses, I don't think we should catch and mask that but instead report it.

LOGS_DEFAULT(WARNING) << ">>>>>> unknown exception caught at Compile::save_compiled_model";
}
}

auto prog_output_shapes = prog.get_output_shapes();
Expand Down Expand Up @@ -1548,7 +1554,13 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
calibrate_and_quantize(prog, t, quant_params, fp16_enable, bf16_enable, int8_enable,
fp8_enable, int8_calibration_cache_available, map_dynamic_range);
compile_program(prog, t, exhaustive_tune_);
save_compiled_model(prog, model_cache_file);
try {
save_compiled_model(prog, model_cache_file);
} catch (const std::exception& e) {
LOGS_DEFAULT(WARNING) << ">>>>>> exception caught at recompile::save_compiled_model: " << e.what();
} catch (...) {
LOGS_DEFAULT(WARNING) << ">>>>>> unknown exception caught at recompile::save_compiled_model";
}
}

mgx_state->prog = prog;
Expand Down