-
Notifications
You must be signed in to change notification settings - Fork 32
Adding onetrace_enabled #903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding onetrace_enabled #903
Conversation
Example of usage:
```
(dev_dpctl) opavlyk@opavlyk-mobl:~/repos/dpctl$ ~/pti-gpu/tools/onetrace/build/onetrace --conditional-collection -v -t --demangle ipython
Device Timeline: start time (CLOCK_MONOTONIC_RAW) [ns] = 207284739877222
Device Timeline: start time (CLOCK_MONOTONIC) [ns] = 207284790110055
Device Timeline: start time (CLOCK_REALTIME) [ns] = 1662686020459161393
Python 3.9.12 (main, Jun 1 2022, 11:38:51)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import dpctl.tensor as dpt, dpctl, numpy as np
Device Timeline: start time (CLOCK_MONOTONIC_RAW) [ns] = 207294358012969
Device Timeline: start time (CLOCK_MONOTONIC) [ns] = 207294408245381
Device Timeline: start time (CLOCK_REALTIME) [ns] = 1662686030077296715
Device Timeline: start time (CLOCK_MONOTONIC_RAW) [ns] = 207294447416361
Device Timeline: start time (CLOCK_MONOTONIC) [ns] = 207294497648642
Device Timeline: start time (CLOCK_REALTIME) [ns] = 1662686030166699977
Device Timeline: start time (CLOCK_MONOTONIC_RAW) [ns] = 207294522074685
Device Timeline: start time (CLOCK_MONOTONIC) [ns] = 207294572308151
Device Timeline: start time (CLOCK_REALTIME) [ns] = 1662686030241359487
Device Timeline: start time (CLOCK_MONOTONIC_RAW) [ns] = 207294602756763
Device Timeline: start time (CLOCK_MONOTONIC) [ns] = 207294652988740
Device Timeline: start time (CLOCK_REALTIME) [ns] = 1662686030322040075
In [2]: from dpctl.utils import onetrace_enabled
In [3]: with onetrace_enabled():
...: dpt.linspace(0, 1, num=1000, dtype='f4')
...: dpt.arange(0, 20, dtype='i4')
...:
Device Timeline (queue: 0x56315e00e720): linear_sequence_affine_kernel<float, float>[SIMD32 {5; 1; 1} {200; 1; 1}]<1.1> [ns] = 49099144803 (append) 49099446053 (submit) 49101192928 (start) 49101202303 (end)
Device Timeline (queue: 0x56315e00e720): linear_sequence_step_kernel<int>[SIMD32 {1; 1; 1} {20; 1; 1}]<2.1> [ns] = 49154332484 (append) 49154668024 (submit) 49155196149 (start) 49155213440 (end)
In [4]: quit
Segmentation fault
```
The segmenation fault at the exit is a known issue with ZE-tracer module.
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/903/index.html |
b5fc478 to
5993fb1
Compare
5993fb1 to
22f2df5
Compare
|
Array API standard conformance tests failed to run. |
onetrace tool on linux uses execvp to start the application to trace. It sets LD_PRELOAD and PTI_ENABLE environment variables https://github.com/intel/pti-gpu/blob/master/loader/loader.cc#L216-L217 The check is added, on Linux, to confirm once that environment does contain expected variables, and emit a warning otherwise.
|
Array API standard conformance tests failed to run for dpctl=0.14.0dev0=py310h8c27c75_83. |
|
@diptorupd This PR is now ready. I have added checks on Linux that the interpreter has been launched by onetrace. |
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
|
Array API standard conformance tests failed to run for dpctl=0.14.0dev0=py310h8c27c75_90. |
This PR adds implementation of
onetrace_enabledcontext manager todpctl.utilsnamespace.Example of usage:
The segmenation fault at the exit is a known issue with ZE-tracer module.