Skip to content

Commit 5a9c706

Browse files
committed
fix: refactor logging logic
1 parent e59a582 commit 5a9c706

File tree

3 files changed

+120
-213
lines changed

3 files changed

+120
-213
lines changed

onnxruntime/core/providers/openvino/openvino_execution_provider.cc

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,10 @@ OpenVINOExecutionProvider::OpenVINOExecutionProvider(const ProviderInfo& info, s
6262
InitProviderOrtApi();
6363
#ifdef _WIN32
6464
session_id_ = ++global_session_counter_;
65-
OV_LOG_SESSION_CREATION(session_id_,
66-
session_context_.onnx_model_path_name.string(),
67-
session_context_.openvino_sdk_version);
6865
// Trace all provider options as one event
6966
OVTelemetry::Instance().LogAllProviderOptions(session_id_, session_context_);
7067
// Trace all session-related flags and inferred states
7168
OVTelemetry::Instance().LogAllSessionOptions(session_id_, session_context_);
72-
// Optionally: log provider init message also
73-
OV_LOG_PROVIDER_INIT(session_id_, session_context_.device_type, session_context_.precision);
7469
#endif
7570

7671
}
@@ -80,14 +75,6 @@ OpenVINOExecutionProvider::~OpenVINOExecutionProvider() {
8075
backend_manager.ShutdownBackendManager();
8176
}
8277
backend_managers_.clear();
83-
#ifdef _WIN32
84-
auto& telem = onnxruntime::openvino_ep::OVTelemetry::Instance();
85-
telem.LogSessionDestruction(session_id_);
86-
telem.LogProviderShutdown(session_id_);
87-
if (callback_etw_)
88-
logging::EtwRegistrationManager::Instance().UnregisterInternalCallback(callback_etw_);
89-
#endif
90-
9178
}
9279

9380
std::vector<std::unique_ptr<ComputeCapability>>
@@ -117,16 +104,6 @@ common::Status OpenVINOExecutionProvider::Compile(
117104
auto& logger = *GetLogger();
118105
Status status = Status::OK();
119106

120-
auto t0 = std::chrono::high_resolution_clock::now();
121-
#ifdef _WIN32
122-
OVTelemetry::Instance().LogCompileStart(
123-
session_id_,
124-
static_cast<uint32_t>(fused_nodes.size()),
125-
session_context_.device_type,
126-
session_context_.precision);
127-
#endif
128-
129-
130107
bool is_epctx_model = false;
131108
if (!fused_nodes.empty()) {
132109
// Assume these properties are constant for all the model subgraphs, otherwise move to SubGraphContext
@@ -247,13 +224,6 @@ common::Status OpenVINOExecutionProvider::Compile(
247224
file << metadata;
248225
}
249226

250-
#ifdef _WIN32
251-
auto t1 = std::chrono::high_resolution_clock::now();
252-
int64_t ms = std::chrono::duration_cast<std::chrono::milliseconds>(t1 - t0).count();
253-
OVTelemetry::Instance().LogCompileEnd(session_id_, status.IsOK(), status.ErrorMessage(), ms);
254-
#endif
255-
256-
257227
return status;
258228
}
259229

0 commit comments

Comments
 (0)