reprospect.tools.ncu.metrics module

class reprospect.tools.ncu.metrics.L1TEXCacheView on GitHub

Bases: object

A selection of metrics related to L1/TEX cache.

See [Str21].

GlobalLoadView on GitHub

alias of L1TEXCacheGlobalLoad

GlobalStoreView on GitHub

alias of L1TEXCacheGlobalStore

LocalStoreView on GitHub

alias of L1TEXCacheLocalStore

NAME: Final[str] = 'L1/TEX cache'
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadView on GitHub

Bases: object

InstructionsView on GitHub

alias of L1TEXCacheGlobalLoadInstructions

NAME: Final[str] = 'global load'
RequestsView on GitHub

alias of L1TEXCacheGlobalLoadRequests

SectorHitsView on GitHub

alias of L1TEXCacheGlobalLoadSectorHits

SectorMissesView on GitHub

alias of L1TEXCacheGlobalLoadSectorMisses

SectorsView on GitHub

alias of L1TEXCacheGlobalLoadSectors

WavefrontsView on GitHub

alias of L1TEXCacheGlobalLoadWavefronts

class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadInstructionsView on GitHub

Bases: object

Factory of counter metric (unit)__(sass?)_inst_executed_op_global_ld.

static create(*, mode: Literal['sass'] | None = 'sass', subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadRequestsView on GitHub

Bases: object

Factory of counter metric l1tex__t_requests_pipe_lsu_mem_global_op_ld.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadSectorHitsView on GitHub

Bases: object

Factory of counter metric l1tex__t_sectors_pipe_lsu_mem_global_op_ld_lookup_hit.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadSectorMissesView on GitHub

Bases: object

Factory of counter metric l1tex__t_sectors_pipe_lsu_mem_global_op_ld_lookup_miss.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadSectorsView on GitHub

Bases: object

Factory of counter metric l1tex__t_sectors_pipe_lsu_mem_global_op_ld.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,), suffix: Literal['hit', 'miss'] | None = None) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalLoadWavefrontsView on GitHub

Bases: object

Factory of counter metric l1tex__t_wavefronts_pipe_lsu_mem_global_op_ld.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalStoreView on GitHub

Bases: object

InstructionsView on GitHub

alias of L1TEXCacheGlobalStoreInstructions

NAME: Final[str] = 'global store'
RequestsView on GitHub

alias of L1TEXCacheGlobalStoreRequests

SectorsView on GitHub

alias of L1TEXCacheGlobalStoreSectors

class reprospect.tools.ncu.metrics.L1TEXCacheGlobalStoreInstructionsView on GitHub

Bases: object

Factory of counter metric (unit)__(sass?)_inst_executed_op_global_st.

static create(*, mode: Literal['sass'] | None = 'sass', subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalStoreRequestsView on GitHub

Bases: object

Factory of counter metric l1tex__t_requests_pipe_lsu_mem_global_op_st.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalStoreSectorsView on GitHub

Bases: object

Factory of counter metric l1tex__t_sectors_pipe_lsu_mem_global_op_st.

static create(*, subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheLocalStoreView on GitHub

Bases: object

InstructionsView on GitHub

alias of L1TEXCacheLocalStoreInstructions

NAME: Final[str] = 'local store'
class reprospect.tools.ncu.metrics.L1TEXCacheLocalStoreInstructionsView on GitHub

Bases: object

Factory of counter metric (unit)__(sass?)_inst_executed_op_local_st.

static create(*, mode: Literal['sass'] | None = 'sass', subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) tuple[MetricCounter, ...]View on GitHub
class reprospect.tools.ncu.metrics.LaunchBlockView on GitHub

Bases: XYZBase

Factory of metrics launch__block_dim_x, launch__block_dim_y and launch__block_dim_z.

PREFIX: ClassVar[str] = 'launch__block_dim_'
PRETTY_PREFIX: ClassVar[str | None] = 'Launch block size'
class reprospect.tools.ncu.metrics.LaunchGridView on GitHub

Bases: XYZBase

Factory of metrics launch__grid_dim_x, launch__grid_dim_y and launch__grid_dim_z.

PREFIX: ClassVar[str] = 'launch__grid_dim_'
PRETTY_PREFIX: ClassVar[str | None] = 'Launch grid size'
class reprospect.tools.ncu.metrics.Metric(name: str, pretty_name: str | None = None, subs: tuple[str | tuple[str, ...], ...] | None = None)View on GitHub

Bases: object

Used to represent a ncu metric.

If subs is not given, it is assumed that name is a valid metric that can be directly evaluated by ncu.

References:

Note

It is not decorated with dataclasses.dataclass() because of https://github.com/mypyc/mypyc/issues/1061.

SILENT_SUBS: ClassVar[frozenset[str]] = frozenset({})

Sub-metric components implied by the metric kind, omitted from labels.

__init__(name: str, pretty_name: str | None = None, subs: tuple[str | tuple[str, ...], ...] | None = None) NoneView on GitHub
Parameters:
  • name – The base name of the metric.

  • pretty_name – Human readable name; defaults to name.

  • subs – Sub-metric names. The constructor normalizes each to a path of components.

gather() tuple[str, ...]View on GitHub

Get the list of sub-metric names or the metric name itself if no sub-metrics are defined.

labels() tuple[str, ...]View on GitHub

Get the list of sub-metric labels. Parallel to gather(), but uses the pretty name.

name: Final[str]
pretty_name: Final[str | None]
subs: Final[tuple[tuple[str, ...], ...] | None]
class reprospect.tools.ncu.metrics.MetricCorrelation(name: str)View on GitHub

Bases: object

A metric with correlations, like sass__inst_executed_per_opcode.

References:

__init__(name: str) None
gather() tuple[str]View on GitHub
labels() tuple[str]View on GitHub
name: str
class reprospect.tools.ncu.metrics.MetricCorrelationData(correlated: dict[str | int, int | float], value: int | float | None = None)View on GitHub

Bases: object

Data for MetricCorrelation.

References:

__init__(correlated: dict[str | int, int | float], value: int | float | None = None) None
correlated: dict[str | int, int | float]
value: int | float | None
class reprospect.tools.ncu.metrics.MetricCounter(name: str, pretty_name: str | None = None, subs: tuple[str | tuple[str, ...], ...] | None = None)View on GitHub

Bases: Metric

A counter metric.

The sub-metric names are expected to be from MetricCounterRollUp.

References:

SILENT_SUBS: ClassVar[frozenset[str]] = frozenset({MetricCounterRollUp.SUM})

Sub-metric components implied by the metric kind, omitted from labels.

name: Final[str]
pretty_name: Final[str | None]
subs: Final[tuple[tuple[str, ...], ...] | None]
class reprospect.tools.ncu.metrics.MetricCounterRollUp(*values)View on GitHub

Bases: StrEnum

Available roll-ups for MetricCounter.

AVG = 'avg'
MAX = 'max'
MIN = 'min'
SUM = 'sum'
__str__()

Return str(self).

property label: strView on GitHub
class reprospect.tools.ncu.metrics.MetricCounterRollUpQuantity(*values)View on GitHub

Bases: StrEnum

Available quantities for MetricCounterRollUp.

PCT_OF_PEAK_SUSTAINED_ACTIVE = 'pct_of_peak_sustained_active'
PCT_OF_PEAK_SUSTAINED_ELAPSED = 'pct_of_peak_sustained_elapsed'
__str__()

Return str(self).

property label: strView on GitHub
reprospect.tools.ncu.metrics.MetricData: TypeAlias = int | float | dict[str, int | float]

A single metric value type or a dictionary of submetric values of such type.

class reprospect.tools.ncu.metrics.MetricDeviceAttribute(name: str)View on GitHub

Bases: object

ncu device attribute metric, such as:

device__attribute_architecture

Note

Available device attribute metrics can be queryied with:

ncu --query-metrics-collection=device
__init__(name: str) None
property full_name: strView on GitHub
gather() tuple[str]View on GitHub
labels() tuple[str]View on GitHub
name: str
class reprospect.tools.ncu.metrics.MetricRatio(name: str, pretty_name: str | None = None, subs: tuple[str | tuple[str, ...], ...] | None = None)View on GitHub

Bases: Metric

A ratio metric.

The sub-metric names are expected to be from MetricRatioRollUp.

References:

SILENT_SUBS: ClassVar[frozenset[str]] = frozenset({MetricRatioRollUp.RATIO})

Sub-metric components implied by the metric kind, omitted from labels.

name: Final[str]
pretty_name: Final[str | None]
subs: Final[tuple[tuple[str, ...], ...] | None]
class reprospect.tools.ncu.metrics.MetricRatioRollUp(*values)View on GitHub

Bases: StrEnum

Available roll-ups for MetricRatio.

MAX_RATE = 'max_rate'
PCT = 'pct'
RATIO = 'ratio'
__str__()

Return str(self).

property label: strView on GitHub
class reprospect.tools.ncu.metrics.PipeStage(*values)View on GitHub

Bases: StrEnum

Available pipe stages.

References:

TAG = 't'
TAG_OUTPUT = 't_output'
__str__()

Return str(self).

class reprospect.tools.ncu.metrics.Quantity(*values)View on GitHub

Bases: StrEnum

Available quantities.

References:

INSTRUCTION = 'inst'
REQUEST = 'requests'
SECTOR = 'sectors'
WAVEFRONT = 'wavefronts'
__str__()

Return str(self).

class reprospect.tools.ncu.metrics.Unit(*values)View on GitHub

Bases: StrEnum

Available units.

References:

L1TEX = 'l1tex'
SM = 'sm'
SMSP = 'smsp'
__str__()

Return str(self).

reprospect.tools.ncu.metrics.ValueType: TypeAlias = int | float

A single metric value type.

class reprospect.tools.ncu.metrics.WarpStallView on GitHub

Bases: object

A selection of metrics related to warp stall reasons.

References:

LGThrottleView on GitHub

alias of WarpStallLGThrottle

LongScoreboardView on GitHub

alias of WarpStallLongScoreboard

MIOThrottleView on GitHub

alias of WarpStallMIOThrottle

ShortScoreboardView on GitHub

alias of WarpStallShortScoreboard

class reprospect.tools.ncu.metrics.WarpStallBaseView on GitHub

Bases: object

Base class for factories of warp-stall ratio metrics.

PRETTY_REASON: ClassVar[str]

The stall reason as it appears in the label.

REASON: ClassVar[str]

The stall reason as it appears in the ncu metric name.

TEMPLATE_LABEL: Final[str] = 'Warp stall {reason}'
TEMPLATE_NAME: Final[str] = 'smsp__average_warps_issue_stalled_{reason}_per_issue_active'
classmethod create(*, subs: tuple[MetricRatioRollUp, ...] = (MetricRatioRollUp.RATIO,)) tuple[MetricRatio, ...]View on GitHub
class reprospect.tools.ncu.metrics.WarpStallLGThrottleView on GitHub

Bases: WarpStallBase

Factory of ratio metric smsp__average_warps_issue_stalled_lg_throttle_per_issue_active.

PRETTY_REASON: ClassVar[str] = 'LG throttle'

The stall reason as it appears in the label.

REASON: ClassVar[str] = 'lg_throttle'

The stall reason as it appears in the ncu metric name.

class reprospect.tools.ncu.metrics.WarpStallLongScoreboardView on GitHub

Bases: WarpStallBase

Factory of ratio metric smsp__average_warps_issue_stalled_long_scoreboard_per_issue_active.

PRETTY_REASON: ClassVar[str] = 'long scoreboard'

The stall reason as it appears in the label.

REASON: ClassVar[str] = 'long_scoreboard'

The stall reason as it appears in the ncu metric name.

class reprospect.tools.ncu.metrics.WarpStallMIOThrottleView on GitHub

Bases: WarpStallBase

Factory of ratio metric smsp__average_warps_issue_stalled_mio_throttle_per_issue_active.

PRETTY_REASON: ClassVar[str] = 'MIO throttle'

The stall reason as it appears in the label.

REASON: ClassVar[str] = 'mio_throttle'

The stall reason as it appears in the ncu metric name.

class reprospect.tools.ncu.metrics.WarpStallShortScoreboardView on GitHub

Bases: WarpStallBase

Factory of ratio metric smsp__average_warps_issue_stalled_short_scoreboard_per_issue_active.

PRETTY_REASON: ClassVar[str] = 'short scoreboard'

The stall reason as it appears in the label.

REASON: ClassVar[str] = 'short_scoreboard'

The stall reason as it appears in the ncu metric name.

class reprospect.tools.ncu.metrics.XYZBaseView on GitHub

Bases: object

Base class for factories used to represent a triplet of metrics in x, y and z dimensions.

References:

PREFIX: ClassVar[str]
PRETTY_PREFIX: ClassVar[str | None] = None
classmethod create(dims: Iterable[str] | None = None) tuple[Metric, ...]View on GitHub
reprospect.tools.ncu.metrics.counter_name_from(*, unit: Unit, pipestage: PipeStage | None = None, quantity: Quantity | str, qualifier: str | None = None) strView on GitHub

Based on ncu metrics naming convention:

unit__(subunit?)_(pipestage?)_quantity_(qualifiers?)

References:

reprospect.tools.ncu.metrics.gather(metrics: Iterable[Metric | MetricCorrelation | MetricDeviceAttribute]) tuple[str, ...]View on GitHub

Retrieve all sub-metric names, e.g. to pass them to ncu.

Order follows metrics, then each metric’s subs; parallel to labels().

reprospect.tools.ncu.metrics.labels(metrics: Iterable[Metric | MetricCorrelation | MetricDeviceAttribute]) tuple[str, ...]View on GitHub

Retrieve all sub-metric labels, e.g. to lookup collected data by label.

Order follows metrics, then each metric’s subs; parallel to gather().