- Experimenting with AsyncGPUReadback
- Links of the Week
Well I would like to say that I have had a super productive month. Unfortunately, I have hardly been able to work on anything at all. At least I’m done with finals now so, hopefully, I’ll be able to make up for it.
Experimenting with AsyncGPUReadback
In preparation for updating the PoseNet tutorial, I took another shot at getting around the performance bottleneck of reading the model output from the GPU. This time, I tried using the
AsyncGPUReadback class. Keijiro Takahashi who works at Unity Technologies Japan had a small demo project on GitHub that I was able to learn from. As the name suggests, it allows you to read data from the GPU without blocking the main thread. I was successfully able to read model output back from the GPU using this method by first copying it to a
RenderTexture. There was essentially no performance cost so I was pretty excited. Unfortunately, this approach does not seem feasible at least for the PoseNet model. The Barracuda library does not seem to support reading model output to a 3-dimensional
RenderTexture. That means the model output needs to be sliced up and read separately. This approach does not scale well and the PoseNet model actually has a lot of outputs. I did go through the effort creating separate slices for each key point predicted by the model. However, there was actually a significant performance hit when reading from the GPU so many times. It would probably work fine for a model with only 2-dimensional outputs or only a few 3-dimensional ones. I’ll have to try it out with a simple image classifier.
Well it’s been just over a month since my first “daily recap” and I have not posted any since. That first week turned out to be rather poor timing, but I don’t have any excuses for the rest of the month. I’m going to try starting fresh tomorrow.
Links of the Week
Well it looks like Keijiro Takahashi beat me to implementing the Facemesh model with the Barracuda library. Looking at his recent projects on GitHub, he appears to be working on implementing every mode from the MediaPipe library. I guess I’ll have to put a bit more effort into my future tutorials on those so that they add something new.
A helpful library that is meant to make life easier when dealing with Pytorch and fastai errors.
A master applying their craft.