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

Method _init

tensorrt_llm/runtime/session.py:90–102  ·  view source on GitHub ↗

@brief: Setup TensorRT engines and context from a serialized engine file @param engine_buffer: a buffer holds the serialized TRT engine

(self, engine_buffer=None)

Source from the content-addressed store, hash-verified

88 pass
89
90 def _init(self, engine_buffer=None):
91 '''
92 @brief: Setup TensorRT engines and context from a serialized engine file
93 @param engine_buffer: a buffer holds the serialized TRT engine
94 '''
95 self._runtime = trt.Runtime(logger.trt_logger)
96 if engine_buffer is not None:
97 self._engine = self.runtime.deserialize_cuda_engine(engine_buffer)
98
99 self._context = None
100 if not self.engine.streamable_weights_size:
101 self.__prepare_execution_contexts()
102 return self
103
104 def __prepare_execution_contexts(self):
105 self._context = self.engine.create_execution_context()

Callers 2

from_engineMethod · 0.95

Calls 1

Tested by

no test coverage detected