MITB Banner

PyTorch’s Glow: Can it Beat TensorFlow’s Flow?

TensorFlow reaches far beyond Python and that is what is keeping it alive—for now.

Share

Listen to this story

PyTorch or TensorFlow—the debate that forges many clashes and wars between developers. Many reports show that PyTorch has become the preferred choice for developers, instead of TensorFlow, which is entirely not true. A glance at the 2022 Developer Survey by Stack Overflow, which had around 60,000 respondents, shows that 12.95% of the people preferred TensorFlow for machine learning, which is 1.5X higher than PyTorch that only 8.61% of the respondents chose. In juxtapose, the Keras framework is rising closer to PyTorch, which was selected by 7.27% of the respondents.

Not just PyTorch, the overall community of TensorFlow developers has also increased by approximately 30% compared to 2021. The same survey suggests that in the ML landscape, 57% of developers use TensorFlow while only 38% use PyTorch. 

Also, TensorFlow has 170K stars on GitHub which is relatively higher than PyTorch, which has 61K stars. This rating for TensorFlow has only witnessed further upward momentum since 2021.

According to Stack Overflow insights, questions about TensorFlow have always been higher than PyTorch, nearly twice. This suggests that people are actively searching and learning TensorFlow more than PyTorch. It has to be noted that measuring the number of questions on Stack Overflow can also be a measurement of the amount of confusion and not necessarily popularity.

Developers’ love for PyTorch 

If we revisit the same Stack Overflow survey and look at the most loved and dreaded frameworks and libraries, 68.2% of the respondents love PyTorch while TensorFlow was loved by 60% of them. The percentage might seem probable given the number of users of the TensorFlow is more, according to the survey.

The problem gets highlighted in the same list. HuggingFace is the most loved library with 72.2% of the respondents voting for it. With HuggingFace, developers can use large, trained, and SOTA models in their pipelines without needing large infrastructures. Developers love it. However, the difference between model availability for TensorFlow and PyTorch is staggering.

In 2022, 45,000 PyTorch exclusive models were added to HuggingFace, whereas only 4,000 new TensorFlow exclusives were added. This resulted in 92% exclusive models on HuggingFace for PyTorch and only 8% of the model being TensorFlow exclusive.

Google, DeepMind love TensorFlow 

Google-backed DeepMind standardised the use of TensorFlow in 2016 and also started using JAX in 2020, which is similar to what Google Brain did. OpenAI has used PyTorch internally since 2020 but as their work in reinforcement learning increased, they relied on their older baselines repository, which is implemented exclusively in TensorFlow. However, these are merely the exceptions.

Earlier, it seemed that Google was dominating the generative and NLP market with softwares like PaLM, LaMDA, and others. But, most of the groundbreaking innovations in recent times are based in PyTorch and developers are now settled around it. Google’s generative models are also being built on JAX, and not TensorFlow.

However, most of the research publications and available models are now using PyTorch and it currently dominates the academic landscape. Looking at the data from Papers With Code, as of December 2022, 62% of the papers were implemented in PyTorch whereas only 4% were for TensorFlow, a decline from 10% in December 2021. This statistic unambiguously shows that the support for TensorFlow is dwindling.

TensorFlow is Not Dead, Yet

Google learned from Meta’s PyTorch and made TensorFlow 2.0, which is better and easier for research than its previous version. Still, researchers have no reason to return to giving TensorFlow another chance. Now, with the second version of PyTorch all set to launch in March, hopes for TensorFlow fall even shorter.

Google developed TensorFlow in 2015, the first framework in the deep learning space. Meta, however, observed and took note of the limitations of the framework and built PyTorch in 2016. Then, the world witnessed the popularity of PyTorch soar. 

To compete, TensorFlow 2.0 was released in 2019 and has been pushing updates regularly. Now, PyTorch 2.0 is expected to release in March 2023. This hustle-bustle has led to a recent surge of firms pushing the “TensorFlow is dead” or “PyTorch has killed TensorFlow” narrative. But it’d be amiss to believe that it is entirely true. 

For ML, hardware developments have been the driving force and NVIDIA’s CUDA had the competitive advantage as they were the only ones in the business. Google was leading the software game but got isolated due to the lack of flexibility and usability when compared to PyTorch.

Now, NVIDIA’s monopoly in the software stack market is breaking with the introduction of OpenAI’s Triton and PyTorch 2.0. More and more applications are now being built using PyTorch and it might outgrow the current deployment infrastructure of TensorFlow. 

Moreover, the introduction and improvements in PyTorch is making it an easier and simpler alternative for people for building machine learning models on Python. Interestingly, PyTorch is often referred to as “Pythony” by developers. This explains its wide adoption, and people shifting to PyTorch (built largely on Python) because it seemed comfortable and easy to use, and has a faster learning curve for new users. 

On the other hand, TensorFlow’s highest usage, according to GitHub, is in C++ language with 63% while Python is only 21%. Even though Python is the most popular language for machine learning, TensorFlow is widely used for C++ and also supports JavaScript and Java while simultaneously expanding for Rust, Scala, along with Julia in development. Suffice to say, TensorFlow is mostly preferred by experts and senior developers who like the flexibility to navigate across programming languages. 

Share
Picture of Mohit Pandey

Mohit Pandey

Mohit dives deep into the AI world to bring out information in simple, explainable, and sometimes funny words. He also holds a keen interest in photography, filmmaking, and the gaming industry.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.