Professional Documents
Culture Documents
Learning Objectives
You will be able to:
2
What is BigDL
2018 June 0.6 • Integrate Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) to speed up CNN models
• Advanced model training support
• Support Apache Spark 2.3
*Other names and brands may be claimed as the property of others.
BigDL & Apache Spark*
Run BigDL applications as
Apache Spark* applications
Scala* and Python* support
Use other Apache Spark*
features
- In memory compute
- Integrate with Apache
Spark* ML Library (Mlib) and
streaming
Easy development with
Jupyter Notebook*
*Other names and brands may be claimed as the property of others.
BigDL: Big Compute Plus Big Data
BigDL helps us in balancing our needs:
- Big Compute: fast linear algebra, Intel® MKL library
- Big Data: I/O parallelized to run on many CPUs
BigDL allows massive scalability
- Runs on Apache Spark*
- Works with Apache Hadoop* ecosystem (via Apache Spark*)
Plays nicely with other Deep Learning frameworks
- Use existing TensorFlow* or Caffe* to do inference in a distributed fashion (and massive
memory)
- Train new models based on existing TensorFlow* / Caffe* models
Overall, BigDL helps us take advantage of existing Big Data infrastructure
*Other names and brands may be claimed as the property of others.
8
GPUs (Graphics Processing Units)
9
Intel® Math Kernel Library (Intel® MKL)
10
Intel® MKL Performance
11
GPU vs. CPU for Big Data
12
Production ML/DL Systems are Complex!
13
BigDL Fills the 'gap' in Big Data + Deep Learning
14
15
BigDL Use Cases
16
Use Case: BigDL @ JD – Image Feature Extraction
About
- JD.com is China’s largest online retailer and
its biggest overall retailer
- They have 300M+ customers with annual
revenue of US $55 Billion (2017)
Project
- Image Feature Extraction is used in image-
similarity search
- JD team was trying to do feature extraction
on hundreds of millions of images from Red handbag
product catalog
(similar items)
17
Use Case : BigDL @ JD – Image Feature Extraction
Issues
- JD.com team tried to build feature extraction using GPUs and clusters
- Resource allocations across GPUs and clusters proved to be error prone
resulting in frequent out of memory errors, etc.
- Dependencies of GPU applications made production deployment more
complex
- Reading images took a long time which cannot be easily optimized for GPU
based solutions
18
Use Case : BigDL @ JD – Image Feature Extraction
19
Use Case : BigDL @ JD – Image Feature Extraction
BigDL based solution
- Read hundreds of millions of pictures from a distributed database in Apache
Spark* as resilient distributed datasets (RDD)
- Preprocess the RDD of images (including resizing, normalization, and batching) in
Apache Spark*
- Use BigDL to load the Single Shot Detector model for large scale, distributed
object detection on Apache Spark*
- Model for distributed feature extraction of the target images on Apache Spark*,
which will generate the corresponding features
- Store the result (RDD of extracted object features) in the Hadoop* Distributed File
System (HDFS)
*Other names and brands may be claimed as the property of others.
20
Use Case : BigDL @ JD – Image Feature Extraction
WINS
- Take advantage of existing Big Data
infrastructure (Apache Spark*, HDFS)
- Take advantage of the scalability of
Apache Spark*
- Do all image processing at massive
scale
- Much better performance
21
Use Case : Personalized Recommendations at
MasterCard*
- MasterCard* has 2.4 billion cards and 56 billion transactions
- Offer personalized recommendations to customers
- Dataset
- 3 years of data
- 675k consumers
- 1.4 billion transactions (50G+ raw data)
- Target merchants ~2000
22
Use Case : Personalized Recommendations at
MasterCard*
Architecture:
23
Use Case : Personalized Recommendations at
MasterCard*
WINS:
- Scale out on Apache Hadoop* & Apache Spark* cluster
- 6 node cluster, 24 hyper cores, 384 G memory, 20TB disk
- Cloudera Hadoop with Spark* 2.2
- Run Spark* ALS algorithm + BigDL NCF (neural collaborative filtering)
24
*Other names and brands may be claimed as the property of others. 25
Apache Spark* Execution Model
26
Scaling to Large Datasets
27
Scaling to Large Datasets
28
Scaling to Large Datasets
29
A Simple Example of Distributed Computing:
Distributed Count
Here we are doing a distributed
count
The data is distributed across many
worker machines:
- Many partitions
Each worker is performing a count
on local data (partitions)
Then the intermediate counts are
sent to aggregator to sum it all up
30
BigDL on Apache Spark*
BigDL runs as standard
Apache Spark* jobs
- No changes to Apache
Spark* required
Each iteration of training
runs as an Apache Spark*
job
Apache Spark* jobs
process data in parallel
(bigger diagram on next slide)
*Other names and brands may be claimed as the property of others.
31
BigDL on Apache Spark*
32
33
BigDL Features (Detailed in Next Slides)
34
BigDL Features: Provides Popular DL Algorithms
Out of the Box
Application Algorithm
Image classification ResNet50, Inception, VGG
Object detection Single Shot Detector (SSD)
Recommendation NCF, Wide and Deep
Text classification CNN, LSTM based models
Data generation Auto-encoder, VAE
35
BigDL Features: Python* and Scala* Support
BigDL is written in Scala* language
Python* is supported via a 'language wrapper'
layer
We can write our programs using Scala* or
Python*
Python* has become a preferred language of
choice for Machine Learning and Deep Learning
(see next slide for usage)
This architecture gives the flexibility of Python*
with the speed provided by Intel® MKL*
Similar to how Apache Spark* supports multiple
languages (Scala* core + language wrappers)
*Other names and brands may be claimed as the property of others.
36
Popular Languages for Machine Learning
37
BigDL Features: Apache Spark* ML Compatibility
38
BigDL Features: Apache Spark* ML Compatibility
39
BigDL Features: Visualizations Using TensorBoard*
40
BigDL and TensorBoard*
41
BigDL Features: Import Models From Other NN
Frameworks
Framework BigDL can Import BigDL can
From Export To
TensorFlow* Yes Yes
(Support operation list)
42
BigDL Features: Cloud Platform Support
43
Running BigDL on AWS*
44
Running BigDL in Google Cloud* Platform
45
BigDL on Kubernetes*
46
47
Noteworthy Upcoming Features
BigDL is a very fast-moving project – new features are added with each release
Upcoming features include:
- Keras2* API support
- Model serving
- More NLP (natural language processing)
48
Summary
49
Further Reading
51