mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-01 23:30:35 +00:00
add telemetry for named dimension overrides (#4794)
Co-authored-by: Ori Levari <orlevari@microsoft.com>
This commit is contained in:
parent
0a0ac70eec
commit
5899c1197a
3 changed files with 22 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ wfc::IMapView<winrt::hstring, uint32_t> LearningModelSessionOptions::NamedDimens
|
|||
|
||||
void LearningModelSessionOptions::OverrideNamedDimension(winrt::hstring name, uint32_t value) {
|
||||
named_dim_overrides_.Insert(name, value);
|
||||
telemetry_helper.SetNamedDimensionOverride(name, value);
|
||||
}
|
||||
|
||||
uint32_t LearningModelSessionOptions::GetIntraOpNumThreads() {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class Profiler;
|
|||
#define WINML_TLM_RUNTIME_ERROR_VERSION 0
|
||||
#define WINML_TLM_RUNTIME_PERF_VERSION 0
|
||||
#define WINML_TLM_NATIVE_API_INTRAOP_THREADS_VERSION 0
|
||||
#define WINML_TLM_NAMED_DIMENSION_OVERRIDE_VERSION 0
|
||||
|
||||
#define WinMLTraceLoggingWrite(hProvider, EventName, ...) \
|
||||
TraceLoggingWrite(hProvider, \
|
||||
|
|
@ -97,6 +98,9 @@ class WinMLTelemetryHelper {
|
|||
uint32_t default_attribute_count);
|
||||
void SetIntraOpNumThreadsOverride(
|
||||
uint32_t num_threads);
|
||||
void SetNamedDimensionOverride(
|
||||
winrt::hstring name,
|
||||
uint32_t value);
|
||||
void EndRuntimeSession() { ++runtime_session_id_; };
|
||||
bool IsMeasureSampled();
|
||||
|
||||
|
|
|
|||
|
|
@ -123,4 +123,21 @@ void WinMLTelemetryHelper::SetIntraOpNumThreadsOverride(
|
|||
TraceLoggingInt32(num_threads_override, "numThreadsOverride"),
|
||||
TraceLoggingInt32(std::thread::hardware_concurrency(), "maxThreadsOnMachine"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
|
||||
void WinMLTelemetryHelper::SetNamedDimensionOverride(
|
||||
winrt::hstring name, uint32_t value) {
|
||||
if (!telemetry_enabled_)
|
||||
return;
|
||||
WinMLTraceLoggingWrite(
|
||||
provider_,
|
||||
"SetNamedDimensionOverride",
|
||||
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
|
||||
//Telemetry info
|
||||
TraceLoggingUInt8(WINML_TLM_NAMED_DIMENSION_OVERRIDE_VERSION, "schemaVersion"),
|
||||
// num threads info
|
||||
TraceLoggingWideString(name.c_str(), "dimension name"),
|
||||
TraceLoggingInt32(value, "override value"),
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES));
|
||||
}
|
||||
Loading…
Reference in a new issue