reprospect.tools.nsys.report module

class reprospect.tools.nsys.report.Report(*, db: Path)View on GitHub

Bases: object

Helper for reading the SQLite export of a nsys report.

__enter__() SelfView on GitHub
__exit__(*args, **kwargs) NoneView on GitHub
__init__(*, db: Path) NoneView on GitHub
classmethod get_correlated_row(*, src: DataFrame | Series, dst: DataFrame, selector: Callable[[DataFrame], Series] | None = None, correlation_src: str = 'correlationId', correlation_dst: str = 'correlationId') SeriesView on GitHub

Select a row from src, and return the row from dst that matches by correlation ID.

classmethod get_correlated_rows(*, src: DataFrame | Series, dst: DataFrame, selector: Callable[[DataFrame], Series] | None = None, correlation_src: str = 'correlationId', correlation_dst: str = 'correlationId') DataFrameView on GitHub

Similar to get_correlated_row(), but may match more than one row.

get_events(table: str, accessors: Sequence[str], stringids: str | None = 'nameId') DataFrameView on GitHub

Query all rows in table that happen between the start/end time points of the nested NVTX range matching accessors.

Parameters:

stringids – Some tables have a column to be correlated with the StringIds table.

Note

This replaces nsys stats whose –filter-nvtx is not powerful enough, as of CUDA 13.0.0.

property nvtx_events: ReportNvtxEventsView on GitHub

Get all NVTX events from the NVTX_EVENTS table.

Add a children column that contains for each event a list of child indices, preserving the hierarchy of the nested NVTX ranges.

Add a level column, starting from 0 for the root events.

Note

Nesting is determined based on start and end time points.

Note

Events recorded with registered strings will have there text field set to NULL, and its textId field set.

We correlate the textId with the StringIds if need be.

static single_row(*, data: DataFrame) SeriesView on GitHub

Check that data has one row, and squeeze it.

table(*, name: str, **kwargs) DataFrameView on GitHub

Get a table from the report.

property tables: list[str]View on GitHub

Tables in the report.

class reprospect.tools.nsys.report.ReportNvtxEvents(events: DataFrame)View on GitHub

Bases: TreeMixin

__init__(events: DataFrame) NoneView on GitHub
get(accessors: Sequence[str]) DataFrameView on GitHub

Find all nested NVTX events matching accessors.

to_tree() TreeView on GitHub
class reprospect.tools.nsys.report.ReportPatternSelector(pattern: str | Pattern[str], column: str = 'Name')View on GitHub

Bases: object

A pandas.DataFrame selector that returns which rows match a regex pattern in a specific column.

__init__(pattern: str | Pattern[str], column: str = 'Name') None
column: str
pattern: str | Pattern[str]
reprospect.tools.nsys.report.strip_cuda_api_suffix(call: str) strView on GitHub

Strip suffix like _v10000 or _ptsz from a CUDA API call.