Skip to content

Commit

Permalink
changing optimization level test
Browse files Browse the repository at this point in the history
  • Loading branch information
carzh committed Jul 30, 2024
1 parent 331f9aa commit 3b2ede8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void TestModuleExport(const std::vector<std::shared_ptr<IExecutionProvider>>& pr

std::vector<std::string> graph_output_names({"output-0"});
ASSERT_STATUS_OK(model->ExportModelForInferencing(ToUTF8String(inference_model_path), graph_output_names));
ASSERT_TRUE(false) << "Made it past the export for inferenc without failing";

// Load model
ONNX_NAMESPACE::ModelProto eval_model;
Expand Down
5 changes: 4 additions & 1 deletion orttraining/orttraining/training_api/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ Module::Module(const ModelIdentifiers& model_identifiers,
}

if (model_identifiers.IsEvalModelAvailable()) {
eval_sess_ = std::make_unique<onnxruntime::InferenceSession>(session_options, env);
onnxruntime::SessionOptions eval_session_options = session_options;
eval_session_options.graph_optimization_level = TransformerLevel::Default;
eval_sess_ = std::make_unique<onnxruntime::InferenceSession>(eval_session_options, env);
// eval_sess_ = std::make_unique<onnxruntime::InferenceSession>(session_options, env);
#if !defined(ORT_MINIMAL_BUILD) || defined(ORT_MINIMAL_BUILD_CUSTOM_OPS)
if (!op_domains.empty()) {
ORT_THROW_IF_ERROR(eval_sess_->AddCustomOpDomains(op_domains));
Expand Down

0 comments on commit 3b2ede8

Please sign in to comment.