nsight.annotate#
- class nsight.annotate(name: str, ignore_failures: bool = False)#
Bases:
annotateA decorator/context-manager hybrid for marking profiling regions. The encapsulated code will be profiled and associated with an NVTX range of the given annotate name.
Example usage:
# as context manager with nsight.annotate("name"): # your kernel launch here # as decorator @nsight.annotate("name") def your_kernel_launcher(...): ...
- Parameters:
name (
str) – Name of the annotation to be used for profiling.ignore_failures (
bool) – Flag indicating whether to ignore failures in the annotate context. If set toTrue, any exceptions raised within the context will be ignored, and the profiling will continue. The measured metric for this run will be set to NaN. Default:False
Note
All annotations are created under the NVTX domain
"nsight-python". This domain is used internally to filter and identify Nsight Python annotations in profiling tools.Note
Nested annotations are currently not supported. However, since each annotation is expected to contain a single kernel launch by default, nested annotations should not be necessary in typical usage scenarios.