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

Function customized_gc_thresholds

tensorrt_llm/_utils.py:879–892  ·  view source on GitHub ↗
(gen0_threshold: Optional[int] = None)

Source from the content-addressed store, hash-verified

877
878@contextmanager
879def customized_gc_thresholds(gen0_threshold: Optional[int] = None):
880 try:
881 if gen0_threshold:
882 gc.set_threshold(gen0_threshold)
883 logger.debug(
884 f'Set Python GC threshold to customized value: {gen0_threshold}'
885 )
886 yield
887 finally:
888 if gen0_threshold:
889 gc.set_threshold(*PYTHON_DEFAULT_GC_THRESHOLDS)
890 logger.debug(
891 f'Reset Python GC thresholds to default value: {PYTHON_DEFAULT_GC_THRESHOLDS}'
892 )
893
894
895@contextmanager

Callers 3

_event_loop_wrapperMethod · 0.90
_response_readerMethod · 0.90
dispatch_result_taskMethod · 0.85

Calls 1

debugMethod · 0.45

Tested by

no test coverage detected