Skip to content

fix(perf): generalize op-tracing availability check and align trace output path#1000

Merged
xieofxie merged 3 commits into
mainfrom
hualxie/fix_qnn_op
Jun 30, 2026
Merged

fix(perf): generalize op-tracing availability check and align trace output path#1000
xieofxie merged 3 commits into
mainfrom
hualxie/fix_qnn_op

Conversation

@xieofxie

Copy link
Copy Markdown
Contributor

Summary

Tightens and generalizes the --op-tracing path in winml perf, plus a QNN profiler session fix.

  • Rename is_qnn_profiling_available()is_profiling_available(resolved_ep, resolved_device, op_tracing). Instead of only probing ORT for the QNN provider, it now validates the benchmark's resolved EP/device/level against the single combination op-tracing currently supports — QNN EP + NPU + basic. EP aliases (e.g. qnn) are normalized, and device/level comparisons are case-insensitive. Supported values live in module constants so they are easy to expand as more tracers land.
  • Expose resolved_ep / resolved_device properties on PerfBenchmark so the CLI can gate op-tracing on what actually drove the build/inference, with an error message that reports the resolved values.
  • Align the op-trace output path with the benchmark report. The trace JSON now mirrors output: a/b.jsona/b_op_trace.json, instead of being rebuilt from the model name.
  • QNN profiler session fix. Build the QNN session via add_ep_for_device(...) for the NPU device (failing fast if it cannot be added) rather than passing providers=[...] directly, and switch provider options to a single dict.

Tests

  • Rewrote tests/unit/optracing/test_detection.py for the new signature: supported combo, alias normalization, case-insensitivity, and a parametrized table of unsupported combinations.
  • uv run pytest tests/unit/optracing/test_detection.py — 11 passed.

@xieofxie xieofxie requested a review from a team as a code owner June 30, 2026 03:20
@xieofxie xieofxie merged commit 3c9c76a into main Jun 30, 2026
9 checks passed
@xieofxie xieofxie deleted the hualxie/fix_qnn_op branch June 30, 2026 07:05
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.

2 participants