stormlog.infer.trace_nsys

Import Nsight Systems SQLite exports as inference activity references.

nsys export --type sqlite REPORT.nsys-rep writes the CUPTI activity tables and NVTX ranges of a report into SQLite. This reader turns them into the same in-memory trace as the Kineto reader, so the import, iteration linking, and accounting rules are shared:

  • GPU work comes from CUPTI_ACTIVITY_KIND_KERNEL, _MEMCPY and _MEMSET; launch calls from _RUNTIME, which also holds driver calls. A report can hold several processes, so launches are keyed by process and correlation ID.

  • Iteration ranges are NVTX ranges named stormlog.iteration/...; emit them with iteration_range(..., nvtx=True).

  • A GPU event’s deviceId is the CUDA device ordinal inside its process, after CUDA_VISIBLE_DEVICES. TARGET_INFO_CUDA_DEVICE maps each process’s ordinals to TARGET_INFO_GPU rows, which name the UUIDs. Older exporters (nsys 2024.4) do not write that table; a report of such an export that lists one GPU still names it, since nsys lists every GPU on the host. Otherwise the devices stay unnamed: re-export the report with a newer nsys.

Record CUDA graphs with --cuda-graph-trace=node. At the default graph-level tracing nsys writes one CUPTI_ACTIVITY_KIND_GRAPH_TRACE row per graph launch instead of its kernels. This reader does not import those rows; it counts them in the summary and says how to re-record.

Functions

load_nsys_sqlite(path)

Read an nsys export --type sqlite file.

split_global_id(global_id)

(pid, tid) from an nsys globalTid: (1 << 48) | pid << 24 | tid.

stormlog.infer.trace_nsys.load_nsys_sqlite(path)[source]

Read an nsys export --type sqlite file.

Parameters:

path (str | Path)

Return type:

KinetoTrace

stormlog.infer.trace_nsys.split_global_id(global_id)[source]

(pid, tid) from an nsys globalTid: (1 << 48) | pid << 24 | tid.

Parameters:

global_id (int)

Return type:

tuple[int, int]