Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
13 changes: 13 additions & 0 deletions onnxruntime/core/platform/telemetry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void Telemetry::LogSessionCreation(uint32_t session_id, int64_t ir_version, cons
const std::string& loadedFrom, const std::vector<std::string>& execution_provider_ids,
const std::string& hardware_device_types,
const std::string& hardware_vendor_ids,
const std::string& ep_versions,
bool use_fp16, bool captureState) const {
ORT_UNUSED_PARAMETER(session_id);
ORT_UNUSED_PARAMETER(ir_version);
Expand All @@ -81,6 +82,7 @@ void Telemetry::LogSessionCreation(uint32_t session_id, int64_t ir_version, cons
ORT_UNUSED_PARAMETER(execution_provider_ids);
ORT_UNUSED_PARAMETER(hardware_device_types);
ORT_UNUSED_PARAMETER(hardware_vendor_ids);
ORT_UNUSED_PARAMETER(ep_versions);
ORT_UNUSED_PARAMETER(use_fp16);
ORT_UNUSED_PARAMETER(captureState);
}
Expand Down Expand Up @@ -124,6 +126,15 @@ void Telemetry::LogRuntimeError(uint32_t session_id, const common::Status& statu
ORT_UNUSED_PARAMETER(line);
}

void Telemetry::LogRuntimeInferenceError(uint32_t session_id, const common::Status& status,
const std::string& ep_versions,
const std::string& ep_device_types) const {
ORT_UNUSED_PARAMETER(session_id);
ORT_UNUSED_PARAMETER(status);
ORT_UNUSED_PARAMETER(ep_versions);
ORT_UNUSED_PARAMETER(ep_device_types);
}

void Telemetry::LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_last, int64_t total_run_duration_since_last,
const std::unordered_map<int64_t, long long>& duration_per_batch_size) const {
ORT_UNUSED_PARAMETER(session_id);
Expand All @@ -139,6 +150,7 @@ void Telemetry::LogEpDeviceUsage(uint32_t session_id,
uint32_t hardware_device_id,
const std::string& hardware_vendor,
const std::string& ep_vendor,
const std::string& ep_version,
int assigned_node_count,
uint32_t total_runs_since_last,
int64_t total_run_duration_since_last) const {
Expand All @@ -149,6 +161,7 @@ void Telemetry::LogEpDeviceUsage(uint32_t session_id,
ORT_UNUSED_PARAMETER(hardware_device_id);
ORT_UNUSED_PARAMETER(hardware_vendor);
ORT_UNUSED_PARAMETER(ep_vendor);
ORT_UNUSED_PARAMETER(ep_version);
ORT_UNUSED_PARAMETER(assigned_node_count);
ORT_UNUSED_PARAMETER(total_runs_since_last);
ORT_UNUSED_PARAMETER(total_run_duration_since_last);
Expand Down
6 changes: 6 additions & 0 deletions onnxruntime/core/platform/telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Telemetry {
const std::string& loadedFrom, const std::vector<std::string>& execution_provider_ids,
const std::string& hardware_device_types,
const std::string& hardware_vendor_ids,
const std::string& ep_versions,
bool use_fp16, bool captureState) const;

virtual void LogCompileModelStart(uint32_t session_id,
Expand All @@ -86,6 +87,10 @@ class Telemetry {
virtual void LogRuntimeError(uint32_t session_id, const common::Status& status, const char* file,
const char* function, uint32_t line) const;

virtual void LogRuntimeInferenceError(uint32_t session_id, const common::Status& status,
const std::string& ep_versions,
const std::string& ep_device_types) const;

virtual void LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_last, int64_t total_run_duration_since_last,
const std::unordered_map<int64_t, long long>& duration_per_batch_size) const;

Expand All @@ -100,6 +105,7 @@ class Telemetry {
uint32_t hardware_device_id,
const std::string& hardware_vendor,
const std::string& ep_vendor,
const std::string& ep_version,
int assigned_node_count,
uint32_t total_runs_since_last,
int64_t total_run_duration_since_last) const;
Expand Down
56 changes: 47 additions & 9 deletions onnxruntime/core/platform/windows/telemetry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ void WindowsTelemetry::LogSessionCreationStart(uint32_t session_id) const {
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}

Expand Down Expand Up @@ -318,6 +319,7 @@ void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_versio
const std::string& loaded_from, const std::vector<std::string>& execution_provider_ids,
const std::string& hardware_device_types,
const std::string& hardware_vendor_ids,
const std::string& ep_versions,
bool use_fp16, bool captureState) const {
if (global_register_count_ == 0 || enabled_ == false)
return;
Expand Down Expand Up @@ -373,7 +375,8 @@ void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_versio
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
// Telemetry info
// schemaVersion 1: added hardwareDeviceTypes and hardwareVendorIds
TraceLoggingUInt8(1, "schemaVersion"),
// schemaVersion 2: added executionProviderVersions
TraceLoggingUInt8(2, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingInt64(ir_version, "irVersion"),
TraceLoggingUInt32(projection_, "OrtProgrammingProjection"),
Expand All @@ -392,6 +395,7 @@ void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_versio
TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds"),
TraceLoggingString(hardware_device_types.c_str(), "hardwareDeviceTypes"),
TraceLoggingString(hardware_vendor_ids.c_str(), "hardwareVendorIds"),
TraceLoggingString(ep_versions.c_str(), "executionProviderVersions"),
TraceLoggingString(service_names.c_str(), "serviceNames"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
} else {
Expand All @@ -404,7 +408,8 @@ void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_versio
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
// Telemetry info
// schemaVersion 1: added hardwareDeviceTypes and hardwareVendorIds
TraceLoggingUInt8(1, "schemaVersion"),
// schemaVersion 2: added executionProviderVersions
TraceLoggingUInt8(2, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingInt64(ir_version, "irVersion"),
TraceLoggingUInt32(projection_, "OrtProgrammingProjection"),
Expand All @@ -423,6 +428,7 @@ void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_versio
TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds"),
TraceLoggingString(hardware_device_types.c_str(), "hardwareDeviceTypes"),
TraceLoggingString(hardware_vendor_ids.c_str(), "hardwareVendorIds"),
TraceLoggingString(ep_versions.c_str(), "executionProviderVersions"),
TraceLoggingString(service_names.c_str(), "serviceNames"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}
Expand Down Expand Up @@ -457,7 +463,7 @@ void WindowsTelemetry::LogCompileModelStart(uint32_t session_id,
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingString(input_source.c_str(), "inputSource"),
TraceLoggingString(output_target.c_str(), "outputTarget"),
Expand All @@ -466,6 +472,7 @@ void WindowsTelemetry::LogCompileModelStart(uint32_t session_id,
TraceLoggingBool(embed_ep_context, "embedEpContext"),
TraceLoggingBool(has_external_initializers_file, "hasExternalInitializersFile"),
TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}

Expand Down Expand Up @@ -507,7 +514,7 @@ void WindowsTelemetry::LogRuntimeError(uint32_t session_id, const common::Status
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingLevel(WINEVENT_LEVEL_ERROR),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingHResult(hr, "hResult"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingUInt32(status.Code(), "errorCode"),
Expand All @@ -516,6 +523,7 @@ void WindowsTelemetry::LogRuntimeError(uint32_t session_id, const common::Status
TraceLoggingString(file, "file"),
TraceLoggingString(function, "function"),
TraceLoggingInt32(line, "line"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
#else
TraceLoggingWrite(telemetry_provider_handle,
Expand All @@ -525,18 +533,43 @@ void WindowsTelemetry::LogRuntimeError(uint32_t session_id, const common::Status
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingLevel(WINEVENT_LEVEL_ERROR),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingUInt32(status.Code(), "errorCode"),
TraceLoggingUInt32(status.Category(), "errorCategory"),
TraceLoggingString(status.ErrorMessage().c_str(), "errorMessage"),
TraceLoggingString(file, "file"),
TraceLoggingString(function, "function"),
TraceLoggingInt32(line, "line"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
#endif
}

void WindowsTelemetry::LogRuntimeInferenceError(uint32_t session_id, const common::Status& status,
const std::string& ep_versions,
const std::string& ep_device_types) const {
if (global_register_count_ == 0 || enabled_ == false)
return;

TraceLoggingWrite(telemetry_provider_handle,
"RuntimeInferenceError",
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingLevel(WINEVENT_LEVEL_ERROR),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
Comment thread
dabhattimsft marked this conversation as resolved.
TraceLoggingUInt32(status.Code(), "errorCode"),
Comment thread
dabhattimsft marked this conversation as resolved.
TraceLoggingUInt32(status.Category(), "errorCategory"),
TraceLoggingString(status.ErrorMessage().c_str(), "errorMessage"),
TraceLoggingString(ep_versions.c_str(), "executionProviderVersions"),
TraceLoggingString(ep_device_types.c_str(), "executionProviderDeviceTypes"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}

void WindowsTelemetry::LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_last, int64_t total_run_duration_since_last,
const std::unordered_map<int64_t, long long>& duration_per_batch_size) const {
if (global_register_count_ == 0 || enabled_ == false)
Expand All @@ -559,11 +592,12 @@ void WindowsTelemetry::LogRuntimePerf(uint32_t session_id, uint32_t total_runs_s
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingUInt32(total_runs_since_last, "totalRuns"),
TraceLoggingInt64(total_run_duration_since_last, "totalRunDuration"),
TraceLoggingString(total_duration_per_batch_size.c_str(), "totalRunDurationPerBatchSize"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}

Expand All @@ -574,6 +608,7 @@ void WindowsTelemetry::LogEpDeviceUsage(uint32_t session_id,
uint32_t hardware_device_id,
const std::string& hardware_vendor,
const std::string& ep_vendor,
const std::string& ep_version,
int assigned_node_count,
uint32_t total_runs_since_last,
int64_t total_run_duration_since_last) const {
Expand All @@ -588,14 +623,15 @@ void WindowsTelemetry::LogEpDeviceUsage(uint32_t session_id,
TraceLoggingKeyword(static_cast<uint64_t>(onnxruntime::logging::ORTTraceLoggingKeyword::Session)),
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingString(ep_type.c_str(), "executionProviderType"),
TraceLoggingString(hardware_device_type.c_str(), "hardwareDeviceType"),
TraceLoggingUInt32(hardware_vendor_id, "hardwareVendorId"),
TraceLoggingUInt32(hardware_device_id, "hardwareDeviceId"),
TraceLoggingString(hardware_vendor.c_str(), "hardwareVendor"),
TraceLoggingString(ep_vendor.c_str(), "epVendor"),
TraceLoggingString(ep_version.c_str(), "epVersion"),
Comment thread
dabhattimsft marked this conversation as resolved.
TraceLoggingInt32(assigned_node_count, "assignedNodeCount"),
TraceLoggingUInt32(total_runs_since_last, "totalRunsSinceLast"),
TraceLoggingInt64(total_run_duration_since_last, "totalRunDurationSinceLast"),
Expand Down Expand Up @@ -724,8 +760,9 @@ void WindowsTelemetry::LogModelLoadStart(uint32_t session_id) const {
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}

Expand Down Expand Up @@ -799,8 +836,9 @@ void WindowsTelemetry::LogRegisterEpLibraryStart(const std::string& registration
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
// Telemetry info
TraceLoggingUInt8(0, "schemaVersion"),
TraceLoggingUInt8(1, "schemaVersion"),
TraceLoggingString(registration_name.c_str(), "registrationName"),
TraceLoggingString(ORT_VERSION, "runtimeVersion"),
TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName"));
}

Expand Down
6 changes: 6 additions & 0 deletions onnxruntime/core/platform/windows/telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class WindowsTelemetry : public Telemetry {
const std::string& loadedFrom, const std::vector<std::string>& execution_provider_ids,
const std::string& hardware_device_types,
const std::string& hardware_vendor_ids,
const std::string& ep_versions,
bool use_fp16, bool captureState) const override;

void LogCompileModelStart(uint32_t session_id,
Expand All @@ -79,6 +80,10 @@ class WindowsTelemetry : public Telemetry {
void LogRuntimeError(uint32_t session_id, const common::Status& status, const char* file,
const char* function, uint32_t line) const override;

void LogRuntimeInferenceError(uint32_t session_id, const common::Status& status,
const std::string& ep_versions,
const std::string& ep_device_types) const override;

void LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_last, int64_t total_run_duration_since_last,
const std::unordered_map<int64_t, long long>& duration_per_batch_size) const override;

Expand All @@ -89,6 +94,7 @@ class WindowsTelemetry : public Telemetry {
uint32_t hardware_device_id,
const std::string& hardware_vendor,
const std::string& ep_vendor,
const std::string& ep_version,
int assigned_node_count,
uint32_t total_runs_since_last,
int64_t total_run_duration_since_last) const override;
Expand Down
Loading
Loading