Skip to content

test(e2e): strengthen perf CLI coverage - #1149

Open
xieofxie wants to merge 17 commits into
mainfrom
hualxie/perf_e2e
Open

test(e2e): strengthen perf CLI coverage#1149
xieofxie wants to merge 17 commits into
mainfrom
hualxie/perf_e2e

Conversation

@xieofxie

@xieofxie xieofxie commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require monitored GPU and NPU perf runs to report positive utilization
  • add CPU E2E coverage for --batch-size and --input-data
  • add QNN NPU E2E coverage for --op-tracing basic and its trace report
  • The model for npu tests is Convert hf-tiny-model-private/tiny-random-ResNetForImageClassification via FTK's amd npu resnet recipe

@xieofxie
xieofxie requested a review from a team as a code owner July 21, 2026 02:47
Comment thread tests/assets/resnet_w8a8/model.onnx
The perf ONNX suite shared one generated float MatMul across CPU/GPU/NPU tests, which is not representative of NPU (QNN/VitisAI) execution. Add an npu_model_arg fixture that defaults to model_arg, override it in TestPerfONNXDirect to point at tests/assets/model.onnx, and route the NPU tests (memory, monitor, ep-device, op-tracing) through it. CPU/GPU tests keep the lightweight generated model.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread tests/e2e/test_perf_e2e.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens end-to-end coverage of the winml perf CLI by expanding argument-level tests and tightening expectations for monitored GPU/NPU runs, while introducing a real ONNX asset to better represent NPU execution.

Changes:

  • Require monitored GPU/NPU runs to report positive utilization in hw_monitor.
  • Add CPU E2E tests for --batch-size and --input-data.
  • Add QNN NPU E2E coverage for --op-tracing basic and validation of the generated op-trace report.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/e2e/test_perf_e2e.py Adds new perf CLI E2E test coverage (batch size, input data, op tracing), introduces an NPU-specific model fixture, and strengthens monitoring assertions.
tests/assets/model.onnx.data Adds external data sidecar needed by the repo-shipped ONNX model used in NPU E2E tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/test_perf_e2e.py Outdated
xieofxie and others added 7 commits July 22, 2026 11:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Restore the model_arg parameter on TestPerfONNXDirect.npu_model_arg so it matches the _PerfBenchmarkSuite base fixture signature, resolving the CodeQL signature-mismatch alert.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

tests/e2e/test_perf_e2e.py:141

  • When duration_overwrite is set, this helper still always passes an explicit --iterations value. That contradicts the docstring (“replaces the fixed benchmark count”), and also marks iterations as CLI-provided, which can change perf CLI defaulting/behavior compared to real duration-mode usage. Consider omitting --iterations entirely when duration_overwrite is provided.
    e2e speed). ``duration_overwrite`` replaces the fixed benchmark count with
    a wall-clock budget. Warmup is always 1.
    """
    iterations = 300 if monitor else 3
    args: list[str] = [

tests/assets/resnet.md:7

  • The asset provenance note references an internal/private Hugging Face model ID without indicating that access is required or giving enough detail to reproduce the artifacts. Please clarify that the source model is internal/private and add a short, reproducible description of where the recipe lives and what stage produces the fp32 vs w8a8 outputs.
# resnet_w8a8

Generated by using hf-tiny-model-private/tiny-random-ResNetForImageClassification in FTK's AMD npu Microsoft/resnet-50 recipe.

# resnet_fp32

tests/e2e/test_perf_e2e.py:499

  • This GPU monitor test disables utilization assertions unconditionally, which undermines the stated goal of requiring positive utilization for monitored runs. Since the JSON report includes the resolved EP, you can relax the utilization requirement only for OpenVINO (which doesn’t reliably bump PDH counters) while keeping the stronger assertion for other EPs.
        # TODO skip all due to openvino gpu could not emit valid pdh counter
        _assert_monitor_result(data, device="gpu", require_utilization=False)

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.

4 participants