MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / nvtx_range_debug

Function nvtx_range_debug

tensorrt_llm/_utils.py:922–946  ·  view source on GitHub ↗

Creates an NVTX range annotation for debugging purposes. Similar to nvtx_range, but only creates the range if specific environment variables are set, making it suitable for debug profiling. Args: msg (str): The message/name for the NVTX range. color (str, optional)

(msg: str,
                     color: str = "grey",
                     domain: str = "TensorRT-LLM",
                     category: Optional[str] = None)

Source from the content-addressed store, hash-verified

920
921
922def nvtx_range_debug(msg: str,
923 color: str = "grey",
924 domain: str = "TensorRT-LLM",
925 category: Optional[str] = None):
926 """
927 Creates an NVTX range annotation for debugging purposes.
928
929 Similar to nvtx_range, but only creates the range if specific environment
930 variables are set, making it suitable for debug profiling.
931
932 Args:
933 msg (str): The message/name for the NVTX range.
934 color (str, optional): The color to use for the range in the profiler. Defaults to "grey".
935 domain (str, optional): The domain name for the range. Defaults to "TensorRT-LLM".
936 category (str, optional): The category for the range. Defaults to None.
937
938 Returns:
939 contextmanager: A context manager that either marks the NVTX range if enabled,
940 or a null context manager that does nothing if disabled.
941 """
942 if os.getenv("TLLM_LLMAPI_ENABLE_NVTX", "0") == "1" or \
943 os.getenv("TLLM_NVTX_DEBUG", "0") == "1":
944 return nvtx_range(msg, color=color, domain=domain, category=category)
945 else:
946 return _null_context_manager()
947
948
949def nvtx_mark_debug(msg: str,

Callers 14

submitMethod · 0.90
_response_readerMethod · 0.90
generate_asyncMethod · 0.85
__call__Method · 0.85
_handle_inputMethod · 0.85
submitMethod · 0.85
putMethod · 0.85
put_noblockMethod · 0.85
submitMethod · 0.85
fetch_responsesMethod · 0.85
__call__Method · 0.85

Calls 2

nvtx_rangeFunction · 0.85
_null_context_managerFunction · 0.85

Tested by

no test coverage detected