jarvis and nemo · download from ngc or use local checkpoint b. create trt plans convert pytorch...

32
GTC China Jarvis and NeMo

Upload: others

Post on 20-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

GTC China

Jarvis and NeMo

Page 2: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

2

Jarvis

Page 3: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

3

JARVISPlatform to develop and deploy conversational AI applications

Designed for sensor fusion

Gaze & Speechhttps://www.youtube.com/watch?v=r264lBi1nMU

Page 4: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

4

USE CASES

Online Store Industrial Finance Energy / Oil & Gas Consumer Internet

Provide

conversational

interface for

shopping

Collaborative robots - Robots

and humans collaborate in

close proximity

Engineer troubleshooting with

the help of AI assistant

Call center: Sentiment

of customers calling

Insurance chatbot:

“Add a wedding ring to

an insurance policy via

an image and receive

policy price quote”

Use camera and ask,

“what are the safety

guidelines for this

chemical”?

Loud environment - virtual

assistant using lip reading

Video diarization -

Meeting/conversation

transcription per person with

timestamps

Content tagging with Image,

text, Audio -

Recommendation, Ads

In car experience

Autonomous Driving:

Enhanced In-car

experience combining

visual inputs with speech

ACROSS ALL VERTICALS

Page 5: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

5

CHALLENGES OF CONVERSATIONAL AI

Cloud services not customizable

High costsData Sovereignty

Existing software not designed for modern

production environments

Difficult to use multiple sensors

efficiently

Need state-of-the-art algorithms and models

Requires low latency for natural interaction

Custom models Deployment Multiple sensors High accuracy Real Time

Page 6: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

6

JARVIS BENEFITS

Start from base model, train with your data on

your infrastructure

Micro-service approachDesigned for K8s

Simple APIs, easy to integrate

Framework for training and deploying models

across modalitiesTools to simplify fusion

Best-in-breed algorithms

Direct access to cutting-edge research

End-to-end inference on GPUs optimized to

reduce latency

Custom models Deployment Multiple sensors High accuracy Real Time

Page 7: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

7

JARVIS WORKFLOW OVERVIEW

Speech

Recognition

Intent

Classification

Speech

Synthesis

Pose

estimation

Lip

activity

Object

detection

Gaze

detection

Wake

word

Pretrained models

Fine-TuningData for

customizing

JARVIS AI Services

Client

Application

Jarvis Core

(client)

End usersMultiple

sensor input Sensor Fusion, Dialog Manager, Backend fulfillment

gRPC, Python client library

(optional)

Page 8: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

8

JARVIS WORKFLOW OVERVIEW

Speech

Recognition

Intent

Classification

Speech

Synthesis

Pose

estimation

Lip

activity

Object

detection

Gaze

detection

Wake

word

Pretrained models

Fine-TuningData for

customizing

JARVIS AI Services

Client

Application

Jarvis Core

(client)

End usersMultiple

sensor input Sensor Fusion, Dialog Manager, Backend fulfillment

(optional)

gRPC, Python client library

Page 9: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

9

Visual Diarization

Interaction: Jupyter notebook with live video stream overlaying gaze detection and lip activity detection and producing a text transcript per person from the audio stream

Technology of sensor fusion:

● Video stream○ Gaze detection to engage the system○ Lip activity to determine who is speaking

● Audio stream:○ Transcribe the audio○ Label transcriptions per individual speaker

Implementation:

● Fusion graph via JSON to combine the multiple inference models● gRPC end points for direct interaction with the inference models● Jupyter notebook demonstrates Python APIs for interaction

Model Developer: Improve the conversational model accuracy via fine-tuning with NeMo

Developer Operations: Deploy via docker containers from NGC into Kubernetes (EGX)

Multiple speaker transcription based on video and audio streams

Transcription

Driver: Where is a good sushi restaurant?

Passenger: What’s the weather in Chicago

Page 10: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

10

Jarvis ASR TRTIS pipeline

Jarvis ASR Service

Jarvis ASR API

Feature

ExtractorJasper

Greedy

or Beam

Decoder

Audio Text

TRTIS custom backend, N-gram language model

TRT on GPU

TRTIS custom backend on

GPU

Post-

ProcessingAcoustic

Model

Pre-

Processing

BERT-

based

Punctuator

End of

Sentence

Detector

TRT on GPU

Post-

Processing

Method Name Description

Recognize Given audio file as input, return transcript

StreamingRecognize Process audio from a file or a microphone as

it’s being captured, returning partial

transcripts

Post-

Processing

Page 11: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

12

Page 12: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

13

Jarvis – Weather Bot Architecture

Deployment of Jarvis components with simple dialog manager

Authoring (offline)

dialog states, transitions,

response templates

Dialog Manager• State of conversation

• Route text to services

• Pass commands to

fulfillment engine

Jarvis Service

Intent &

EntityJarvis Service

TTS Dialog

Description

Jarvis Service

ASRText

Text

Fulfillment EngineWeather query, etc.

Text

Action Result

NEMO (offline)

Intent &

EntityChat Application

(e.g. iFlyTek)

NVIDIA

Domain specific

Legend

Intent

Slots

Spoken

input

Audio

response

Trained model

weights

Page 13: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

14

Neural Modules(NeMo)

Page 14: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

15

CONVERSATIONAL AI WORKFLOW

Speech

Recognition

Intent

Classification

Speech

Synthesis

Pose

estimation

Lip

activity

Object

detection

Gaze

detection

Wake

word

Pretrained models

Fine-TuningData for

customizing

JARVIS AI Services

Client

Application

Jarvis Core

(client)

End usersMultiple

sensor input Sensor Fusion, Dialog Manager, Backend fulfillment

(optional)

gRPC, Python client library

Page 15: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

16

gRPC, Python client library

CONVERSATIONAL AI WORKFLOW

Speech

Recognition

Intent

Classification

Speech

Synthesis

Pose

estimation

Lip

activity

Object

detection

Gaze

detection

Wake

word

Pretrained models

Fine-TuningData for

customizing

JARVIS AI Services

Client

Application

Jarvis Core

(client)

End usersMultiple

sensor input Sensor Fusion, Dialog Manager, Backend fulfillment

(optional)

NeMo

Page 16: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

18

• Open source deep learning Python toolkit for training speech and language models

• High performance training on NVIDIA GPUs• Uses TensorCores• Multi-GPU• Multi-Node

• Based on concept of Neural Module –reusable high level building block for defining deep learning models

• PyTorch backend (TensorFlow on Roadmap)

Pretrained Models per module

Neural Modules Collection Libraries

Neural Modules CoreMixed Precision, Distributed training, Semantic checks

Optimized FrameworkAccelerated Libraries CUDA, cuBLAS, cuDNN etc...

Voice

RecognitionNatural

Language

NEMO: TRAINING CONVERSATIONAL AI MODELS

Speech

Synthesis

Page 17: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

19

NEMO COLLECTIONS

nemo_asr(Speech Recognition)

nemo_nlp(Natural Lang Processing)

nemo_tts(Speech Synthesis)

• Jasper acoustic model• QuartzNet acoustic model• RNN with attention• Transformer-based• English and Mandarin

tokenizers and dataset importers

• BERT pre-training & finetuning

• GLUE tasks• Language modeling• Neural Machine Translation• Intent classification & slot

filling• ASR spell correction• Punctuation• English and Mandarin

dataset importers

• Tacotron 2• WaveGlow• English and Mandarin

output and datasets importers

pip install nemo_asr pip install nemo_nlp pip install nemo_tts

Page 18: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

20

Audio To Text

Data Layer

AUDIO

AUDIO

LEN

TEXT

TEXT

LEN

Audio

Preprocessing

AUDIO

AUDIO

LEN

SPECT

SPECT

LEN Jasper

Encoder

SPECT

SPECT

LEN

ENC

ENC

LEN

Jasper

Decoder For

CTC

ENC

ENC

LEN

LOG

PROB

CTC Loss

LOG PROB

LOG PROB

LEN

LOSS

TEXT

TEXT LEN

Greedy CTC

Decoder

LOG PROB PREDICTLogging

Callback

Train

Action

(invokes)

NEMO EXAMPLE: JASPER ASR

Page 19: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

21

”Jasper: An End-to-End Convolutional Neural Acoustic Model” by Li et al. INTERSPEECH 2019 https://arxiv.org/pdf/1904.03288.pdf

NEMO EXAMPLE: JASPER ASR

Create modules

Connect them

Define training and evaluation actions

Page 20: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

22

Model Language Model Test-Clean Test-Other Params, M

DeepSpeech 2 5-gram 5.33 13.25 >70

wav2letter++ ConvLM 3.26 10.47 208

Listen-Attend-Spell

(with SpecAugment)RNN 2.5 5.8 360

Jasper 10x5

- 3.77 11.08

3336-gram 3.19 9.03

Transformer-XL 2.86 8.17

QuartzNet 15x5

- 3.90 11.28

196-gram 2.96 8.07

Transformer-XL 2.69 7.25

ASR COMPARISONS English LibriSpeech dataset %WER

Page 21: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

23

DOMAIN SPECIFIC ASR

• Start with pretrained base QuartzNet model• Fine tune with WSJ data (newspaper read

aloud)• Add custom language model to base model• Add custom language model to fine-tuned

model for best performance

• Achieves Word Error Rate of < 2.5 !

Fine-tuned acoustic

model + custom

language model

Pretrained acoustic

model + custom

language model

Fine-tuned

acoustic model

Pretrained base

model

Tutorial here: https://ngc.nvidia.com/catalog/containers/nvidia:nemo_asr_app_img

Jupyter notebook transfer learning tutorial

Page 22: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

24

TRANSFER LEARNING CUSTOMER STORY

● S&P Global produces transcriptions of

earnings calls – 10,000 hours of high quality

data

● Scribe application works with ASR models

● Recognizes domain specific financial jargon

● Additional language models provide meta

tags, punctuation

An S&P Global Company

GTC Talk: https://events.rainfocus.com/widget/nvidia/gtcdc19/catalog-short?search=nemo

Page 23: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

25

KENSHO ASR RESULTS

● QuartzNet trained on

domain specific financial

data outperformed all

leading ASR models

● Fine tuning was faster and

had higher accuracy than

training from scratch

Page 24: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

26

JARVIS AND NEMO TOGETHER

Page 25: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

27

EXPORT TO JARVIS

DataSources

Model TrainingFine Tuning

Model Validation

Model Export

Pretrained Models

TensorRT

Inference Server

GPU

Custom Data

NeMoJarvis AI

Services

Jarvis API server

GRPCShared Memory

GRPC

GPU

Client Application

Page 26: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

28

Using a Helm Chart inside a Kubernetes Cluster

Stage 1

DEPLOYING JARVIS AI SERVICES TO K8S

Stage 1: Create TensorRT engines

A. Get PyTorch checkpoints

● Download from NGC or use local

checkpoint

B. Create TRT plans

● Convert PyTorch checkpoint to TRT

C. Create TRT engines

● Generate optimized engines

Download /

Use

Checkpoint

Stage 2: Launch TRTIS

A. Configuring TRTIS

a. Setup model directory structure

and server configuration

B. Launching TRTIS

Stage 2

Creating TRT

Plan

Creating TRT

Engine

Configure

TRTIS

Launch

TRTIS

A B

One Helm Chart to Deploy

C

A B

Page 27: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

29

CollaborationPartnership Benefits

JARVIS PARTNERSHIP

BENEFITS & EXPECTATIONS

Cutting-edge Technology

● Opportunity to collaborate with NV

Eng to accelerate development

Performance

● SW optimizes on GPUs by design

● Prioritization of feature requests

Capability Growth

● Proof-of-concept to solve more

challenges

Try and Implement

● API on preferred model/data

● Validation of performance metrics

Help us improve

● Provide Feedback

● File bugs and issues

● Feature requests

Success together

● Your business growth

● Testimonial & Success case study

NVIDIA Confidential, please do not distribute

Page 28: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

30

Try NeMotoday!

Register for Jarvis Early

Access (January)

> pip install nemo_toolkit

nemo_asr nemo_nlp nemo_tts

https://developer.nvidia.com/nvidia-jarvis

https://nvidia.github.io/NeMo/zh/index.html

Page 29: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use
Page 30: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

32

Backup

Page 31: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

33

Jarvis NLP TRTIS pipeline

Jarvis NLP Service

TokenizerBERT

encoderText Labels

TRT on GPU

TRTIS custom backend on CPU & GPU

Pre-trained

model

DetokenizeSentence

classifier

Token

classifier

TRT on GPU

TRT on GPU

TRTIS custom backend on

CPU

Jarvis NLP Provided Models

Method Name Description

AnalyzeSentiment Run sentiment detection on input and return

label/score

AnalyzeEntities Given text input, return named entities (NER)

Punctuate Take text without punctuation (e.g. ASR

output) and add periods, commas, question

marks

Jarvis NLP API

Method Name Description

ClassifyText Given text input, return a class label

and score

ClassifyTokens Given text input or array of tokens,

return a class label and score per token

TransformText Given input text, return output text

Page 32: Jarvis and NeMo · Download from NGC or use local checkpoint B. Create TRT plans Convert PyTorch checkpoint to TRT C. Create TRT engines Generate optimized engines Download / Use

34

Jarvis TTS TRTIS pipeline

Jarvis TTS Service

Text pre-

processingText Audio

TRTIS custom backend on

CPU

Customized

pronunciation

DenoiserTacoTron2

Speech

synthesis

Neural

Vocoder

WaveGlow

TRT on GPU

TRT on GPU

Method Name Description

Synthesize Given text input, return audio of spoken version as

a single audio clip

SynthesizeOnline Given text input, return audio of spoken version as

an audio stream

TRT on GPU

Jarvis TTS API