MITB Banner

Flashlight: Facebook Launches ML Library Built On C++

Deep and ML frameworks are good at what they do — but altering the internals of these frameworks has traditionally proved difficult.

Share

Illustration by Mark Zuckerberg, founder and chief executive officer of Facebook Inc., speaks during the Facebook F8 Developers Conference in San Francisco, California, U.S., on Tuesday, April 12, 2016. Zuckerberg outlined a 10-year plan to alter the way people interact with each other and the brands that keep advertising dollars rolling at the world's largest social network. Photographer: Michael Short/Bloomberg via Getty Images

Earlier this month, Facebook AI launched an open-source machine learning library called Flashlight that lets developers and researchers execute AI/ML applications seamlessly via C++ API. The library is currently available on Github

Facebook AI said its machine learning library is intuitive and simple to use as it contains only the most basic building blocks needed for research. Further, it claimed that it takes seconds to rebuild the entire library and training machine learning pipelines.

“Deep and ML frameworks are good at what they do — but altering the internals of these frameworks has traditionally proved difficult. Finding the right code to change is time-consuming and error-prone, as low-level internals can be unintentionally obfuscated closed-source or hand-tuned for particular purposes. And once you have made changes, recompiling the framework afterwards is both time-and compute-intensive,” said Facebook Artificial Intelligence Research (FAIR) in its blog post.

Like dlib, mlpack and Shogun, Flashlight is also written in modern C++. It has an incredibly low framework overhead, as modern C++ enables parallelism and speed. In addition to this, it also provides simple bridges to integrate code from low-level domain-specific languages and libraries.

Other packages C++ supports includes Tensorflow for deep learning, Microsoft Cognitive Toolkit (CNTK) for deep learning; OpenCV for computer vision; and DyNet and FANN for neural networks.

Tech experts believe C++ has its limitations as it is very syntax oriented. In comparison, Python or R, C++ are beginner-friendly, and there is plenty of library support.

Source: Facebook

While modern C++ eliminates the need for tasks like memory management for providing powerful tools for functional programming, Flashlight claims to support research in C++ with no external figures or bindings to perform tasks such as threading, memory mapping, or interoperating with low-level hardware. Ergo, integrating fast, parallel code becomes direct and straightforward.

Source: Facebook 

“We are open-sourcing Flashlight to make for the AI community to tinker with the low-level code underpinning deep and ML frameworks, taking better advantage of the hardware at hand and pushing the limits of performance,” said Jacob Kahn, a research engineer at FAIR.

Before this, Facebook AI has introduced a new dataset called Casual Conversations to check the robustness of AI models across four primary dimensions — age, gender, skin type and lighting. 

Under the hood

Facebook AI said Flashlight is developed on top of a shallow stack of basic abstractions that are modular and easy to use. For this, it has used an ArrayFire tensor library, which supports dynamic tensor shapes and types, thereby removing the need for rigid compile-time specifications and C++ templates. Besides this, ArrayFire helps in optimising operations with an efficient just-in-time compiler.

Flashlight also includes custom, tunable memory managers and APIs for distributed and mixed-precision training. In addition to this, Flashlight also features modular abstractions for working with data and training at scale, combined with a fast, lightweight Autograd. “These components are built to support general research directions, whether in deep learning or elsewhere,” said Kahn. 

Flashlight applications 

Flashlight-based lightweight domain applications (as shown below) support research across various modalities, including speech recognition, language modelling and image classification and image segmentation — all in one codebase.

Share
Picture of Amit Raja Naik

Amit Raja Naik

Amit Raja Naik is a seasoned technology journalist who covers everything from data science to machine learning and artificial intelligence for Analytics India Magazine, where he examines the trends, challenges, ideas, and transformations across the 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.