GPU Accelerating Node.js JavaScript for Visualization and Beyond

Introducing node-RAPIDS

Allan Enemark
RAPIDS AI
5 min readJul 8, 2021

--

Authors: Allan Enemark, Ajay Thorve, paul taylor, Bryan Van de Ven

NVIDIA GTC21 had a lot of great and engaging content, especially around RAPIDS, so it would be easy to miss our debut presentation, “Using RAPIDS to Accelerate Node.js JavaScript for Visualization and Beyond.” Yep — we are bringing the power of GPU-accelerated data science to the JavaScript Node.js community with the node-RAPIDS project.

node-RAPIDS is an open-source, technical preview of modular RAPIDS’ library bindings in Node.js, as well as complementary methods for enabling high-performance, server-side visualizations and analytics.

What are some problems with web viz today?

Around a decade ago, the mini-renaissance around web-based data visualization showed the benefits of highly interactive and easy-to-share and use tools such as D3. While not as performant as C/C++ or Python frameworks, their popularity took off because of JavaScript’s accessibility. No surprise that JavaScript often ranks as the most popular developer language, above Python or Java, and there is now a full catalog of visualization and data tools.

Yet, this large JavaScript community of developers is impeded by the lack of first-class and accelerated data tools in their preferred language. Analysis is most effective when it is paired as close as possible to its data source, science, and visualizations. To fully access GPU hardware with JavaScript (beyond webGL limitations and hacks) requires being a polyglot to set up complicated middleware plumbing or use non-js frameworks like Plotly Dash. As a result, data engineers, data scientists, visualization specialists, and front-end developers are often siloed, even within organizations. This is detrimental because data visualization is the ideal medium of communication between these groups.

As for the RAPIDS Viz team, ever since our first proof of concept, we’ve wanted to build tools that can more seamlessly interact with hundreds of millions of data points in real-time through our browsers — and we finally have a way.

Why Node.js?

If you are not familiar with Node.js, it is an open-source, cross-platform runtime environment based on C/C++ that executes JavaScript code outside of a web browser. Over 1 Million Node.js downloads occur per day. Node Package Manager (NPM) is the default JavaScript package manager and is owned by Microsoft. Node.js is used in the backend of online marketplaces like eBay, AliExpress and is used by high-traffic websites, such as Netflix, PayPal, and Groupon. Clearly, it’s a powerful framework.

XKCD — Node.js is a Universal Connector

Node.js is the connector that gives us JavaScript with direct access to hardware, which results in a streamlined API and the ability to utilize NVIDIA CUDA ⚡. By creating node-rapids bindings, we enable a massive developer community with the ability to use GPU acceleration without the need to learn a new language or work in a new environment. We also give the same community access to a high-performance data science platform: RAPIDS!

Here is a snippet of node-RAPIDS in action based on our basic notebook, which shows a 6x speedup for a small regex example:

Node-RAPIDS: designed as building blocks

Similar to node projects, Node-RAPIDS is designed to be modular. Our aim is not to build turn-key web applications but to create an inventory of functionality that enables or accelerates a wide variety of use cases and pipelines. The above is an overview of the current and planned Node-RAPIDS modules grouped in general categories. A Node-RAPIDS application can use as many or as few of the modules as needed.

Node-RAPIDS module overview

To make starting out less daunting, we are also building a catalog of demos that can serve as templates for generalized applications. As we develop more bindings, we will create more demos to showcase their capabilities.

Cross Filter App Example:

Example of a Cross Filter App

The above is an idealized stack of a geospatial cross filter dashboard application using RAPIDS cuDF and RAPIDS cuSpatial libraries. We have a simple demo using Deck.gl that you can preview with our video and explore demo code on Github.

Server Side ETL Example:

Example of Streaming ETL Process

The last example above is a server-side only ETL pipeline without any visualization. We have an example of a straightforward ETL process using cuDF bindings and the nteract notebook desktop application, which you can preview with our video and nteract with (get it) on our notebook.

What’s Next?

While we have been thinking about this project for a while, we are just getting started in development. RAPIDS is an incredible framework, and we want to bring it to more people and more applications — RAPIDS everywhere, as we say.

Near-term next steps:

  • Continue building core RAPIDS binding features, which you can check out on our current binding coverage table.
  • If the idea of GPU accelerated SQL queries straight from your web app sounds interesting (it does to us), we hope to get started on blazingSQL bindings soon too.
  • And most noteworthy, we plan to start creating and publishing modular docker containers, which will dramatically simplify the current from-source tech preview installation process.

As always, we need community engagement to help guide us. If you have feature requests, questions, or use cases, please reach out!

This project has a lot of potential. It can accelerate a wide variety of Node.js applications, as well as bring first-class, high-performance data science and visualization tools to a huge community. We hope you join us at the beginning of this exciting project.

Resources:

--

--

Allan Enemark
RAPIDS AI

Curiosity powered designer & sustainability advocate.