Skip to content

[Bug] unitrace -q produces no metrics unless the result is printed #116

Description

@NaOHCC

unitrace -q does not produce hardware metrics report for a simple PyTorch XPU workload unless the result is printed.

Environment

  • OS: Ubuntu 24.04
  • Driver: 64290D8E349F41730D761F4
  • Level Zero: 1.28.6
  • Device: Intel(R) Arc(TM) Pro B70 Graphics
  • PyTorch: 2.13.0+xpu
  • pti-gpu commit: c71e8316e19bb5316157b9046d877b5eff0e262c
  • unitrace version: 2.4.0 (c71e8316e19bb5316157b9046d877b5eff0e262c)
  • intel-metrics-discovery: 1.14.188
  • intel-metrics-library: 1.0.231

Reproducer

import torch

x = torch.rand(1024, 1024, device="xpu")
z = x @ x

# Uncommenting this line makes unitrace produce metrics:
# print(z)

Run:

. /opt/intel/oneapi/setvars.sh
unitrace -q python mm.py

Actual behavior

Without the print statement, the command exits successfully but print only Device Timing Summary section. It does not print Device #x Metrics, e.g.

=== Device Timing Summary ===

                Total Execution Time (ns):           1153914201

After uncommenting print(z) the same command produces populated device timing and hardware metrics.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions