rocAL_pybind.amd.rocal.pipeline.Pipeline Class Reference#
rocAL_pybind.amd.rocal.pipeline.Pipeline Class Reference
Pipeline class internally calls RocalCreate which returns context which will have all the info set by the user. More...
Inheritance diagram for rocAL_pybind.amd.rocal.pipeline.Pipeline:
Public Member Functions | |
| def | __init__ (self, batch_size=-1, num_threads=0, device_id=0, seed=1, exec_pipelined=True, prefetch_queue_depth=2, exec_async=True, bytes_per_sample=0, rocal_cpu=False, max_streams=-1, default_cuda_stream_priority=0, tensor_layout=types.NCHW, reverse_channels=False, mean=None, std=None, tensor_dtype=types.FLOAT, output_memory_type=None) |
| def | build (self) |
| Build the pipeline using rocalVerify call. | |
| def | rocal_run (self) |
| Run the pipeline using rocalRun call. | |
| def | define_graph (self) |
| This function is defined by the user to construct the graph of operations for their pipeline. More... | |
| def | get_handle (self) |
| def | copyToExternalTensor (self, array, multiplier, offset, reverse_channels, tensor_format, tensor_dtype, max_roi_height=0, max_roi_width=0) |
| def | get_one_hot_encoded_labels (self, array_ptr, dest_device_type) |
| def | set_outputs (self, *output_list) |
| def | __enter__ (self) |
| def | __exit__ (self, exception_type, exception_value, traceback) |
| def | set_seed (self, seed=0) |
| def | create_int_param (self, value=1) |
| def | create_float_param (self, value=1) |
| def | update_int_param (self, value=1, param=1) |
| def | update_float_param (self, value=1, param=1) |
| def | get_int_value (self, param) |
| def | get_float_value (self, param) |
| def | get_image_name (self, array_len) |
| def | get_image_id (self, array) |
| def | get_bounding_box_count (self) |
| def | get_bounding_box_labels (self) |
| def | get_bounding_box_cords (self) |
| def | get_mask_count (self, array) |
| def | get_mask_coordinates (self, array_count, array) |
| def | get_image_labels (self) |
| def | copy_encoded_boxes_and_lables (self, bbox_array, label_array) |
| def | get_encoded_boxes_and_lables (self, batch_size, num_anchors) |
| def | get_img_sizes (self, array) |
| def | get_roi_img_sizes (self, array) |
| def | get_image_name_length (self, idx) |
| def | get_remaining_images (self) |
| def | rocal_release (self) |
| def | rocal_reset_loaders (self) |
| def | is_empty (self) |
| def | timing_info (self) |
| def | get_matched_indices (self) |
| def | get_output_tensors (self) |
| def | get_last_batch_padded_size (self) |
| def | run (self) |
Detailed Description
Pipeline class internally calls RocalCreate which returns context which will have all the info set by the user.
- Parameters
-
batch_size (int, optional, default = -1) Batch size of the pipeline. Negative values for this parameter are invalid - the default value may only be used with serialized pipeline (the value stored in serialized pipeline is used instead). num_threads (int, optional, default = -1) Number of CPU threads used by the pipeline. Negative values for this parameter are invalid - the default value may only be used with serialized pipeline (the value stored in serialized pipeline is used instead). device_id (int, optional, default = 0) Id of GPU used by the pipeline. Negative values for this parameter are invalid seed (int, optional, default = -1) Seed used for random number generation. Leaving the default value for this parameter results in random seed. exec_pipelined (bool, optional, default = True) Whether to execute the pipeline in a way that enables overlapping CPU and GPU computation, typically resultingin faster execution speed, but larger memory consumption. prefetch_queue_depth (int or {"cpu_size": int, "gpu_size": int}, optional, default = 2) Depth of the executor pipeline. Deeper pipeline makes ROCAL more resistant to uneven execution time of each batch, but it also consumes more memory for internal buffers. Specifying a dict: { "cpu_size": x, "gpu_size": y }instead of an integer will cause the pipeline to use separated queues executor, with buffer queue sizexfor cpu stage andyfor mixed and gpu stages. It is not supported when bothexec_asyncandexec_pipelinedare set toFalse. Executor will buffer cpu and gpu stages separatelly, and will fill the buffer queues when the first :meth:amd.rocal.pipeline.Pipeline.runis issued.exec_async (bool, optional, default = True) Whether to execute the pipeline asynchronously. his makes :meth: amd.rocal.pipeline.Pipeline.runmethod run asynchronously with respect to the calling Python thread.bytes_per_sample (int, optional, default = 0) A hint for ROCAL for how much memory to use for its tensors. rocal_cpu (bool, optional, default = False) Whether to use CPU or GPU for the pipeline max_streams (int, optional, default = -1) Limit the number of HIP streams used by the executor. Value of -1 does not impose a limit. This parameter is currently unused (and behavior of unrestricted number of streams is assumed). default_cuda_stream_priority (int, optional, default = 0) HIP stream priority used by ROCAL. See cudaStreamCreateWithPriorityin HIP documentationtensor_layout (int, optional, default = 0) Tensor layout used for the augmentations reverse_channels (int, optional, default = 0) Whether to reverse channels for the output tensors mean (int, optional, default = 0) Mean value used for the image normalization std (int, optional, default = 0) Standard deviation value used for the image normalization tensor_dtype (int, optional, default = 0) Tensor datatype used for the pipeline output_memory_type (int, optional, default = 0) Output memory type used for the output tensors
.
Args: batch_size
rocal_cpu
gpu_id (default 0)
cpu_threads (default 1)
This returns a context Member Function Documentation
◆ define_graph()
| def rocAL_pybind.amd.rocal.pipeline.Pipeline.define_graph | ( | self | ) |
This function is defined by the user to construct the graph of operations for their pipeline.
It returns a list of outputs created by calling ROCAL Operators.
◆ run()
| def rocAL_pybind.amd.rocal.pipeline.Pipeline.run | ( | self | ) |
It raises StopIteration if data set reached its end. return: :return: A list of `rocalTensorList` objects for respective pipeline outputs.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/docs-6.3.1/rocAL_pybind/amd/rocal/pipeline.py