mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-12 17:57:38 +00:00
User/xianz/win ml telemetry (#2410)
* add option to enable winml telemetry * add option to enable winml telemetry * clean logs while developping * clean the log of GUID * compile onnxruntime_common with winml telemetry * use option for use_telemetry * rename option winml_use_telemetry to onnxruntime_use_telemetry * little change
This commit is contained in:
parent
895342bf74
commit
b0cb0ef6e5
6 changed files with 23 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ option(onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS "Enable operator implemented in l
|
|||
option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS "Dump node input shapes and output data to standard output when executing the model." OFF)
|
||||
option(onnxruntime_USE_DML "Build with DirectML support" OFF)
|
||||
option(onnxruntime_USE_ACL "Build with ACL support" OFF)
|
||||
option(onnxruntime_USE_TELEMETRY "Build with Telemetry" OFF)
|
||||
|
||||
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE)
|
||||
#nsync tests failed on Mac Build
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_common_src})
|
|||
|
||||
add_library(onnxruntime_common ${onnxruntime_common_src})
|
||||
|
||||
if (onnxruntime_USE_TELEMETRY)
|
||||
set_target_properties(onnxruntime_common PROPERTIES COMPILE_FLAGS "/FI${ONNXRUNTIME_INCLUDE_DIR}/core/platform/windows/TraceLoggingConfigPrivate.h")
|
||||
endif()
|
||||
|
||||
if (onnxruntime_USE_MIMALLOC)
|
||||
if(onnxruntime_USE_CUDA OR onnxruntime_USE_OPENVINO)
|
||||
message(WARNING "Ignoring directive to use mimalloc on unimplemented targets")
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ add_library(winml_lib_telemetry STATIC
|
|||
# Compiler options
|
||||
target_compile_features(winml_lib_telemetry PRIVATE cxx_std_17)
|
||||
target_compile_options(winml_lib_telemetry PRIVATE /GR- /await /wd4238)
|
||||
if (onnxruntime_USE_TELEMETRY)
|
||||
set_target_properties(winml_lib_telemetry PROPERTIES COMPILE_FLAGS "/FI${ONNXRUNTIME_INCLUDE_DIR}/core/platform/windows/TraceLoggingConfigPrivate.h")
|
||||
endif()
|
||||
|
||||
# Compiler flags
|
||||
target_compile_definitions(winml_lib_telemetry PRIVATE PLATFORM_WINDOWS)
|
||||
|
|
|
|||
|
|
@ -31,8 +31,11 @@ Environment:
|
|||
|
||||
// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
|
||||
// in this file configures the provider as a normal (non-telemetry) provider.
|
||||
#ifndef TraceLoggingOptionMicrosoftTelemetry
|
||||
#define TraceLoggingOptionMicrosoftTelemetry() \
|
||||
TraceLoggingOptionGroup(0000000000, 00000, 00000, 0000, 0000, 0000, 0000, 0000, 000, 0000, 0000)
|
||||
// Empty definition for TraceLoggingOptionMicrosoftTelemetry
|
||||
#endif
|
||||
|
||||
// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
|
||||
// in this file configures the provider as a normal (non-telemetry) provider.
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ Use the individual flags to only run the specified stages.
|
|||
parser.add_argument("--enable_multi_device_test", action='store_true', help="Test with multi-device. Mostly used for multi-device GPU")
|
||||
parser.add_argument("--use_dml", action='store_true', help="Build with DirectML.")
|
||||
parser.add_argument("--use_winml", action='store_true', help="Build with WinML.")
|
||||
parser.add_argument("--use_telemetry", action='store_true', help="Only official builds can set this flag to enable telemetry.")
|
||||
return parser.parse_args()
|
||||
|
||||
def resolve_executable_path(command_or_path):
|
||||
|
|
@ -374,6 +375,7 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home
|
|||
"-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=" + ("ON" if args.enable_language_interop_ops or (args.config != 'Debug' and bool(os.getenv('NIGHTLY_BUILD') == '1')) else "OFF"),
|
||||
"-Donnxruntime_USE_DML=" + ("ON" if args.use_dml else "OFF"),
|
||||
"-Donnxruntime_USE_WINML=" + ("ON" if args.use_winml and args.use_dml else "OFF"),
|
||||
"-Donnxruntime_USE_TELEMETRY=" + ("ON" if args.use_telemetry else "OFF"),
|
||||
]
|
||||
if args.use_brainslice:
|
||||
bs_pkg_name = args.brain_slice_package_name.split('.', 1)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,16 @@ jobs:
|
|||
CUDA_VERSION: ${{ parameters.CudaVersion }}
|
||||
|
||||
steps:
|
||||
- powershell: |
|
||||
if($env:WINMLTELEMETRYGUID)
|
||||
{
|
||||
$length = $env:WINMLTELEMETRYGUID.length
|
||||
$fileContent = "#define TraceLoggingOptionMicrosoftTelemetry() \
|
||||
TraceLoggingOptionGroup("+$env:WINMLTELEMETRYGUID.substring(1, $length-2)+")"
|
||||
New-Item -Path "$(Build.SourcesDirectory)\include\onnxruntime\core\platform\windows\TraceLoggingConfigPrivate.h" -ItemType "file" -Value "$fileContent" -Force
|
||||
}
|
||||
displayName: 'Create TraceLoggingConfigPrivate.h For WinML Telemetry'
|
||||
|
||||
- template: set-test-data-variables-step.yml
|
||||
- template: windows-build-tools-setup-steps.yml
|
||||
parameters:
|
||||
|
|
|
|||
Loading…
Reference in a new issue