trtutils.parallel package¶
Subpackages¶
- trtutils.parallel.image package
- Module contents
- Classes
EngineInfoEngineInfo.engine_pathEngineInfo.detector_classEngineInfo.dla_coreEngineInfo.input_rangeEngineInfo.preprocessorEngineInfo.resize_methodEngineInfo.conf_thresEngineInfo.nms_iou_thresEngineInfo.meanEngineInfo.stdEngineInfo.input_schemaEngineInfo.output_schemaEngineInfo.backendEngineInfo.warmupEngineInfo.pagelocked_memEngineInfo.unified_memEngineInfo.cuda_graphEngineInfo.extra_nmsEngineInfo.agnostic_nms
ParallelDetectorParallelDetector.modelsParallelDetector.get_model()ParallelDetector.get_model_profiling()ParallelDetector.get_profiling()ParallelDetector.stop()ParallelDetector.preprocess()ParallelDetector.preprocess_model()ParallelDetector.postprocess()ParallelDetector.postprocess_model()ParallelDetector.get_detections()ParallelDetector.get_detections_model()ParallelDetector.submit()ParallelDetector.submit_model()ParallelDetector.get_random_input()ParallelDetector.mock_submit()ParallelDetector.retrieve()ParallelDetector.retrieve_model()ParallelDetector.end2end()
- Module contents
Module contents¶
Parallel implementations of TensorRT engines and models.
Submodules¶
imageParallel implementations of image models.
Classes¶
QueuedTRTEngineA class for running a TRTEngine in a separate thread asynchronously.
ParallelTRTEnginesA class for running many TRTEngines in parallel.
- class trtutils.parallel.ParallelTRTEngines(engines: Sequence[TRTEngine | Path | str | tuple[TRTEngine | Path | str, int] | tuple[TRTEngine | Path | str, int | None, int | None]], warmup_iterations: int = 5, *, warmup: bool | None = None, cuda_graph: bool | None = None)[source]¶
Bases:
objectHandle many TRTEngines in parallel.
- get_random_input(*, new: bool | None = None) list[list[np.ndarray]][source]¶
Get a random input to the underlying TRTEngines.
- submit(inputs: list[list[np.ndarray]]) None[source]¶
Submit data to be processed by the engines.
- Parameters:
inputs (list[list[np.ndarray]]) – The inputs to pass to the engines. Should be a list of the same lenght of engines created.
- Raises:
ValueError – If the inputs are not the same size as the engines.
- class trtutils.parallel.QueuedTRTEngine(engine: TRTEngine | Path | str, warmup_iterations: int = 5, dla_core: int | None = None, device: int | None = None, *, warmup: bool | None = None, cuda_graph: bool | None = None)[source]¶
Bases:
objectInteract with TRTEngine over Thread and Queue.
- property input_spec: list[tuple[list[int], np.dtype]]¶
Get the specs for the input tensor of the network. Useful to prepare memory allocations.
- property input_dtypes: list[np.dtype]¶
Get the datatypes for the input tensors of the network.
- Returns:
A list with the datatype of each input tensor.
- Return type:
list[np.dtype]
- property output_spec: list[tuple[list[int], np.dtype]]¶
Get the specs for the output tensor of the network. Useful to prepare memory allocations.
- property output_shapes: list[tuple[int, ...]]¶
Get the shapes for the output tensors of the network.
- property output_dtypes: list[np.dtype]¶
Get the datatypes for the output tensors of the network.
- Returns:
A list with the datatype of each output tensor.
- Return type:
list[np.dtype]
- get_random_input(*, new: bool | None = None) list[np.ndarray][source]¶
Get a random input to the underlying TRTEngine.