Hello,
FYI, I’m currently using Unity Sentis 2.1.2 on Unity 6000.
I have a model that runs entirely on the GPU, and one of its outputs is a refined version of an input tensor. This refined tensor is critical because I intend to use it as an input for the next inference cycle. However, when the model worker is re-scheduled for a new inference, the output tensor managed by the worker is overwritten, which means I lose the refined data I need.
What I want is to preserve that refined tensor by making a copy of it on the GPU. This copy should remain on the GPU without being downloaded to the CPU, since all processing will continue on the GPU. The idea is to have a dedicated GPU tensor that holds the refined output so that it can be reused as input in subsequent inferences, without interference from the worker’s internal management.
Currently, I am using a coroutine that waits until each tensor’s ReadbackRequest is complete. However, ReadbackRequest() is designed to download the data to the CPU and may alter the tensor’s internal backend state. This is not acceptable for my use case because I want to avoid any data transfers to the CPU, as all operations are meant to be performed on the GPU.
Ideally, I need an asynchronous GPU-to-GPU copy operation. This method should signal when the copy is complete without blocking the main thread, allowing me to schedule the next inference while keeping a preserved copy of the refined tensor on the GPU.
Is such a thing possible ? It might be written in the documentations when I couldn’t find something that doesn’t involve writing in the CPU as I want to keep everything in the GPU.
Thank you in advance,
Matteo