taichi.profiler.kernelmetrics
¶
Module Contents¶
Classes¶
A class to add CUPTI metric for |
Functions¶
|
Attributes¶
- 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 funcset_kernel_profile_metrics()
andcollect_kernel_profile_metrics()
.- Parameters
name (str) – name of metric that collected by CUPTI toolkit. used by
set_kernel_profile_metrics()
andcollect_kernel_profile_metrics()
.header (str) – column header of this metric, used by
print_kernel_profile_info()
.val_format (str) – format for print metric value (and unit of this value), used by
print_kernel_profile_info()
.scale (float) – scale of metric value, used by
print_kernel_profile_info()
.
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.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.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¶