@@ -154,23 +154,23 @@ MIGraphXExecutionProvider::MIGraphXExecutionProvider(const MIGraphXExecutionProv
154154 }
155155
156156 // Save/load migraphx compiled models
157- const std::string save_comp_model_env = onnxruntime::GetenvironmentVar (migraphx_env_vars::kSaveCompiledModel );
157+ const std::string save_comp_model_env = onnxruntime::GetEnvironmentVar (migraphx_env_vars::kSaveCompiledModel );
158158 if (!save_comp_model_env.empty ()) {
159159 save_compiled_model_ = (std::stoi (save_comp_model_env) == 0 ? false : true );
160160 }
161161
162- const std::string save_model_path_env = onnxruntime::GetenvironmentVar (migraphx_env_vars::ksaveCompiledPath );
162+ const std::string save_model_path_env = onnxruntime::GetEnvironmentVar (migraphx_env_vars::kSavedModelPath );
163163
164164 if (save_compiled_model_ && !save_model_path_env.empty ()) {
165165 save_compiled_path_ = save_model_path_env;
166166 }
167167
168- const std::string load_comp_model_env = onnxruntime::GetenvironmentVar (migraphx_env_vars::kLoadCompiledModel );
168+ const std::string load_comp_model_env = onnxruntime::GetEnvironmentVar (migraphx_env_vars::kLoadCompiledModel );
169169 if (!load_comp_model_env.empty ()) {
170170 load_compiled_model_ = (std::stoi (load_comp_model_env) == 0 ? false : true );
171171 }
172172
173- const std::string load_model_path_env = onnxruntime::GetenvironmentVar (migraphx_env_vars::kLoadCompiledPath );
173+ const std::string load_model_path_env = onnxruntime::GetEnvironmentVar (migraphx_env_vars::kLoadModelPath );
174174 if (load_compiled_model_ && !load_model_path_env.empty ()) {
175175 load_compiled_path_ = load_model_path_env;
176176 }
@@ -199,9 +199,9 @@ MIGraphXExecutionProvider::MIGraphXExecutionProvider(const MIGraphXExecutionProv
199199 << " , int8_calibration_cache_available: " << int8_calibration_cache_available_
200200 << " , use_native_migraphx_calibration_table: " << int8_use_native_migraphx_calibration_table_
201201 << " , migraphx_save_compiled_model: " << save_compiled_model_
202- << " , migraphx_save_compiled_model_path: " << save_compiled_model_path_
202+ << " , migraphx_save_compiled_model_path: " << save_compiled_path_
203203 << " , migraphx_load_compiled_model: " << load_compiled_model_
204- << " , migraphx_load_compiled_model_path: " << load_compiled_model_path_ ;
204+ << " , migraphx_load_compiled_model_path: " << load_compiled_path_ ;
205205}
206206
207207MIGraphXExecutionProvider::~MIGraphXExecutionProvider () {
@@ -1153,7 +1153,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
11531153 if (!no_input_shape) {
11541154
11551155
1156- if (!load_compiled_model )
1156+ if (!load_compiled_model_ )
11571157 {
11581158 prog = migraphx::parse_onnx_buffer (onnx_string_buffer, options);
11591159 if (fp16_enable_) {
@@ -1181,16 +1181,16 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
11811181 migraphx::compile_options co;
11821182 co.set_fast_math (false );
11831183 prog.compile (t_, co);
1184- if (save_compiled_mode )
1184+ if (save_compiled_model_ )
11851185 {
11861186 migraphx::file_options fo;
11871187 fo.set_file_format (" msgpack" );
1188- migraphx::save (prog, save_compiled_path , fo);
1188+ migraphx::save (prog, save_compiled_path_. c_str () , fo);
11891189 }
11901190 }
11911191 else
11921192 {
1193- prog = migraphx::load (load_compiled_path );
1193+ prog = migraphx::load (load_compiled_path_. c_str () );
11941194 }
11951195
11961196 auto prog_output_shapes = prog.get_output_shapes ();
@@ -1213,8 +1213,8 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
12131213 map_onnx_string_[context->node_name ], options, t_, map_input_index_[context->node_name ], &mgx_mu_,
12141214 map_no_input_shape_[context->node_name ], fp16_enable_, int8_enable_,
12151215 int8_calibration_cache_available_, dynamic_range_map,
1216- save_compiled_mode_ , save_compiled_path_,
1217- load_compiled_mode_ , load_compiled_path_, dump_model_ops_};
1216+ save_compiled_model_ , save_compiled_path_,
1217+ load_compiled_model_ , load_compiled_path_, dump_model_ops_};
12181218 *state = p.release ();
12191219 return 0 ;
12201220 };
@@ -1288,7 +1288,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
12881288 // input shapes are different, needs to re-parse onnx and
12891289 // re-compile the program
12901290 if (!input_shape_match) {
1291- if (!load_compiled_model )
1291+ if (!load_compiled_model_ )
12921292 {
12931293 prog = migraphx::parse_onnx_buffer (onnx_string, cmp_options);
12941294 if (fp16_enable) {
@@ -1317,16 +1317,16 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
13171317 migraphx::compile_options co;
13181318 co.set_fast_math (false );
13191319 prog.compile (t, co);
1320- if (save_compiled_mode )
1320+ if (save_compiled_model_ )
13211321 {
13221322 migraphx::file_options fo;
13231323 fo.set_file_format (" msgpack" );
1324- migraphx::save (prog, save_compiled_path , fo);
1324+ migraphx::save (prog, save_compiled_path_. c_str () , fo);
13251325 }
13261326 }
13271327 else
13281328 {
1329- prog = migraphx::load (load_compiled_path );
1329+ prog = migraphx::load (load_compiled_path_. c_str () );
13301330 }
13311331
13321332 mgx_state->prog = prog;
0 commit comments