What is our primary use case?
There have been a couple of use cases. Firstly, we use it for generative AI, specifically a style transfer kind of use case.
The other use involves building classifiers over video streams. So, it's mostly classification as well as severity-related use cases.
How has it helped my organization?
What is most valuable?
The best feature is that it allows us to do batched mode, distributed data parallelism, and model parallelism. This enables distributed training, and the overall API interface is quite simpler compared to a data flow API.
It makes sense both when using it yourself and when teaching it to more junior team members. It's much easier to discuss.
Additionally, high-level APIs like Hugging Face simplify building on top of PyTorch. If you want to do things from scratch, the relative learning curve is simpler compared to Tensorflow, but beginners still need some help.
What needs improvement?
PyTorch could make certain things more obvious. Even though it does make things like defining loss functions and calculating gradients in backward propagation clear, these concepts may confuse beginners. We find that it's kind of problematic. Despite having methods called on loss functions during backward passes, the oral documentation for beginners is quite complex.
So, it is somewhat complicated for a beginner to learn how to use PyTorch.
If you refer to the original documentation, there are numerous examples. And as PyTorch has become very popular compared to Tensorflow in the last couple of years, there are many resources available, making it easier for us to adopt.
For how long have I used the solution?
I have been using PyTorch for three years.
What do I think about the stability of the solution?
It is quite a stable product, and it's consistent across the board.
What do I think about the scalability of the solution?
It's scalable. As far as my experience goes, it's been pretty scalable in terms of using multiple GPUs.
We've been able to take code from open-source, modify it, and tweak it to our liking on the PyTorch side.
TensorFlow has a lot of baggage... like the technical debt from the transition between TensorFlow 1 and 2. It would be a big challenge if the models we find are built on TensorFlow 1. PyTorch has this consistency, which is quite good. So, it's stable and scalable as well.
We are a team of about 12 data scientists, and at least 95% of us use PyTorch.
Which solution did I use previously and why did I switch?
Before PyTorch, my company was using TensorFlow 1.
When we wanted to accelerate our delivery, we found that a lot of research papers and models were built on PyTorch. We could use and replicate them well because researchers were open-sourcing them on PyTorch.
Also, the interface is simpler compared to TensorFlow. Keras made things simple for TensorFlow 1, but TensorFlow 2 integrated Keras, which has its complexities. PyTorch has been very consistent, so we discussed it internally and decided to go with PyTorch.
PyTorch's framework is quite good, and it's always improving. Recently, I've looked at a few frameworks: JAX, TensorFlow, and PyTorch. Since we are in the services industry, we need to deliver, and we don't always have the time to deeply explore the low-level development of neural networks.
JAX is very low-level, giving you lots of control over vectors and similar, a bit too detailed for us. The other two are from Google, and PyTorch, which has ties to the fast.ai community, has APIs that are much more understandable across the board, especially for PyTorch users.
PyTorch's Dynamic Computation Graph is a bit more nuanced because we don't have an apples-to-apples comparison between developing the same model on PyTorch versus TensorFlow.
However, PyTorch makes things easier to write – code readability and maintainability are big factors in data science. When we transfer data science code into the training server and beyond, PyTorch's dynamic graph and training setup make things easier and scalable.
How was the initial setup?
The initial deployment is difficult, especially setting up a CPU version because my company currently works with Windows systems. We utilize the Windows Subsystem for Linux, and that kind of setup makes things a little bit complicated overall.
If you have Windows OS and you're not using a GPU, then finding the right installation package will require some workarounds and research.
We deployed it on the cloud, both AWS and Azure.
What's my experience with pricing, setup cost, and licensing?
What other advice do I have?
I would recommend using this solution. However, there are two tips I would like to add.
- Firstly, get a good book. One of my recommendations would be "Deep Learning with PyTorch". It's a really good book that I enjoyed. It goes into developing neural networks and other advanced analytics use cases from scratch using PyTorch.
- The other tip would be to look at PyTorch Lightning. It has a great API and adds nice definitions and code restructuring, allowing you to do things like distributed training much more easily across a GPU cluster.
Overall, I would rate the solution a seven out of ten because things are just getting better. Just recently, the team behind PyTorch Lightning (which is separate from the main PyTorch team) released PyTorch Lightning Studio.
It makes the transition between training in distributed settings, utilizing client GPUs, and deployment/inference much more seamless. Nothing like that exists for TensorFlow, as far as I understand.
A lot of researchers also prefer PyTorch, which is great because many new architectures that we might need to implement, study, or tinker with can be found as open-source code. We can try to build them using PyTorch and compare them to our own implementations.
This gives us a baseline and reduces friction compared to understanding research and open-source code written in TensorFlow and then trying to implement it in PyTorch.
Given these three things – research support, PyTorch Lightning simplifying things, and the platform I'm excited about, along with consistency and good resources – that's why I give PyTorch a high seven.
Which deployment model are you using for this solution?
Public Cloud