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(*, unit: Unit = Unit.SMSP, mode: Literal['sass'] | None = 'sass', subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) MetricCounterView 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,)) MetricCounterView 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,)) MetricCounterView 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,)) MetricCounterView 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) MetricCounterView 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,)) MetricCounterView on GitHub
class reprospect.tools.ncu.metrics.L1TEXCacheGlobalStoreView on GitHub

Bases: object

InstructionsView on GitHub

alias of L1TEXCacheGlobalStoreInstructions

NAME: Final[str] = 'global store'
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(*, unit: Unit = Unit.SMSP, mode: Literal['sass'] | None = 'sass', subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) MetricCounterView 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,)) MetricCounterView 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(*, unit: Unit = Unit.SMSP, mode: Literal['sass'] | None = 'sass', subs: tuple[MetricCounterRollUp, ...] = (MetricCounterRollUp.SUM,)) MetricCounterView 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_'
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_'
class reprospect.tools.ncu.metrics.Metric(name: str, pretty_name: str | None = None, subs: 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:

__init__(name: str, pretty_name: str | None = None, subs: tuple[str, ...] | None = None) None
gather() tuple[str, ...]View on GitHub

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

name: str

The base name of the metric.

pretty_name: str | None

Human readable name.

subs: tuple[str, ...] | None

Optional sub-metric names.

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
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, ...] | None = None)View on GitHub

Bases: Metric

A counter metric.

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

References:

__init__(name: str, pretty_name: str | None = None, subs: tuple[str, ...] | None = None) 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).

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
name: str
class reprospect.tools.ncu.metrics.MetricRatio(name: str, pretty_name: str | None = None, subs: tuple[str, ...] | None = None)View on GitHub

Bases: Metric

A ratio metric.

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

References:

__init__(name: str, pretty_name: str | None = None, subs: tuple[str, ...] | None = None) 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).

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.XYZBaseView on GitHub

Bases: object

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

References:

classmethod create(dims: Iterable[str] | None = None) Iterable[Metric]View on GitHub
prefix: ClassVar[str]
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.