Intel DAAL AI加速——支持从数据预处理到模型预测,数据源必须使用DAAL的底层封装库

数据源加速见官方文档(必须使用DAAL自己的库):


Data Management

可以看到支持的数据源:同数据类型的table(matrix),不同类型的table,以及从DB文件取数据、数据序列化、压缩等。

在这些定制的数据源上,Intel DAAL使用自己底层的CPU进行硬件加速!下面摘自其官方:

Intel DAAL addresses all stages of the data analytics pipeline: preprocessing, transformation, analysis, modeling, validation, and decision-making.

illustration of the data analytics pipeline

Intel DAAL is developed by the same team as the Intel® Math Kernel Library (Intel® MKL)—the leading math library in the world. This team works closely with Intel® processor architects to squeeze performance from Intel processor-based systems.

benchmark for Intel DAAL performance

Specs at a Glance

 

Processors Intel Atom®, Intel Core™, Intel® Xeon®, and Intel® Xeon Phi™ processors and compatible processors
Languages Python*, C++, Java*
Development Tools and Environments

Microsoft Visual Studio* (Windows*)

Eclipse* and CDT* (Linux*)

Operating Systems Use the same API for application development on multiple operating systems: Windows, Linux, and macOS*
统计特征的计算加速例子:
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# file: low_order_moms_dense_batch.py
#===============================================================================
# Copyright 2014-2018 Intel Corporation.
#
# This software and the related documents are Intel copyrighted  materials,  and
# your use of  them is  governed by the  express license  under which  they were
# provided to you (License).  Unless the License provides otherwise, you may not
# use, modify, copy, publish, distribute,  disclose or transmit this software or
# the related documents without Intel's prior written permission.
#
# This software and the related documents  are provided as  is,  with no express
# or implied  warranties,  other  than those  that are  expressly stated  in the
# License.
#===============================================================================
 
## <a name="DAAL-EXAMPLE-PY-LOW_ORDER_MOMENTS_DENSE_BATCH"></a>
## \example low_order_moms_dense_batch.py
 
import os
import sys
 
from daal.algorithms import low_order_moments
from daal.data_management import FileDataSource, DataSourceIface
 
utils_folder = os.path.realpath(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
if utils_folder not in sys.path:
    sys.path.insert(0, utils_folder)
from utils import printNumericTable
 
DAAL_PREFIX = os.path.join('..', 'data')
 
# Input data set parameters
dataFileName = os.path.join(DAAL_PREFIX, 'batch', 'covcormoments_dense.csv')
 
 
def printResults(res):
    printNumericTable(res.get(low_order_moments.minimum),              "Minimum:")
    printNumericTable(res.get(low_order_moments.maximum),              "Maximum:")
    printNumericTable(res.get(low_order_moments.sum),                  "Sum:")
    printNumericTable(res.get(low_order_moments.sumSquares),           "Sum of squares:")
    printNumericTable(res.get(low_order_moments.sumSquaresCentered),   "Sum of squared difference from the means:")
    printNumericTable(res.get(low_order_moments.mean),                 "Mean:")
    printNumericTable(res.get(low_order_moments.secondOrderRawMoment), "Second order raw moment:")
    printNumericTable(res.get(low_order_moments.variance),             "Variance:")
    printNumericTable(res.get(low_order_moments.standardDeviation),    "Standard deviation:")
    printNumericTable(res.get(low_order_moments.variation),            "Variation:")
 
if __name__ == "__main__":
 
    # Initialize FileDataSource to retrieve input data from .csv file
    dataSource = FileDataSource(
        dataFileName,
        DataSourceIface.doAllocateNumericTable,
        DataSourceIface.doDictionaryFromContext
    )
 
    # Retrieve the data from input file
    dataSource.loadDataBlock()
 
    # Create algorithm for computing low order moments in batch processing mode
    algorithm = low_order_moments.Batch()
 
    # Set input arguments of the algorithm
    algorithm.input.set(low_order_moments.data, dataSource.getNumericTable())
 
    # Get computed low order moments
    res = algorithm.compute()
 
    printResults(res)  
posted @   bonelee  阅读(1451)  评论(4编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
历史上的今天:
2017-09-25 Vim 删除不包含指定字符串的行及统计匹配个数
2017-09-25 pandas入门10分钟——serries其实就是data frame的一列数据
2017-09-25 转载-让PIP源使用国内镜像,提升下载速度和安装成功率
点击右上角即可分享
微信分享提示