Hello,
I profiled some kernels using Nsight Compute. The PM sampling timeline view gives me the information I want to analyze for my kernel.
I would like to extract the data/list of points from the timeline view. In the raw data, I only see aggregates of this view, such as the sum. Yet the Nsight Compute tool is able to show them to me through time, at each t step (here, 1000 nanoseconds).
A screenshot of what I am referring to:
How can I extract the raw data visualized by Nsight Compute, either using the ncu
cli or the Python Report Interface? I’ve been searching for this information for some time, and could not find anything online.
Thanks a lot for the help.
PM Sampling metrics are stored as instanced metrics, with N pairs of <correlation ID : value>
You can
- Use the metric details window to view and copy their values. Open the window and select any value on the timeline to view that metric (name and values).
- Print metric instances from the command line with
--print-metric-instances details
- Use the Python Report Interface (PRI) to access instance correlation IDs (timestamps for sampling metrics) and values. You can find an example on how to access instances metric through Python here.
Note that in the timeline and metric details window, sampling metrics are generallyctx-switched and aligned to 0, unless context switch filter is disabled. In the CLI and PRI export, they are not (timestamps don’t start from 0).
1 Like
Thank you! The Python notebook for the Python Report Interface helped a lot.
How is the data context switched and aligned to 0? The Workload Execution tab in yellow delimits the start and stop points of the kernel execution. How does NCU computes them? Is there a way to obtain them from the report?
I tried using the duration time of the kernel, but samples start being collected much before the beginning of the kernel execution.