Categories
Misc

Accelerating Sequential Python User-Defined Functions with RAPIDS on GPUs for 100X Speedups

Motivation Custom “row-by-row” processing logic (sometimes called sequential User-Defined Functions) is prevalent in ETL workflows. The sequential nature of UDFs makes parallelization on GPUs tricky. This blog post covers how to implement the same UDF logic using RAPIDS to parallelize computation on GPUs and unlock 100x speedups. Introduction Typically, sequential UDFs revolve around records with … Continued

Motivation

Custom “row-by-row” processing logic (sometimes called sequential User-Defined Functions) is prevalent in ETL workflows. The sequential nature of UDFs makes parallelization on GPUs tricky. This blog post covers how to implement the same UDF logic using RAPIDS to parallelize computation on GPUs and unlock 100x speedups.

Introduction

Typically, sequential UDFs revolve around records with the same grouping key. For example, analyzing a user’s clicks per session on a website where a session ends after 30 minutes of inactivity. In Apache Spark, you’d first cluster on user key, and then segregate user sessions using a UDF like in the example below. This UDF uses multiple CPU threads to run sequential functions in parallel.

Running on the GPU with Numba

Dask-CUDA clusters use a single process and thread per GPU, so running a single sequential function won’t work for this model. To run serial functions on the hundreds of CUDA cores available in GPUs, you can take advantage of the following properties:

  • The function can be applied independently across keys.
  • The grouping key has high cardinality (there are a high number of unique keys)

Let’s look at how you can use Numba to transform our sessionization UDF for use on GPUs. Let’s break the algorithm into two parts.

Each cuda  thread does sequential work specific  to session. As we have a lot of sessions and cuda threads  we get a lot of parallelism.

For CPU we have less threads so we get less parallelism.
Figure 1: Comparison b/w execution on CPUs and GPUs for the UDF.

Part 1. Session change flag

With this function, we create session boundaries. This function is embarrassingly parallel so that we can launch threads for each row of the dataframe.

Part 2. Serial logic on a session-level

For session analysis, we have to set a unique session flag across all the rows that belong to that session for each user. This function is serial at the session level, but as we have many sessions (approx 18 M) in each dataframe, we can take advantage of GPU parallelism by launching threads for each session. 

Using these functions with dask-cuDF Dataframe

We invoke the above functions on each partition of a dask-cudf dataframe using a map_partition call. The main logic of the code above is still similar to pure python while providing a lot of speedups. A similar serial function in pure python takes about `17.7s` vs. `14.3 ms` on GPUs. That’s a whopping 100x speedup.

Conclusion

When working with serial user-defined functions that operate on many small groups, transforming the UDF using numba, as shown above, will maximize performance on GPUs. Thus, with the power of numba, Dask, and RAPIDS, you can now supercharge the map-reduce UDF ETL jobs to run at the speed of light.

Want to start using Dask and RAPIDS to analyze big data at the speed of light? Check out the RAPIDS Getting Started webpage, with links to help you download pre-built Docker containers or install directly via Conda.

Categories
Misc

Can tensorflow do like vuforia area targets. Which we train our virtual captured 3D scan data and use it in AR or WebAR?

Can tensorflow do like vuforia area targets. Which we train our virtual captured 3D scan data and use it in AR or WebAR? submitted by /u/hudadong
[visit reddit] [comments]
Categories
Misc

examples of some of the most impressive complex tensorflow applications you’ve seen?

submitted by /u/Bulbasaur2015
[visit reddit] [comments]

Categories
Misc

How to use tensorflow’s FFT?

Hey everyone. I am having some trouble reconciling my FFT results from MATLAB and TF. The results are actually very different. Here is what I have done:

1). I would attach my data file here but didn’t find a way to do so. Anyways, my data is stored in a .mat file, and the variable we will work with is called ‘TD’. In MATLAB, I first subtract the mean of the data, and then perform fft:

f_hat = TD-mean(TD); x = fft(f_hat); 

2). In TF, I use

tf.math.reduce_mean 

to calculate the mean, and it only differs from MATLAB’s mean on the order of 10^-8. So in TF I have:

mean_TD = tf.reduce_mean(TD) f_hat_int = TD - mean_TD f_hat_tf = tf.dtypes.cast(f_hat_int,tf.complex64) x_tf = tf.signal.fft(f_hat_tf) 

So up until ‘f_hat’ and ‘f_hat_tf’, the difference is very slight and is caused only by the difference in the mean. However, x and x_tf are very different. I am wondering did I not use TF’s FFT correctly?

​

Thanks!

https://preview.redd.it/0e6o48jegd351.png?width=560&format=png&auto=webp&s=c782992b54309d31492b6d9c6463079945d9b784

submitted by /u/LivingAd9344
[visit reddit] [comments]

Categories
Misc

Possible to retrain onnx model?

I am trying to use a model built in Pytorch in a project that I am working on and will need to retrain it. Would it be possible for me to somehow retrain the model in TF if I have imported an onnx version of it? It would save alot of time compared to the alternative, porting the whole thing over manually from Pytorch.

submitted by /u/hoagie_friend
[visit reddit] [comments]

Categories
Misc

Trying to conceptualize what a tensor "is"

I am trying to understand what a tensor is and how its properties are useful in machine learning.

I’m looking for feedback on whether I’m on the right track in this journey.

I want to answer why and how a tensor works for classifying, really, anything.

A tensor classifies by its very nature by defining a space. The more dimensions you add to that space the more complex a space you can describe.

Is the act of applying transform rules to a tensor what allows it to describe all the other variations of the concept the tensor is trying to describe? Or is it just transforming the tensor into one of the mirror representations (more on this later)?

A tensor is like a feature. Hotdog is something you can classify using a tensor. The “crispness” of that classification increases as you increase the ranks. The more ranks you add to the tensor the better you can represent what a hotdog is.

Not enough ranks and a nose feature is easily confused as a carrot. Maybe a feature described with a tensor of lower ranks will find it impossible to gain the resolution required to distinguish between a hotdog and a carrot at all.

Is there such a thing as too many ranks? Or does it just become harder and harder to train? Do more ranks increase the possibility of overfitting? I don’t know – but I’d love someone to reason though it.

The permutations of values in the dimensions the object represents must have to have an unimaginable number of mirror representations that would also represent a hotdog That’s why trained models with different values can give the same outcome. Could this be what a transform is doing?

There are even more slightly skewed representations of a hotdog that exist as the values at each dimension are wiggled. But those skews exist, for example, in the visual data because adding a rank of “what is it used for” to the data makes those visual confusions impossible. You would never confuse a hotdog for a flash light if the value of edible was added to the dataset being trained.

One or more of the tensors dimensions would be 99.99999% successful because they would all conclude to use that as the best datapoint.

But visual data doesn’t have such obvious binary data – I mean it’s binary, but it visual data can’t take the district property of:

“1” – edible and “0” – inedible.

Instead the binary nature of the decision exists in a more complex representation between the dimensional values (lol, actually also all the mirrors) – eg you can represent it as:

“0” – edible and “1” – inedible.

Training on data is the process of bumping the values at random until they fall into one of these permutations that’s able answer the question with the desired classification.

Overtraining is when you bump it to only recognize the data itself as the “space”, being the data is the defining binary decision it encodes for – not what the data is trying to embody.

submitted by /u/theregalbeagler
[visit reddit] [comments]

Categories
Misc

Conversational AI and NLP – Top Resources from GTC 21

NVIDIA announced several major breakthroughs in conversational AI for building and deploying ASR, NLP and TTS applications.

At GTC 21, NVIDIA announced several major breakthroughs in conversational AI for building and deploying automatic speech recognition (ASR), natural language processing (NLP), and text-to-speech (TTS) applications. The conference also hosted over 60 engaging sessions and workshops featuring the latest tools, technologies and research in conversational AI and NLP.

The developer resources listed below are exclusively available to NVIDIA Developer Program members. Join today for free in order to get access to the tools and training necessary to build on NVIDIA’s technology platform here. 

On-Demand Sessions

Conversational AI Demystified
Speaker: Meriem Bendris, Senior Solution Architect, NVIDIA

Conversational AI technologies are becoming ubiquitous, with countless products taking advantage of automatic speech recognition, natural language understanding, and speech synthesis coming to market. Thanks to new tools and technologies, developing conversational AI applications is easier than ever, enabling a much broader range of applications, such as virtual assistants, real-time transcription, and many more. We will give an overview of the conversational AI landscape and discuss how any organization can get started developing conversational AI applications today.

Building and Deploying a Custom Conversational AI App with NVIDIA Transfer Learning Toolkit and Jarvis
Speakers: Tripti Singhal, Solutions Architect, NVIDIA; Nikhil Srihari, Technical Marketing Engineer – Deep Learning, NVIDIA; Arun Venkatesan, Product Manager, NVIDIA

Tailoring the deep learning models in a conversational AI pipeline to your enterprise needs is time-consuming. Developing a domain-specific application typically requires several cycles of re-training, fine-tuning, and deploying the model until it satisfies the requirements. NVIDIA Jarvis helps you easily build production-ready conversational AI applications and provides tools for fine-tuning on your domain. In this session, we will walk you through the process of customizing automatic speech recognition and natural language processing pipelines to build a truly customized production-ready Conversational AI application.

Megatron GPT-3 Large Model Inference with Triton and ONNX Runtime
Speaker: Denis Timonin, AI Solutions Architect, NVIDIA

Huge NLP models like Megatron-LM GPT-3, Megatron-LM Bert require tens/hundreds of gigabytes of memory to store their weights or run inference. Frequently, one GPU is not enough for such a task. One way to run inference and maximize throughput of these models is to divide them into smaller sub-parts in the pipeline-parallelism (in-depth) style and run these subparts on multiple GPUs. This method will allow us to use bigger batch size and run inference through an ensemble of subparts in a conveyor manner. TRITON inference server is an open-source inference serving software that lets teams deploy trained AI models from any framework. And this is a perfect tool that allows us to run this ensemble. In this talk, we will take Megatron LM with billions of parameters, convert it in ONNX format, and will learn how to divide it into subparts with the new tool – ONNX-GraphSurgeon. Then, we will use TRITON ensemble API and ONNX runtime background and run this model inference on an NVIDIA DGX.

Blog

Announcing Megatron for Training Trillion Parameter Models and NVIDIA Jarvis Availability
NVIDIA announced Megatron for training giant transformer-based language models and major capabilities in NVIDIA Jarvis for building state-of-the-art interactive conversational AI applications.

Demo

World-Class ASR | Real-Time Machine Translation | Controllable Text-to-Speech
Watch this demo to see Jarvis’ automatic speech recognition (ASR) accuracy when fine-tuned on medical jargon, real-time neural machine translation from English to Spanish and Japanese, and powerful controllability of neural text-to-speech.

New pre-trained models, notebooks, and sample applications for conversational AI are all available to try from the NGC catalog. You can also find tutorials for building and deploying conversational AI applications at the NVIDIA Developer Blog.

Join the NVIDIA Developer Program for all of the latest tools and resources for building with NVIDIA technologies.

Categories
Misc

Healthcare – Top Resources from GTC 21

Here are the latest resources and news for healthcare developers from GTC 21, including demos and specialized sessions for building AI in drug discovery, medical imaging, genomics, and smart hospitals.

Here are the latest resources and news for healthcare developers from GTC 21, including demos and specialized sessions for building AI in drug discovery, medical imaging, genomics, and smart hospitals. Learn about new features now available in NVIDIA Clara Train 4.0, an application framework for medical imaging that includes pre-trained models, AI-assisted annotation, AutoML, and federated learning.

The developer resources listed below are exclusively available to NVIDIA Developer Program members. Join today for free in order to get access to the tools and training necessary to build on NVIDIA’s technology platform here.

On-Demand Sessions

Accelerating Drug Discovery with Advanced Computational Modeling
Speaker: Robert Abel, Executive Vice President, Chief Computational Scientist, Schrödinger

Learn about how integrated deployment and collaborative use of advanced computational modeling and next-generation machine learning can accelerate drug discovery from Robert Abel, Executive Vice President, Chief Computational Scientist at Schrödinger.

Using Ethernet to Stream Medical Sensor Data
Speaker: Mathias Blake, Platform Architect for Medical Devices, NVIDIA

Explore three technologies from NVIDIA that make streaming high-throughput medical sensor data over Ethernet easy and efficient—NVIDIA Networking ConnectX NICs, Rivermax SDK with GPUDirect, and Clara AGX. Learn about the capabilities of each of these technologies and explore examples of how these technologies can be leveraged by several different types of medical devices.

Automate 3D Medical Imaging Segmentation with AutoML and Neural Architecture Search
Speaker: Dong Yang, Applied Research Scientist, NVIDIA

Recently, neural architecture search (NAS) has been applied to automatically search high-performance networks for medical image segmentation. Hear from NVIDIA Applied Research Scientist, Dong Yang, to learn about AutoML and NAS techniques in the Clara Train SDK.

Deep Learning and Accelerated Computing for Single-Cell Genomic Data
Speaker: Avantika Lal, Sr. Scientist in Deep Learning and Genomics, NVIDIA

Learn about accelerating discovery of cell types in the human body with RAPIDS and AtacWorks, a deep learning toolkit to enhance ATAC-seq data and identify active regulatory DNA more accurately than existing state-of-the-art methods.

Blog

Creating Medical Imaging Models with Clara Train 4.0
Learn about the upcoming release of NVIDIA Clara Train 4.0, including infrastructure upgrades based on MONAI, expansion into digital pathology, and updates to DeepGrow for annotating organs effectively in 3D images.

Demos

Accelerating Drug Discovery with Clara Discovery’s MegaMolBart
See how NVIDIA Clara Discovery’s MegaMolBart, a transformer-based NLP model developed with AstraZeneca, trained on millions of molecules, can accelerate the drug discovery process.

NVIDIA Triton Inference Server: Generative Chemical Structures
Watch NVIDIA Triton Inference Server power deep learning models to propose thousands of molecules per second for drug design that can be further refined with physics-based simulations.

Visit NVIDIA On-Demand to explore the extensive catalog of sessions, podcasts, demos, research posters and more.

Categories
Misc

Automotive – Top Resources from GTC 21

The annual DRIVE Developer Days was held during GTC 2021, featuring a series of specialized sessions on AV development led by NVIDIA experts. Learn about perception, mapping, simulation and more anytime with NVIDIA On-Demand.

The annual DRIVE Developer Days was held during GTC 2021, featuring a series of specialized sessions on autonomous vehicle hardware and software, including perception, mapping, simulation and more, all led by NVIDIA experts. These sessions are now available to view anytime with NVIDIA On-Demand.

The developer resources listed below are exclusively available to NVIDIA Developer Program members. Join today for free in order to get access to the tools and training necessary to build on NVIDIA’s technology platform here. 

 

On-Demand Sessions

DRIVE AGX Hardware Update with NVIDIA Orin

Speaker: Gary Hicok, Senior Vice President, Hardware and Systems, NVIDIA

This session will provide an early look at the next generation of DRIVE AGX hardware platforms based on the upcoming NVIDIA Orin SoC.

 

Turbocharge Autonomous Vehicle Development with DRIVE OS and DriveWorks

Speaker: Stephen Jones, Product Line Manager & Hope Allen, Product Manager, DriveWorks, NVIDIA

Learn how NVIDIA DRIVE OS and DriveWorks turbocharge autonomous vehicle development, delivering foundational autonomous tools and functional safety while simultaneously optimizing NVIDIA DRIVE AGX compute performance.

 

DRIVE AV Perception Overview

Speaker: Chongyu Wang, Product Manager

The ability to interpret a scene with 360° awareness is a critical function of an autonomous vehicle. In this session, we highlight the NVIDIA DRIVE AV Perception software stack, including an architecture overview and our latest algorithmic results.

 

Mapping and Localization with DRIVE AV

Speaker: Rambo Jacoby, Principal Product Manager, NVIDIA

The use of HD maps is a key part of ensuring a safe and comfortable journey. In this session, we’ll provide an overview of NVIDIA’s end-to-end solution for creating and maintaining crowdsourced HD maps, and how they’re used for vehicle localization.

 

A Modular Approach to AV Planning and Control

Speaker: Alexey Baranov, Senior Product Manager, NVIDIA

Planning and control executes maneuvers using input from perception, prediction, and mapping. In this session, we review the NVIDIA DRIVE AV modular approach to planning and control software and the variety of capabilities it enables.

 

Leveraging EGX and DGX for Developing AV Platforms and Supporting Connected Services

Speaker: Rambo Jacoby, Principal Product Manager, NVIDIA

In this session, we look at how NVIDIA DGX and NVIDIA EGX and are used to create the network of data centers and edge devices necessary for developing an AV platform and delivering functionality and connected services to vehicles of the future.

 

Automated Testing at Scale to Enable Deployment of Autonomous Vehicles

Speaker: Justyna Zander, Global Head of Verification and Validation, NVIDIA

In this session, we discuss the use of simulation and computing infrastructure for AV development. We also demonstrate a scalable and automated set of solutions for end-to-end testing to enable AV deployment on the road, according to safety standards.

 

NVIDIA DRIVE Sim and Omniverse

Speaker: Matt Cragun, Senior Product Manager, AV Simulation, NVIDIA

This session covers the use of simulation and computing infrastructure for AV development. We also demonstrate a scalable and automated set of solutions for end-to-end testing to enable AV deployment on the road, according to safety standards.

 

Click here to view all of the Automotive sessions and demos on NVIDIA On-Demand.

 

Categories
Misc

Develop Robotics Applications – Top Resources from GTC 21

NVIDIA Isaac is a developer toolbox for accelerating the development and deployment of AI-powered robots. The SDK includes Isaac applications, GEMs (robot capabilities), a Robot Engine, and Isaac Sim.

Isaac SDK is the robotics platform for accelerating the development and deployment of robotics applications. The SDK is the toolkit which is GPU-optimized for AI and computer vision applications, including perception, navigation, and manipulation features enabled by AI.

Isaac Sim leverages the powerful NVIDIA Omniverse to build the next generation of robotics and AI simulator. Start building virtual robotic worlds and experiments, supporting navigation and manipulation applications through the Isaac SDK with RGB-D, lidar and inertial measurement unit (IMU) sensors, domain randomization, ground truth labeling, segmentation, and bounding boxes.

Here are some resources to introduce you to the Isaac platform.

The developer resources listed below are exclusively available to NVIDIA Developer Program members. Join today for free in order to get access to the tools and training necessary to build on NVIDIA’s technology platform here.

On-Demand Sessions

Sim-to-Real in Isaac Sim
Speakers: Hai Loc Lu, Lead System Software Engineer, NVIDIA; Michael Gussert, Deep Learning Engineer, NVIDIA

Learn how to train and test robots in virtual environments with Isaac Sim on Omniverse, then transfer to physical Jetson powered robots.

Isaac Gym: End-to-End GPU-Accelerated Reinforcement Learning
Speakers: Gavriel State, Senior Director for Simulation and AI, NVIDIA; Lukasz Wawrzyniak, Senior Engineer, NVIDIA

Isaac Gym is NVIDIA’s environment for high-performance reinforcement learning on GPUs. We will review key API features, demonstrate examples of training agents, and provide updates on future integration of Isaac Gym functionality within the NVIDIA Omniverse platform. We will demonstrate how to create environments with thousands of agents to train in parallel, and how the Isaac Gym system allows developers to create tensor based views of physics state for all environments. We will also demonstrate the application of physics based domain randomization in Isaac Gym, which can help with sim2real transfer of learned policies to physical robots.

Bridging Sim2Real Gap: Simulation Tuning for Training Deep Learning Robotic Perception Models
Speaker: Peter Dykas, Solutions Architect, NVIDIA

Deep neural networks enable accurate perception for robots. Simulation offers a way to train deep learning robotic perception models that were previously not possible in scenarios where it is prohibitively expensive, time-consuming, or infeasible to collect large labeled datasets. We’ll dive into how NVIDIA is bridging the gap between simulation and reality with domain randomization, photorealistic simulation, and accurate physics imitation with Isaac Sim, and more.

Docs

NVIDIA Carter
Carter is a robot developed as a platform to demonstrate the capabilities of the Isaac SDK. It is based on a differential drive and uses lidar and a camera to perceive the world. This document walks you through hardware assembly and software setup for Carter.

Getting Started Tutorials and Sample Applications
Over 30 tutorials and samples provided with Isaac SDK to get you started.

Click here to view more Isaac SDK sessions on NVIDIA On-Demand.