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

Function disable_debug

tensorrt_llm/_torch/debug/debug_hook.py:246–261  ·  view source on GitHub ↗

The function style to interface to disable debugger on model.

()

Source from the content-addressed store, hash-verified

244
245
246def disable_debug():
247 """
248 The function style to interface to disable debugger on model.
249 """
250 debug_ctx = get_current_debug_ctx()
251 assert debug_ctx is not None, "DebugContext shall be None when enable debugger context."
252 debug_ctx.clear_state()
253 for _, handler in debug_ctx.forward_hook_handles.items():
254 handler.remove()
255
256 for _, handler in debug_ctx.forward_pre_hook_handles.items():
257 handler.remove()
258
259 debug_ctx.forward_hook_handles.clear()
260 debug_ctx.forward_pre_hook_handles.clear()
261 set_current_debug_ctx(None)
262
263
264@contextmanager

Callers 1

debug_modeFunction · 0.85

Calls 5

get_current_debug_ctxFunction · 0.85
set_current_debug_ctxFunction · 0.85
clear_stateMethod · 0.80
removeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected