taichi.profiler.kernelmetrics

Module Contents

Classes

CuptiMetric

A class to add CUPTI metric for KernelProfiler.

Functions

get_predefined_cupti_metrics(name='')

Attributes

dram_utilization

dram_bytes_sum

dram_bytes_throughput

dram_bytes_read

dram_read_throughput

dram_bytes_write

dram_write_throughput

shared_utilization

shared_transactions_load

shared_transactions_store

shared_bank_conflicts_store

shared_bank_conflicts_load

global_op_atom

global_op_reduction

sm_throughput

dram_throughput

l1tex_throughput

l2_throughput

l1_hit_rate

l2_hit_rate

achieved_occupancy

global_access

shared_access

atomic_access

cache_hit_rate

device_utilization

predefined_cupti_metrics

default_cupti_metrics

class taichi.profiler.kernelmetrics.CuptiMetric(name='', header='unnamed_header', val_format='     {:8.0f} ', scale=1.0)

A class to add CUPTI metric for KernelProfiler.

This class is designed to add user selected CUPTI metrics. Only available for the CUDA backend now, i.e. you need ti.init(kernel_profiler=True, arch=ti.cuda). For usage of this class, see examples in func set_kernel_profile_metrics() and collect_kernel_profile_metrics().

Parameters

Example:

>>> import taichi as ti

>>> ti.init(kernel_profiler=True, arch=ti.cuda)
>>> num_elements = 128*1024*1024

>>> x = ti.field(ti.f32, shape=num_elements)
>>> y = ti.field(ti.f32, shape=())
>>> y[None] = 0

>>> @ti.kernel
>>> def reduction():
>>>     for i in x:
>>>         y[None] += x[i]

>>> global_op_atom = ti.CuptiMetric(
>>>     name='l1tex__t_set_accesses_pipe_lsu_mem_global_op_atom.sum',
>>>     header=' global.atom ',
>>>     val_format='    {:8.0f} ')

>>> # add and set user defined metrics
>>> profiling_metrics = ti.get_predefined_cupti_metrics('global_access') + [global_op_atom]
>>> ti.set_kernel_profile_metrics(profiling_metrics)

>>> for i in range(16):
>>>     reduction()
>>> ti.print_kernel_profile_info('trace')

Note

For details about using CUPTI in Taichi, please visit https://docs.taichi.graphics/docs/lang/articles/misc/profiler#advanced-mode.

taichi.profiler.kernelmetrics.dram_utilization
taichi.profiler.kernelmetrics.dram_bytes_sum
taichi.profiler.kernelmetrics.dram_bytes_throughput
taichi.profiler.kernelmetrics.dram_bytes_read
taichi.profiler.kernelmetrics.dram_read_throughput
taichi.profiler.kernelmetrics.dram_bytes_write
taichi.profiler.kernelmetrics.dram_write_throughput
taichi.profiler.kernelmetrics.shared_utilization
taichi.profiler.kernelmetrics.shared_transactions_load
taichi.profiler.kernelmetrics.shared_transactions_store
taichi.profiler.kernelmetrics.shared_bank_conflicts_store
taichi.profiler.kernelmetrics.shared_bank_conflicts_load
taichi.profiler.kernelmetrics.global_op_atom
taichi.profiler.kernelmetrics.global_op_reduction
taichi.profiler.kernelmetrics.sm_throughput
taichi.profiler.kernelmetrics.dram_throughput
taichi.profiler.kernelmetrics.l1tex_throughput
taichi.profiler.kernelmetrics.l2_throughput
taichi.profiler.kernelmetrics.l1_hit_rate
taichi.profiler.kernelmetrics.l2_hit_rate
taichi.profiler.kernelmetrics.achieved_occupancy
taichi.profiler.kernelmetrics.global_access
taichi.profiler.kernelmetrics.shared_access
taichi.profiler.kernelmetrics.atomic_access
taichi.profiler.kernelmetrics.cache_hit_rate
taichi.profiler.kernelmetrics.device_utilization
taichi.profiler.kernelmetrics.predefined_cupti_metrics
taichi.profiler.kernelmetrics.get_predefined_cupti_metrics(name='')
taichi.profiler.kernelmetrics.default_cupti_metrics