Traditional with oneDALand XGBoost* Rachel Oberman – AI Technical Consulting Engineer introducing oneapi Application Workloads Need Diverse Hardware Scalar Vector Matrix Spatial Unified programming model to simplify development across diverse architectures Middleware / Frameworks Unified and simplified language and libraries for expressing parallelism Industry Intel Uncompromised native high-level language performance Initiative Product Based on industry standards and open specifications XPUs Interoperable with existing HPC programming models Other CPU GPU FPGA Accel.

Optimization Notice Copyright © 2019, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. 2 Intel® ONEAPI toolkits(beta) Toolkits Tailored to Your Needs Domain-specific sets of tools to get your job done quickly.

Intel® oneAPI Base Toolkit A core set of high-performance tools for building Data Parallel C++ applications and oneAPI based applications

Learn More

Intel® oneAPI HPC Toolkit Intel® oneAPI IoT Toolkit Intel® oneAPI DL Framework Intel® oneAPI Rendering Developer Toolkit Toolkit Everything HPC developers need to Tools for building high-performing, Tools for developers & researchers Powerful rendering libraries to create deliver fast C++, Fortran, & OpenMP* efficient, reliable solutions that run at who build deep learning frameworks high-performance, high-fidelity applications that scale the network’s edge or customize existing ones so visualization applications applications run faster Learn More Learn More Learn More Learn More

Toolkits Powered by oneAPI

Intel® System Bring-Up Toolkit Intel® Distribution of OpenVINO™ Intel® AI Analytics Toolkit Toolkit Tools to debug & tune power & Tools to build high performance deep Tools to build applications that performance in pre- & post-silicon learning inference & computer vision leverage machine learning & deep development applications (production-level tool) learning models

Learn More Learn More Learn More

Optimization Notice Copyright © 20192019,, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. 3 Speed Up Development with open AI software Model Machine learning Deep learning TOOLKITs App Model Developers Zoo

Intel® Data Intel® Distributed Intel Optimized Frameworks * libraries Analytics Distribution (Cart, (MlLib on Acceleration for Python* Random Spark, Data Forest, Mahout) (Sklearn*, Scientists Library (DAAL) e1071) Pandas*) More framework optimizations in progress… Kernels Intel® oneAPI Collective Deep Neural Intel® Math Kernel Library Communication Library Networks Library Library (Intel® MKL) (Intel® oneCCL) (Intel® oneDNN) Developers

Visit: www.intel.ai/technology cPU ▪︎GPU 1 An open source version is available at: 01.org/openvinotoolkit *Other names and brands may be claimed as the property of others. Developer personas show above represent the primary user base for each row, but are not mutually-exclusive All products, computer systems, dates, and figures are preliminary based on current expectations, and are subject to change without notice.

Optimization Notice 4 Speed Up Development with open AI software Model Machine learninG Deep learning TOOLKITs Model App Developers Zoo

Intel® Data Intel® R Distributed Intel Optimized Frameworks * libraries Analytics Distribution (Cart, (MlLib on Acceleration for Python* Random Spark, Data Forest, Mahout) (Sklearn*, Scientists Library (DAAL) e1071) Pandas*) More framework optimizations in progress…

Deep Neural Intel® oneAPI Collective Kernels Intel® Math Kernel Library Networks Library Library (Intel® MKL) Communication Library (Intel® oneDNN) Developers (Intel® oneCCL)

Visit: www.intel.ai/technology cPU ▪︎GPU 1 An open source version is available at: 01.org/openvinotoolkit *Other names and brands may be claimed as the property of others. Developer personas show above represent the primary user base for each row, but are not mutually-exclusive All products, computer systems, dates, and figures are preliminary based on current expectations, and are subject to change without notice.

Optimization Notice 5 6 Accelerate libraries with Intel® Distribution for Python* High Performance Python* for Scientific Computing, Data Analytics, Machine Learning

Faster Performance Greater ProdUctiVity Ecosystem compatibility

Performance Libraries, Parallelism, Supports Python* 2.7 & 3.6, & 3.7 conda, Prebuilt & Accelerated Packages Multithreading, Language Extensions pip

Accelerated NumPy*/SciPy*/scikit-learn* Prebuilt & optimized packages for Compatible & powered by Anaconda*, with oneMKL1 & oneDAL2 numerical computing, machine/deep supports conda & pip learning, HPC & data analytics Data analytics, machine learning with scikit- Distribution & individual optimized learn, daal4py DropDrop in replacement-in replacement for existing for existing Python - packages also available at conda & oneMKL accelerated NumPy*, and Usually with no codePython* changes required Anaconda.org, YUM/APT, Docker image Optimized run-times Intel MPI®, Intel® TBB on DockerHubSciPy now in Anaconda*! Jupyter*Usually notebooks, NO code changesMatplotlib required!included Scale with Numba* & Cython* Optimizations upstreamed to main Python* Conda build recipes included in packages Includes optimized mpi4py, works with trunk Dask* & PySpark* Free download & free for all uses including Commercial support through Intel® Parallel commercial deployment Studio XE Optimized for latest Intel® architecture

Intel® Architecture Platforms

Operating System: Windows*, *, MacOS1*

1Intel® oneAPI Math Kernel Library 2Intel® oneAPI Data Analytics Library 7 Performance Optimization: Introduction to Python* Performance, cont. The layers of quantitative Enforces Global Interpreter Lock (GIL) and is single-threaded, abstraction Python* Python* overhead. No advanced types.

▪ The Python* language is interpreted and has many type checks to make it flexible Gets around the GIL ▪ Each level has various tradeoffs; NumPy* (multi-thread and multi-core) value proposition is immediately seen NumPy* BLAS API can be the bottleneck *Basic Linear Algebra Subprograms (BLAS) ▪ For best performance, escaping the Python* [CBLAS] layer early is best method Intel® oneAPI Gets around BLAS API bottleneck Math Kernel Much stricter typing Library Fastest performance level (oneMKL) Dispatches to hardware vectorization

Intel® oneMKL included with Anaconda* standard bundle; is Free for Python* Productivity with Performance via Intel® Distribution for Python*

Intel® Distribution for Python*

smp mpi4py

daal4py tbb4py

Data acquisition & Numerical/Scientific computing & Composable Distributed preprocessing machine learning multi-threading parallelism Learn More: software.intel.com/distribution-for-python https://www.anaconda.com/blog/developer-blog/parallel-python-with-numba-and-parallelaccelerator/

8 Intel Distribution of Modin with OmnisciDB backend

• A lightweight DataFrame to seamlessly scale Pandas workflows across multi- nodes, multi-cores • Pandas compatible API - No upfront cost to learning a new API. o Only add one line: import modin.pandas as pd • Integration with the Python ecosystem • Integration with Ray/Dask clusters (Run on what you have, even on laptop!) • To use Modin, you do not need to know how many cores your system has, and you do not need to specify how to distribute the data • In the backend, Modin is supported by OmnisciDB, a performant framework for end-to-end analytics that has been optimized to harness the computing power of existing and emerging Intel® hardware

Copyright © Intel Corporation 2020 9 10 Installing Intel® Distribution for Python* 2020

Standalone Download full installer from Installer https://software.intel.com/en-us/intel-distribution-for-python 2.7 & 3.6 & > conda config --add channels intel 3.7 Anaconda.org > conda install intelpython3_full Anaconda.org/intel channel > conda install intelpython3_core

> pip install intel-numpy > pip install intel-scipy + Intel library Runtime packages PyPI > pip install mkl_fft + Intel development packages > pip install mkl_random

Docker Hub docker pull intelpython/intelpython3_full

Access for yum/apt: YUM/APT https://software.intel.com/en-us/articles/installing-intel-free- libs-and-python Speed Up Development with open AI software Model Machine learning deeP learninG TOOLKITs Model App Developers Zoo

Intel® Data Intel® R Distributed Intel Optimized Frameworks * libraries Analytics Distribution (Cart, (MlLib on Acceleration for Python* Random Spark, Data Forest, Mahout) (Sklearn*, Scientists Library (DAAL) e1071) Pandas*) More framework optimizations in progress…

Deep Neural Kernels Intel® Math Kernel Library Intel® oneAPI Collective Networks Library (Intel® MKL) Communication Library Library (Intel® oneDNN) Developers (Intel® oneCCL)

Visit: www.intel.ai/technology cPU ▪︎GPU 1 An open source version is available at: 01.org/openvinotoolkit *Other names and brands may be claimed as the property of others. Developer personas show above represent the primary user base for each row, but are not mutually-exclusive All products, computer systems, dates, and figures are preliminary based on current expectations, and are subject to change without notice.

Optimization Notice 11 Speed-up Machine Learning and Analytics with Intel® oneAPI Data Analytics Library (oneDAL) Boost Machine Learning & Data Analytics Performance What’s New in the 2020 Release ▪ Helps applications deliver better predictions faster New Algorithms: ▪ Optimizes data ingestion & algorithmic compute together for highest performance ▪ Probabilistic classification and variable importance computation for gradient boosted trees ▪ Supports offline, streaming & distributed usage models to meet a range of application needs ▪ Classification stump with information gain and Gini index split ▪ Split analytics workloads between edge devices and cloud to methods optimize overall application throughput ▪ Regression stump with the Mean Squared Error (MSE) Learn More: software.intel.com/daal algorithm split method

Pre-processing Transformation Analysis Modeling Validation Decision Making

Decompression, Aggregation, Summary Machine Learning (Training) Hypothesis Testing Forecasting Filtering, Dimension Reduction Statistics Parameter Estimation Model Errors Decision Trees, etc. Normalization Clustering, etc. Simulation

1 2 Processing Modes

Batch Distributed Online Processing Processing Processing

R1 D1 D 3 D 2 D … 1 D Dk-1 D k 1 R2 R D2 Append

Si,Ri Dk R R = F(D1,…,Dk) k Si+1 = T(Si,Di) R = F(R1,…,Rk) Ri+1 = F(Si+1) d4p.kmeans_init(10, method="plusPlusDense") d4p.kmeans_init(10, method="plusPlusDense“, d4p.kmeans_init(10, method="plusPlusDense“, distributed=“True”) streaming=“True”)

13 Scaling Machine Learning Beyond a Single Node

Simple Python* API scikit-learn* daal4py Powers scikit-learn*

Intel® oneAPI Data Analytics Library Powered by Intel® oneDAL (oneDAL) Intel® MPI Intel® oneAPI Math Intel® Threading Library Kernel Library Scalable to multiple nodes Building Blocks (TBB) (oneMKL)

Monkey-patch any scikit-learn* > python -m daal4py on the command-line

Monkey-patch any scikit-learn* import daal4py.sklearn programmatically daal4py.sklearn.patch_sklearn() https://intelpython.github.io/daal4py/sklearn.html# 14 oneAPI Data Analytics Library (oneDAL) PCA KMeans Scikit-Learn* KNeighborsClassifier LinearRegression Scikit-Learn* RandomForestClassifier Ridge API SVC Equivalents RandomForestRegressor pairwise_distances Compatible USE_DAAL4PY_SKLEARN=YES logistic_regression_path

Use directly for daal4py • Scaling to multiple nodes • Streaming data • Non-homogeneous dataframes Intel® oneDAL

15 Intel® oneAPI Data Analytics Library(beta) (oneDAL) Algorithms

Machine Learning Ridge Regression Linear DBSCAN Regression LASSO Regression Unsupervised K-Means learning Clustering Decision Tree AdaBoost

Supervised Brown/Logit EM for GMM Random Forest learning Boosting

Gradient Boosting Naïve Bayes Alternating Least Classification Logistic Collaborative Squares Regression filtering

kNN Apriori Algorithms supporting Intel GPU (Gen 9 & Gen12) Algorithms supporting batch processing SVM Algorithms supporting batch and distributed processing

Optimization Notice Copyright © 2019, Intel Corporation. All rights reserved. 16 *Other names and brands may be claimed as the property of others. Intel® oneAPI Data Analytics Library(beta) (oneDAL) algorithms Data Transformation and Analysis

Basic statistics Correlation and Dimensionality Matrix factorizations Outlier detection for datasets dependence reduction

Low order Cosine SVD PCA Univariate moments distance

QR Quantiles Correlation Association rule Multivariate distance Cholesky mining (Apriori)

Order Variance- Covariance statistics tSVD matrix Optimization solvers Math functions (SGD, AdaGrad, lBFGS, CD) (exp, log,…)

Algorithms supporting batch processing Intel GPU (Gen 9 & Gen12) Algorithms supporting batch processing

Algorithms supporting batch, online and/or distributed processing

Optimization Notice Copyright © 2019, Intel Corporation. All rights reserved. 17 *Other names and brands may be claimed as the property of others. Intel® Distribution for Python* Scikit-learn* Optimizations, cont.

Figure 1**

Figure 1

18 19

Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz, EIST/Turbo on

Hardware 2 sockets, 20 Cores per socket 192 GB RAM Strong & Weak Scaling via daal4py 16 nodes connected with Infiniband Operating Oracle Linux Server release 7.4 System Data Type double

Figure 2** Figure 3** On a 32-node cluster (1280 cores) daal4py computed linear On a 32-node cluster (1280 cores) daal4py computed K- regression of 2.15 TB of data in 1.18 seconds and 68.66 GB Means (10 clusters) of 1.12 TB of data in 107.4 seconds and of data in less than 48 milliseconds. 35.76 GB of data in 4.8 seconds. Intel® DAAL 2020 K-means fit, cores scaling (10M samples, 10 features, 100 clusters, 100 iterations, float32) 100.0 100 81.4 80.0 80 60.0 60 40.6 40.0 40 19.4 20.0 10.1 20 5.1 3.0 1.5

0.0 0 Parallel efficiency, % efficiency,Parallel Execution time,sec Execution 1 2 4 8 16 28 56 Number of cores

Time, s Efficiency (actual), % Efficiency (ideal), %

Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Learn more at intel.com, or from the OEM or retailer. Performance results are based on testing as of 11/11/2019 and may not reflect all publicly available security updates. See configuration disclosure for details. No product can be absolutely secure.

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. For more complete information visit www.intel.com/benchmarks.

Configuration: Testing by Intel as of 11/11/2019. Intel® Data Analytics Acceleration Library 2019.3 (Intel® DAAL); Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz, 2 sockets, 28 cores per socket, 10M samples, 10 features, 100 clusters, 100 iterations, float32

Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804

Optimization Notice Copyright © 2019, Intel Corporation. All rights reserved. 20 *Other names and brands may be claimed as the property of others. Accelerating K-Means

https://cloudplatform.googleblog.com/2017/11/Intel-performance-libraries-and-python-distribution-enhance-performance-and-scaling-of-Intel-Xeon- Scalable-processors-on-GCP.html

21 22 K-Means using daal4py

import daal4py as d4p

# daal4py accepts data as CSV files, numpy arrays or pandas dataframes # here we let daal4py load process-local data from csv files data = "kmeans_dense.csv"

# Create algob object to compute initial centers init = d4p.kmeans_init(10, method="plusPlusDense") # compute initial centers ires = init.compute(data) # results can have multiple attributes, we need centroids centroids = ires.centroids # compute initial centroids & kmeans clustering result = d4p.kmeans(10).compute(data, centroids) 23 Distributed K-Means using daal4py

import daal4py as d4p

# initialize distributed execution environment d4p.daalinit()

# daal4py accepts data as CSV files, numpy arrays or pandas dataframes # here we let daal4py load process-local data from csv files data = "kmeans_dense_{}.csv".format(d4p.my_procid())

# compute initial centroids & kmeans clustering init = d4p.kmeans_init(10, method="plusPlusDense", distributed=True) centroids = init.compute(data).centroids result = d4p.kmeans(10, distributed=True).compute(data, centroids)

mpirun -n 4 python ./kmeans.py 24 Streaming data (linear regression) using daal4py

import daal4py as d4p

# Configure a Linear regression training object for streaming train_algo = d4p.linear_regression_training(interceptFlag=True, streaming=True)

# assume we have a generator returning blocks of (X,y)... rn = read_next(infile)

# on which we iterate for chunk in rn: algo.compute(chunk.X. chunk.y)

# finalize computation result = algo.finalize() Gradient Boosting Acceleration –gainsources Pseudocode for XGBoost* (0.81) Pseudocode for Intel® DAAL implementation implementation Memory prefetching to mitigate irregular memory access

Usage uint8 instead of uint32

SIMD instructions instead of scalar code

Nested parallelism

Advanced stage Training parallelism, reducing seq loops Usage of AVX-512, vcompress instruction (from Skylake)

Moved from Already available in Intel® Legend: Intel® DAAL to DAAL, potential XGBoost (v1.0) optimizations for XGBoost

25 26 Intel-optimized XGBoost*

Figure 4** 1) XGBoost* 0.9 – w/ no Intel optimizations Intel XGB 0.9 2) XGBoost* 1.0 – the latest official XGBoost 3) XGBoost* from Intel channel (we expect that XGBoost* 1.1 official will have similar conda install xgboost –c intel performance). Speed Up Development with open AI software Model Machine learning Deep learning TOOLKITs Model App Zoo & Quantization Tools Developers

Intel® Data Intel® R Distributed Intel Optimized Frameworks * libraries Analytics Distribution (Cart, (MlLib on Acceleration for Python* Random Spark, Data Forest, Mahout) (Sklearn*, Scientists Library (DAAL) e1071) Pandas*) More framework optimizations in progress…

Deep Neural Intel® oneAPI Collective Kernels Intel® Math Kernel Library Networks Library Library (Intel® MKL) Communication Library (Intel® oneDNN) (Intel® oneCCL) Developers

Visit: www.intel.ai/technology cPU ▪︎GPU 1 An open source version is available at: 01.org/openvinotoolkit *Other names and brands may be claimed as the property of others. Developer personas show above represent the primary user base for each row, but are not mutually-exclusive All products, computer systems, dates, and figures are preliminary based on current expectations, and are subject to change without notice.

Optimization Notice 27 28 Footnotes and Disclaimers

*Other names and brands may be claimed as the property of others **Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. For more information, see Performance Benchmark Test Disclosure.

**Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804