Welcome to this
episode of Bone Hunt: Discovering Dinosaurs with AI.
I'm Bob Chesebrough, I'm a solution engineer and technical evangelist in
AI supporting oneAPI here at Intel Corporation.
The Intel AI Analytics Toolkit is a compendium of several libraries.
One is for deep learning.
One is for machine learning.
One is for data analytics.
And the other is for Intel.
Optimized Python.
With respect to deep learning we have the Intel optimization
for TensorFlow, which takes a lot of the optimizations that we do at the low
level with the oneDNN library, also known as the one Deep Neural Network Library.
Framework developers implement oneDNN into
commonly used deep learning frameworks.
Not only is the AI Analytics Toolkit aware of the Intel architecture,
but we move much of that technology and provide it for free to the TensorFlow
community for their mainline for the stock version of the tool.
One thing to note is that the cadence at which they adopt changes into their
mainline is slower than the cadence that Intel updates our toolkit.
So the toolkit usually has extra performance relative to the stock version.
The same is true for Intel extension for PyTorch.
TensorFlow and PyTorch are two of the most popular deep learning frameworks.
We also have support for the Intel Neural Compressor,
which is used to take models such as those from TensorFlow or PyTorch
to be able to quantize them, optimize them and prune them so that they run
efficiently on Intel architectures, whatever those might be.
Next, the Intel Model Zoo for Intel architecture contains predefined models
demonstrating performance
capability on various intel platforms and acceleration technologies.
If people are interested in
how a given model would work on their own Intel platforms,
they could use those models from the Model Zoo to test it out.
The Intel Extension for Scikit-learn provides accelerated versions of commonly
used machine learning algorithms via a library and a patch from Intel.
Essentially, it is an extra library that you would install in addition
to Scikit-learn, which provides a patch or a listener that once invoked
will listen for any further imports to Scikit-learn in that python code.
And if we have an Intel optimized version of that import,
then we will use the optimized version instead of the stock version.
So that's another way to get the speed ups.
The Intel Extension for Scikit-learn
supports, thirty algorithms on CPU's and ten for Intel GPUs.
All the usual suspects the principal component analysis or PCA,
tSNE, DBSCAN, K-means algorithms,
Nearest Neighbor, are all supported on the Intel CPU.
Regression and classification algorithms such as K-Nearest Neighbor,
Random Forest, Support Vector Machine are supported.
We have quite a number of regression algorithms.
We have a Linear regression itself.
We also have LASSO and Ridge Regression, and Elastic Net.
We have a faster version of Logistic Regression.
We have utility functions such as Train to Split,
and the Receiver Operator Characteristics or ROC-AUC score,
which is a commonly used machine learning scoring algorithm.
And this takes us down to Intel Optimized XGBoost.
We have an optimized version of XGBoost that runs incredibly well,
and we also supply our optimizations to the maintainers of the stock version
of XGBoost to ensure the best
and fastest algorithms are available for their own adoption cadence.
So make sure you update
all your compute intensive libraries such as XGBoost NumPy, TensorFlow
or Pytorch and make sure you're using the latest and greatest.
We support data analytics, for example, with the Intel distribution of Modin,
which is a library used as a drop in replacement for PANDAS.
It can be used for distributed data or for doing PANDAS type
things across multiple nodes and also GPUs.
It provides very large speed ups.
It's not a perfect drop in for PANDAS, not all PANDAS
functions are supported, but it may suit you for a given use case.
It's based on an OmniSci backend, which you can read
about at the OmniSci website.
The next major category is Intel Optimized Python.
Within that, we have NumPy, SciPy, PANDAS which are all powered by oneAPI.
A large chunk of the performance gains for these libraries
come from the use of Intel.
oneMKL, the Math Kernel Library under the hood.
NumPy is also accelerated via
the C++ optimizations for cache utilization and so forth.
If you're wise with your use of NumPy using UFuncs,
aggregations, or broadcasting, Fancy Slicing
and the numpy.where and numpy.select clauses, you can replace inefficient
Python loops with these accelerated alternatives as function calls.
This typically makes code more readable, more maintainable,
faster now, and faster for future hardware releases.
So this is the closest thing to getting a free lunch
you might find in software development circles.
It is somewhat common for a loopy Python
code to be accelerated on the order of 2X, 5X, 10X
and even up to 300X potentially by proper
loop replacement with NumPy functions.
SciPy is also based on NumPy and there are various versions
of a wide variety of AI and science related algorithms.
SciPy provides a higher level of abstraction than NumPy.
It is used to replace the roll your own
algorithms with optimized versions.
For example, creating a city atlas using straightforward, triply nested
loops in Python is a couple of orders of magnitude slower
than the SciPy provided Floyd Warshaw algorithm.
PANDAS
is also optimized since it uses NumPy under the hood.
But you can also use numpy.where and numpy.select clauses as a wrapper
on even some of the PANDAS data frames to accelerate PANDAS apply statements.
That's all based on underlying functionality of those C optimizations.
The high level memory optimizations and vectorization under the hood.
Numba is a data parallel way to write your custom kernels
to get the accelerations
either on GPUs or on CPU's and do data parallelism through threading.
Numba also has a sweet spot
in an intersection with the NumPy UFuncs.
We cover Numba in a workshop on data parallel essentials for Python,
which demonstrates high performance code targeting Intel XPUs using Python.
This applies to Intel CPUs such as Xeon and Core CPUs,
as well as Intel GPUs.
Then the data parallel Python is just an optimized Python
to do many of these algorithms more quickly.
So all of this is just a high level overview of the Intel
AI Analytics Toolkit itself.
You can find links to resources, tools, downloads
and where to learn more about everything in this series in the description.
Remember to like and share
this video and subscribe to the Intel Software YouTube channel.
In our next episode, we will give you a brief overview of the Intel DevCloud.
Join me in the next episode to continue
the dinosaur bone hunting adventure.
Let the
adventure begin!