oneAPI Deep Neural Network Library

oneAPI 深度神经网络库(oneDNN)。「oneAPI Deep Neural Network Library (oneDNN)」

Github stars Tracking Chart

oneAPI 深度神经网络库(oneDNN)

该软件以前称为用于深度神经网络的英特尔数学内核库(Intel MKL-DNN)和深度神经网络库(DNNL)。

随着 oneAPI 的启动,我们改变了项目名称和存储库位置,以与其他 oneAPI 库保持一致:

  • 短库名称更改为 oneDNN。
  • 存储库从 intel/mkl-dnn 移至 oneapi-src/oneDNN。到代码和文档的现有链接将继续起作用。

此时对 API、环境变量或计划的构建选项没有任何更改。

oneAPI 深度神经网络库(oneDNN)是用于深度学习应用程序的基本构建基块的开源跨平台性能库。该库针对英特尔架构处理器,英特尔处理器图形和基于 Xe 架构的图形进行了优化。对其他架构(例如Arm * 64位架构(AArch64)和OpenPOWER * Power ISA(PPC64))的支持尚处于试验阶段。请参阅下面的系统要求部分。

oneDNN 供有兴趣改善英特尔 CPU 和 GPU 上的应用程序性能的深度学习应用程序和框架开发人员使用。深度学习从业人员应使用启用 oneDNN 的应用程序之一:

文档

  • 开发人员指南 介绍了编程模型,支持的功能和实现细节,并包括带注释的示例。
  • API 参考 提供了库API的全面参考。

安装

可在发布部分中下载适用于 Linux*、Windows* 和 macOS* 的预构建二进制文件。 程序包名称使用以下约定:

OS Package name
Linux dnnl_lnx_<version>_cpu_<cpu runtime>[_gpu_<gpu runtime>].tgz
Windows dnnl_win_<version>_cpu_<cpu runtime>[_gpu_<gpu runtime>].zip
macOS dnnl_mac_<version>_cpu_<cpu runtime>.tgz

每个操作系统都可以使用几个软件包,以确保与应用程序使用的CPU或GPU运行时库互操作。

Configuration Dependency
cpu_iomp Intel OpenMP runtime
cpu_gomp GNU* OpenMP runtime
cpu_vcomp Microsoft Visual C OpenMP runtime
cpu_tbb Threading Building Blocks (TBB)

这些软件包不包括库依赖关系,需要在构建时在应用程序中解决这些依赖关系。有关CPU和GPU运行时的更多详细信息,请参见下面的系统要求部分和开发人员指南中的构建选项部分。

如果所需的配置不可用,则可以从源代码构建库。

系统要求

oneDNN 支持基于以下架构的平台:

警告:Arm 64位体系结构(AArch64)和Power ISA(PPC64)支持是试验性的,具有有限的测试验证。

该库针对以下 CPU 进行了优化:

  • 具有 Intel SSE4.1 支持的 Intel Atom 处理器
  • 第4代、第5代、第6代、第7代和第8代 Intel(R)Core(TM)处理器
  • 英特尔®至强®处理器 E3、E5 和 E7 家族(以前称为 Sandy Bridge、Ivy Bridge、Haswell 和 Broadwell)
  • 英特尔(R)至强融核(TM)处理器(以前为 Knights Landing 和 Knights Mill)
  • 英特尔至强可扩展处理器(以前称为 Skylake、Cascade Lake 和 Cooper Lake)
  • 未来的 Intel Xeon 可扩展处理器(代号 Sapphire Rapids)

在基于 Intel 64 或 AMD64 架构的 CPU 上,oneDNN 在运行时检测指令集架构(ISA),并使用即时(JIT)代码生成来部署针对最新支持的 ISA 优化的代码。将来的 ISA 可能默认情况下禁用了库中的初始支持,并且需要使用运行时控件来启用它们。有关更多详细信息,请参见 CPU 调度程序控制

警告:在 macOS 上,如果使用加固的运行时,则使用 oneDNN 的应用程序可能需要请求特殊权利。有关更多详细信息,请参见链接指南

该库针对以下 GPU 进行了优化:

  • 英特尔高清显卡
  • 英特尔 UHD 图形
  • 英特尔 Iris Plus 图形
  • 基于 Xe 架构的 Graphics(代码分别为 DG1 和 Tiger Lake)

从源构建的要求

oneDNN 支持满足以下要求的系统:

  • 支持 Intel 64/Arm 64/Power 体系结构的操作系统
  • 具有 C++ 11 标准支持的 C++ 编译器
  • CMake 2.8.11 或更高版本
  • Doxygen 1.8.5 或更高版本来构建文档

CPU 和 GPU 引擎的配置可能会引入其他构建时间依赖性。

CPU 引擎

oneDNN CPU 引擎用于在 Intel 体系结构处理器,64 位 Arm 体系结构(AArch64)处理器,64 位 Power ISA(PPC64)处理器和兼容设备上执行原语。

默认情况下,CPU 引擎是内置的,无法在构建时禁用。可以将引擎配置为使用 OpenMP 或 TBB 线程运行时。以下附加要求适用:

  • OpenMP 运行时需要具有 OpenMP 2.0 或更高标准支持的 C++ 编译器
  • TBB 运行时需要 Threading Building Blocks(TBB)2017 或更高版本。

一些实现依赖于 OpenMP 4.0 SIMD 扩展。为了在英特尔架构处理器上获得最佳性能,我们建议使用英特尔 C++ 编译器。

GPU 引擎

oneDNN GPU 引擎支持基于英特尔处理器图形和基于 Xe 架构的图形。在默认的构建配置中,GPU 引擎被禁用。启用 GPU 引擎时,以下附加要求适用:

  • OpenCL * 运行时库(OpenCL 1.2 版或更高版本)
  • 具有 Intel 子组扩展支持的 OpenCL 驱动程序(具有对 OpenCL C 2.0 或更高版本的内核语言支持)

运行时依赖

从源代码构建 oneDNN 时,库运行时依赖项和特定版本由构建环境定义。

Linux

常见依赖项:

  • GNU C Library (libc.so)
  • GNU Standard C++ Library v3 (libstd++.so)
  • Dynamic Linking Library (libdl.so)
  • C Math Library (libm.so)
  • POSIX Threads Library (libpthread.so)

运行时特定的依赖项:

Runtime configuration Compiler Dependency
DNNL_CPU_RUNTIME=OMP GCC GNU OpenMP runtime (libgomp.so)
DNNL_CPU_RUNTIME=OMP Intel C/C++ Compiler Intel OpenMP runtime (libiomp5.so)
DNNL_CPU_RUNTIME=OMP Clang Intel OpenMP runtime (libiomp5.so)
DNNL_CPU_RUNTIME=TBB any TBB (libtbb.so)
DNNL_GPU_RUNTIME=OCL any OpenCL runtime (libOpenCL.so)
Windows

常见依赖项:

  • Microsoft Visual C++ Redistributable (msvcrt.dll)

运行时特定的依赖项:

Runtime configuration Compiler Dependency
DNNL_CPU_RUNTIME=OMP Microsoft Visual C++ Compiler No additional requirements
DNNL_CPU_RUNTIME=OMP Intel C/C++ Compiler Intel OpenMP runtime (iomp5.dll)
DNNL_CPU_RUNTIME=TBB any TBB (tbb.dll)
DNNL_GPU_RUNTIME=OCL any OpenCL runtime (OpenCL.dll)
macOS

常见依赖项:

  • System C/C++ runtime (libc++.dylib, libSystem.dylib)

运行时特定的依赖项:

Runtime configuration Compiler Dependency
DNNL_CPU_RUNTIME=OMP Intel C/C++ Compiler Intel OpenMP runtime (libiomp5.dylib)
DNNL_CPU_RUNTIME=TBB any TBB (libtbb.dylib)

已验证的配置

CPU 引擎已在 RedHat* Enterprise Linux 7 上通过以下验证:

  • GNU Compiler Collection 4.8, 5.4, 6.1, 7.2, and 8.1
  • Clang* 3.8.0
  • Intel C/C++ Compiler 17.0, 18.0, and 19.0

on Windows Server* 2012 R2 with

on macOS 10.13 (High Sierra) with

GPU engine was validated on Ubuntu* 18.04 with

on Windows Server 2019 with

预建二进制文件的要求

请参阅相应二进制软件包中包含的自述文件。

支持

请在 GitHub 问题 页面上提交您的问题,功能请求和错误报告。

您可以通过 dnnl.maintainers@intel.com 私下联系项目维护者。

贡献

我们欢迎社区对 oneDNN 的贡献。如果您有关于如何改进库的想法:

对于影响整体公共API或库的更改(例如添加新的原语或对体系结构的更改),请提交 RFC 拉取请求
确保所做的更改与代码贡献准则和编码样式一致。
确保您可以构建产品并运行带有修补程序的所有示例。
提交拉取请求

有关更多详细信息,请参见贡献准则

该项目旨在提供一个安全,友好的合作空间,并且希望贡献者遵守《贡献者公约》行为准则。

许可

oneDNN 已获得 Apache 许可版本 2.0 的许可。有关完整的许可证文本和版权声明,请参阅“LICENSE”文件。

此发行版包括受单独许可条款约束的第三方软件。

3-clause BSD license:

Apache License Version 2.0:

Boost Software License, Version 1.0:

MIT License:

SIL Open Font License (OFL):

该第三方软件,即使包含在英特尔软件的发行版中,也可能受单独的许可条款约束,包括但不限于第三方许可条款,其他英特尔软件许可条款和开源软件许可条款。 这些单独的许可条款约束您对“第三方程序”文件中规定的第三方程序的使用。


(The first version translated by vz on 2020.08.08)

Overview

Name With Owneroneapi-src/oneDNN
Primary LanguageC++
Program languageCMake (Language Count: 6)
PlatformLinux, Mac, Windows
License:Apache License 2.0
Release Count182
Last Release Namev3.5-pc (Posted on )
First Release Namev0.1-pc (Posted on 2016-08-22 11:19:40)
Created At2016-05-09 23:26:42
Pushed At2024-04-27 01:19:46
Last Commit At
Stargazers Count3.5k
Watchers Count186
Fork Count1k
Commits Count16.1k
Has Issues Enabled
Issues Count1227
Issue Open Count40
Pull Requests Count470
Pull Requests Open Count26
Pull Requests Close Count133
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

oneAPI Deep Neural Network Library (oneDNN)

This software was previously known as
Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)
and Deep Neural Network Library (DNNL).

With the launch of oneAPI we changed the project
name and repository location to be consistent with the rest of oneAPI
libraries:

  • Short library name changed to oneDNN.
  • Repository moved from intel/mkl-dnn to oneapi-src/oneDNN. Existing
    links to the code and documentation will continue to work.

There are no changes to the API, environment variables, or build options
planned at this point.

oneAPI Deep Neural Network Library (oneDNN) is an open-source cross-platform
performance library of basic building blocks for deep learning applications.
The library is optimized for Intel Architecture Processors, Intel Processor
Graphics and Xe architecture-based Graphics. Support for other architectures
such as Arm* 64-bit Architecture (AArch64) and OpenPOWER* Power ISA (PPC64)
is experimental.
See the System Requirements section below.

oneDNN is intended for deep learning applications and framework
developers interested in improving application performance
on Intel CPUs and GPUs. Deep learning practitioners should use one of the
applications enabled with oneDNN:

Documentation

  • Developer guide explains programming
    model, supported functionality, and implementation details, and
    includes annotated examples.
  • API reference provides
    a comprehensive reference of the library API.

Installation

Pre-built binaries for Linux*, Windows*, and macOS* are available
for download in the
releases section. Package
names use the following convention:

OS Package name
Linux dnnl_lnx_<version>_cpu_<cpu runtime>[_gpu_<gpu runtime>].tgz
Windows dnnl_win_<version>_cpu_<cpu runtime>[_gpu_<gpu runtime>].zip
macOS dnnl_mac_<version>_cpu_<cpu runtime>.tgz

Several packages are available for each operating system to ensure
interoperability with CPU or GPU runtime libraries used by the application.

Configuration Dependency
cpu_iomp Intel OpenMP runtime
cpu_gomp GNU* OpenMP runtime
cpu_vcomp Microsoft Visual C OpenMP runtime
cpu_tbb Threading Building Blocks (TBB)

The packages do not include library dependencies and these need to be resolved
in the application at build time. See the
System Requirements section below and the
Build Options
section in the developer guide for more
details on CPU and GPU runtimes.

If the configuration you need is not available, you can
build the library from source.

System Requirements

oneDNN supports platforms based on the following architectures:

WARNING

Arm 64-bit Architecture (AArch64) and Power ISA (PPC64) support
is experimental with limited testing validation.

The library is optimized for the following CPUs:

  • Intel Atom processor with Intel SSE4.1 support
  • 4th, 5th, 6th, 7th, and 8th generation Intel(R) Core(TM) processor
  • Intel(R) Xeon(R) processor E3, E5, and E7 family (formerly Sandy Bridge,
    Ivy Bridge, Haswell, and Broadwell)
  • Intel(R) Xeon Phi(TM) processor (formerly Knights Landing and Knights Mill)
  • Intel Xeon Scalable processor (formerly Skylake, Cascade Lake, and Cooper
    Lake)
  • future Intel Xeon Scalable processor (code name Sapphire Rapids)

On a CPU based on Intel 64 or on AMD64 architecture, oneDNN detects
the instruction set architecture (ISA) at runtime and uses just-in-time (JIT)
code generation to deploy the code optimized for the latest supported ISA.
Future ISAs may have initial support in the library disabled by default and
require the use of run-time controls to enable them. See
CPU dispatcher control
for more details.

WARNING

On macOS, applications that use oneDNN may need to request special
entitlements if they use the hardened runtime. See the
linking guide
for more details.

The library is optimized for the following GPUs:

  • Intel HD Graphics
  • Intel UHD Graphics
  • Intel Iris Plus Graphics
  • Xe architecture-based Graphics (code named DG1 and Tiger Lake)

Requirements for Building from Source

oneDNN supports systems meeting the following requirements:

  • Operating system with Intel 64 / Arm 64 / Power architecture support
  • C++ compiler with C++11 standard support
  • CMake 2.8.11 or later
  • Doxygen 1.8.5 or later
    to build the documentation

Configurations of CPU and GPU engines may introduce additional build time
dependencies.

CPU Engine

oneDNN CPU engine is used to execute primitives on Intel Architecture
Processors, 64-bit Arm Architecture (AArch64) processors,
64-bit Power ISA (PPC64) processors, and compatible devices.

The CPU engine is built by default and cannot be disabled at build time. The
engine can be configured to use the OpenMP or TBB threading runtime. The
following additional requirements apply:

Some implementations rely on OpenMP 4.0 SIMD extensions. For the best
performance results on Intel Architecture Processors we recommend using the
Intel C++ Compiler.

GPU Engine

Intel Processor Graphics and Xe architecture-based Graphics are supported by
the oneDNN GPU engine. The GPU engine is disabled in the default build
configuration. The following additional requirements apply when GPU engine
is enabled:

  • OpenCL* runtime library (OpenCL version 1.2 or later)
  • OpenCL driver (with kernel language support for OpenCL C 2.0 or later)
    with Intel subgroups extension support

Runtime Dependencies

When oneDNN is built from source, the library runtime dependencies
and specific versions are defined by the build environment.

Linux

Common dependencies:

  • GNU C Library (libc.so)
  • GNU Standard C++ Library v3 (libstd++.so)
  • Dynamic Linking Library (libdl.so)
  • C Math Library (libm.so)
  • POSIX Threads Library (libpthread.so)

Runtime-specific dependencies:

Runtime configuration Compiler Dependency
DNNL_CPU_RUNTIME=OMP GCC GNU OpenMP runtime (libgomp.so)
DNNL_CPU_RUNTIME=OMP Intel C/C++ Compiler Intel OpenMP runtime (libiomp5.so)
DNNL_CPU_RUNTIME=OMP Clang Intel OpenMP runtime (libiomp5.so)
DNNL_CPU_RUNTIME=TBB any TBB (libtbb.so)
DNNL_GPU_RUNTIME=OCL any OpenCL runtime (libOpenCL.so)

Windows

Common dependencies:

  • Microsoft Visual C++ Redistributable (msvcrt.dll)

Runtime-specific dependencies:

Runtime configuration Compiler Dependency
DNNL_CPU_RUNTIME=OMP Microsoft Visual C++ Compiler No additional requirements
DNNL_CPU_RUNTIME=OMP Intel C/C++ Compiler Intel OpenMP runtime (iomp5.dll)
DNNL_CPU_RUNTIME=TBB any TBB (tbb.dll)
DNNL_GPU_RUNTIME=OCL any OpenCL runtime (OpenCL.dll)

macOS

Common dependencies:

  • System C/C++ runtime (libc++.dylib, libSystem.dylib)

Runtime-specific dependencies:

Runtime configuration Compiler Dependency
DNNL_CPU_RUNTIME=OMP Intel C/C++ Compiler Intel OpenMP runtime (libiomp5.dylib)
DNNL_CPU_RUNTIME=TBB any TBB (libtbb.dylib)

Validated Configurations

CPU engine was validated on RedHat* Enterprise Linux 7 with

  • GNU Compiler Collection 4.8, 5.4, 6.1, 7.2, and 8.1
  • Clang* 3.8.0
  • Intel C/C++ Compiler
    17.0, 18.0, and 19.0

on Windows Server* 2012 R2 with

on macOS 10.13 (High Sierra) with

GPU engine was validated on Ubuntu* 18.04 with

on Windows Server 2019 with

Requirements for Pre-built Binaries

See README included into corresponding binary package.

Support

Please submit your questions, feature requests, and bug reports on the
GitHub issues page.

You may reach out to project maintainers privately
at dnnl.maintainers@intel.com.

Contributing

We welcome community contributions to oneDNN. If you have an idea on how
to improve the library:

  • For changes impacting the public API or library overall, such as adding new
    primitives or changes to the architecture, submit an
    RFC pull request.
  • Ensure that the changes are consistent with the
    code contribution guidelines
    and coding style.
  • Ensure that you can build the product and run all the examples with your
    patch.
  • Submit a pull request.

For additional details, see contribution guidelines.

This project is intended to be a safe, welcoming space for collaboration, and
contributors are expected to adhere to the
Contributor Covenant code of conduct.

License

oneDNN is licensed under Apache License Version 2.0. Refer to the
"LICENSE" file for the full license text and copyright notice.

This distribution includes third party software governed by separate license
terms.

3-clause BSD license:

Apache License Version 2.0:

Boost Software License, Version 1.0:

MIT License:

This third party software, even if included with the distribution of
the Intel software, may be governed by separate license terms, including
without limitation, third party license terms, other Intel software license
terms, and open source software license terms. These separate license terms
govern your use of the third party programs as set forth in the
"THIRD-PARTY-PROGRAMS" file.

Trademark Information

Intel, the Intel logo, Intel Atom, Intel Core, Intel Xeon Phi, Iris, OpenVINO,
the OpenVINO logo, Pentium, VTune, and Xeon are trademarks
of Intel Corporation or its subsidiaries.

* Other names and brands may be claimed as the property of others.

Microsoft, Windows, and the Windows logo are trademarks, or registered
trademarks of Microsoft Corporation in the United States and/or other
countries.

OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission
by Khronos.

(C) Intel Corporation

To the top