Skip to content

Preserve EP registration End events for returned errors without telemetry - #32780

Merged
bmehta001 merged 15 commits into
mainfrom
bhamehta/complete-ep-registration-telemetry
Sep 30, 2026
Merged

bmehta001 merged 15 commits into
mainfrom
bhamehta/complete-ep-registration-telemetry

Conversation

@bmehta001

@bmehta001 bmehta001 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Document why LogRegisterEpLibraryStart/End stay active without ORT_USE_TELEMETRY: Windows ETW still uses these calls; only timing is conditional.
  • Capture failed Status returns after library loading, duplicate names, std::exception, and unknown exceptions in a single failed RegisterEpLibraryEnd. Plugin loading remains outside the Start/End span: load failures return without either event. Add a missing-library registration test.

Windows behavior

WindowsTelemetry::LogRegisterEpLibraryEnd writes an informational ETW RegisterEpLibraryEnd event with isSuccess=false, error code/category, and a scrubbed error message if the provider registered and telemetry is enabled. This is not a separate LogRuntimeError event. ETW emission also depends on a listener subscribing; ORT unit-test processes suppress the Windows telemetry provider.

Validation

  • Earlier revisions passed clang-format checks and compiled as a Windows VS 2026 object (ORT_USE_TELEMETRY=OFF) and a WSL Linux object (ORT_USE_TELEMETRY=ON). The latest revision passed targeted lintrunner and git diff --check; CI is pending.
  • A full Windows target build is blocked by an existing Abseil patch reapplication on CMake regeneration; a direct generated-project compilation compiles environment.cc but fails in other files on existing ORT version assertions. The new integration test was not run locally.

bmehta001 and others added 2 commits September 24, 2026 01:37
Keep Windows ETW Start/End paired when ORT_USE_TELEMETRY is disabled by capturing early status returns before emitting End.\n\nFiles: onnxruntime/core/session/environment.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Limit the comment to returned Status failures; non-standard exceptions can still escape this catch. Files: onnxruntime/core/session/environment.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 24, 2026 06:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The telemetry-disabled regression path lacks runtime test coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Preserves EP registration End events for returned errors when telemetry duration tracking is disabled.

Changes:

  • Keeps registration work in a status-returning lambda across configurations.
  • Retains Start/End events while conditionally measuring duration.
File Description
onnxruntime/​core/​session/​environment.cc Preserves failure statuses in End events. Needs a telemetry-disabled runtime regression test.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Move loading under the common Start/End span so returned errors and caught exceptions emit a failed End event. Cover a missing library registration.

Files: include/onnxruntime/core/session/environment.h, onnxruntime/core/session/environment.cc, onnxruntime/test/autoep/test_registration.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bmehta001 bmehta001 assigned bmehta001 and unassigned bmehta001 Sep 24, 2026
Capture status on every load and initialization path so early failures reach End events and profiling cleanup. Keep timing conditional and cover failed-load and failed-initialization profiling.\n\nFiles: onnxruntime/core/session/inference_session.cc, onnxruntime/test/framework/inference_session_test.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
Allow the pre-load initialization profile test to load a model before ending profiling, as required by the profiling API. Omit telemetry provider calls on non-Windows builds without telemetry so Android minimal does not pay for no-op events.

Files changed: onnxruntime/core/session/inference_session.cc, onnxruntime/test/framework/inference_session_test.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
The ORT-format loader has no profiling cleanup, so non-Windows builds without telemetry can return errors directly. Keep the capture on Windows and with telemetry to preserve failed End events.

Files changed: onnxruntime/core/session/inference_session.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
Use the released logging support and verified source pins in FetchContent and the vcpkg overlay so both dependency paths agree. Remove compatibility patches now included upstream.

Files changed: cmake/deps.txt, cmake/external/onnxruntime_external_deps.cmake, cmake/patches/cpp_client_telemetry/cpp_client_telemetry.patch, cmake/vcpkg-configuration.json, cmake/vcpkg-ports/cpp-client-telemetry/fix-calloc.patch, cmake/vcpkg-ports/cpp-client-telemetry/portfile.cmake, cmake/vcpkg-ports/cpp-client-telemetry/vcpkg.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
The released SDK header already carries the pinned version, and vcpkg passes its version explicitly. Leave ORT's global CMake cache free of an SDK-specific version.

Files changed: cmake/external/onnxruntime_external_deps.cmake

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
Capture events through the profiling logger so tests do not assume that Wasm writes profile files.\n\nFiles changed: onnxruntime/test/framework/inference_session_test.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
Route cancellation, pre-load, and disabled GQA failures through one profiling and telemetry completion path without changing their status or End events. Remove the lock warning suppression now that no manual unlock remains.

Files changed: onnxruntime/core/session/inference_session.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b484370e-68a5-459b-b5cb-cdb2f7097fd2
Comment thread onnxruntime/core/session/environment.cc Resolved
Comment thread onnxruntime/core/session/environment.cc Resolved
bmehta001 and others added 2 commits September 28, 2026 22:35
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Keep plugin loading outside the registration telemetry span as before and remove status-capture guards so the ORT loader follows the simpler common path. This lets CI assess the requested size and behavior trade-off.

Files changed: include/onnxruntime/core/session/environment.h, onnxruntime/core/session/environment.cc, onnxruntime/core/session/inference_session.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9be33a5f-8eca-4d8d-9706-ac29e079a719
bmehta001 and others added 3 commits September 29, 2026 11:50
Match session telemetry guards while retaining Windows ETW without ORT_USE_TELEMETRY. Raise the Android minimal size limit by 1 KiB from the merged main baseline to accommodate the unconditional status-capture path.

Files changed: onnxruntime/core/session/environment.cc, .github/workflows/android.yml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9be33a5f-8eca-4d8d-9706-ac29e079a719
@bmehta001
bmehta001 enabled auto-merge (squash) September 29, 2026 23:23
@bmehta001
bmehta001 merged commit b209743 into main Sep 30, 2026
96 checks passed
@bmehta001
bmehta001 deleted the bhamehta/complete-ep-registration-telemetry branch September 30, 2026 02:02
Gopalakrishnan Nallasamy (GopalakrishnanN) pushed a commit to GopalakrishnanN/onnxruntime that referenced this pull request Oct 1, 2026
Bring in the shared CUDA routing fix from microsoft#32932 and the updated Android minimal size baseline from microsoft#32780 and microsoft#32805. Preserve the existing model-load validation changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants