From c6a3620ba8ebfd1e199eeb01f33d1419df40b337 Mon Sep 17 00:00:00 2001 From: Ryan Lai Date: Tue, 1 Sep 2020 17:02:00 -0700 Subject: [PATCH] Remove evaluate telemetry due to redundancy (#4996) * Remove evaluate start / stop from telemetry * Remove eval telemetry * remove check for evaluate time delay * add comment * remove const Co-authored-by: Ryan Lai --- onnxruntime/core/platform/windows/telemetry.cc | 10 ++-------- onnxruntime/core/session/inference_session.cc | 18 +++++------------- onnxruntime/core/session/inference_session.h | 6 +----- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/onnxruntime/core/platform/windows/telemetry.cc b/onnxruntime/core/platform/windows/telemetry.cc index 59740a0340..46298e2d17 100644 --- a/onnxruntime/core/platform/windows/telemetry.cc +++ b/onnxruntime/core/platform/windows/telemetry.cc @@ -127,10 +127,7 @@ void WindowsTelemetry::LogEvaluationStop() const { return; TraceLoggingWrite(telemetry_provider_handle, - "EvaluationStop", - TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), - TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage), - TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES)); + "EvaluationStop"); } void WindowsTelemetry::LogEvaluationStart() const { @@ -138,10 +135,7 @@ void WindowsTelemetry::LogEvaluationStart() const { return; TraceLoggingWrite(telemetry_provider_handle, - "EvaluationStart", - TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), - TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage), - TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES)); + "EvaluationStart"); } void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_version, const std::string& model_producer_name, diff --git a/onnxruntime/core/session/inference_session.cc b/onnxruntime/core/session/inference_session.cc index 9226e9238b..a822dcfb18 100644 --- a/onnxruntime/core/session/inference_session.cc +++ b/onnxruntime/core/session/inference_session.cc @@ -1297,14 +1297,8 @@ Status InferenceSession::Run(const RunOptions& run_options, return Status(common::ONNXRUNTIME, common::FAIL, "Session not initialized."); } - // check the frequency to send Evalutaion Stop event - if (TimeDiffMicroSeconds(telemetry_.time_sent_last_evalutation_start_) > - telemetry_.kDurationBetweenSendingEvaluationStart) { - env.GetTelemetryProvider().LogEvaluationStart(); - // reset counters - telemetry_.time_sent_last_evalutation_start_ = std::chrono::high_resolution_clock::now(); - telemetry_.isEvaluationStart = true; - } + // log evaluation start to trace logging provider + env.GetTelemetryProvider().LogEvaluationStart(); ORT_RETURN_IF_ERROR_SESSIONID_(ValidateInputs(feed_names, feeds)); ORT_RETURN_IF_ERROR_SESSIONID_(ValidateOutputs(output_names, p_fetches)); @@ -1393,11 +1387,9 @@ Status InferenceSession::Run(const RunOptions& run_options, telemetry_.total_run_duration_since_last_ = 0; } - // check the frequency to send Evalutaion Stop event - if (telemetry_.isEvaluationStart) { - env.GetTelemetryProvider().LogEvaluationStop(); - telemetry_.isEvaluationStart = false; - } + // log evaluation stop to trace logging provider + env.GetTelemetryProvider().LogEvaluationStop(); + // send out profiling events (optional) if (session_profiler_.IsEnabled()) { session_profiler_.EndTimeAndRecordEvent(profiling::SESSION_EVENT, "model_run", tp); diff --git a/onnxruntime/core/session/inference_session.h b/onnxruntime/core/session/inference_session.h index 1d7f0b4a67..601949d004 100644 --- a/onnxruntime/core/session/inference_session.h +++ b/onnxruntime/core/session/inference_session.h @@ -592,18 +592,14 @@ class InferenceSession { uint32_t session_id_; // the current session's id struct Telemetry { - Telemetry() : time_sent_last_(), time_sent_last_evalutation_start_() {} + Telemetry() : time_sent_last_() {} uint32_t total_runs_since_last_ = 0; // the total number of Run() calls since the last report long long total_run_duration_since_last_ = 0; // the total duration (us) of Run() calls since the last report std::string event_name_; // where the model is loaded from: ["model_loading_uri", "model_loading_proto", "model_loading_istream"] TimePoint time_sent_last_; // the TimePoint of the last report - TimePoint time_sent_last_evalutation_start_; // Event Rate per provider < 20 peak events per second constexpr static long long kDurationBetweenSending = 1000 * 1000 * 60 * 10; // duration in (us). send a report every 10 mins - constexpr static long long kDurationBetweenSendingEvaluationStart = 1000 * 50; // duration in (us). send a EvaluationStop Event every 50 ms; - - bool isEvaluationStart = false; } telemetry_; #ifdef ONNXRUNTIME_ENABLE_INSTRUMENT