intel / intel/pti-gpu

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

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
273
Forks
70
PR merge metrics
No merged PRs in 30d

Description

`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

```python
import torch

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

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

Run:

```bash
. /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.

Contributor guide

Open the contributing guide

Research direction

Start by running the issue's mm.py PyTorch XPU reproducer with `unitrace -q`, first without and then with `print(z)`, and compare the reports. Trace the unitrace entry point used by that command and the metrics-reporting path; done means the workload produces a populated `Device #x Metrics` section without printing the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, pytorch
Domain
cli, performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.