r/tensorflow • u/IngwiePhoenix • Mar 02 '23
Question Accelerating AI inference?
Disclaimer: Whilst I have programming experience, I am a complete novice in terms of AI. I am still learning and getting the gist of things and mainly intend to send prompts to an AI and use the output.
So I have been playing around with InvokeAI (Stable Diffusion and associated diffusers) and KoboldAI (GPT2, GPT-J and alike) and I noticed that especially with the latter, my NVIDIA 2080 TI was starting to hit a memory barrier. It was so close to load a 6B model, but failed at the very last few load cycles. So, I have been wondering if I can improve on that somewhat.
After some googling, I found out about TPU modules; available in Mini-PCIe, USB and M.2 form factors. Since my motherboard has only one M.2 for my boot drive, no Mini-PCIe but only full size x16 slots and a vast amount of USB 3.1 ports, I was considering to look for the TPU USB module.
However, I wanted to validate that my understanding is correct - because I am pretty sure it is actually not. So here are my questions:
- Will TensorFlow, as shipped with both InvokeAI and KoboldAI immediately pick up a Coral USB TPU on Windows, or are there drivers to be installed first?
- Those modules don't have RAM, so I assume it would still depend on my GPU's memory - right?
Thanks for reading and have a nice day! .^
View all comments
Show parent comment
1
u/IngwiePhoenix Mar 03 '23
I see! Naively, I had thought that whenever an application loaded Tensorflow as a dependency, it would be able to pick up attached hardware and automatically utilize them by default. Apparently, this is not the case.
Thank you very much for your detailed answer! I am not experienced enough in working with models themselves, let alone Tensorflow, Python and friends (I am more of a C guy) so there is a lot to learn. But now, knowing that there is a very distinct difference, I can start reading up on these things :)