Skip to content
/ mlu-ops Public
forked from Cambricon/mlu-ops

Efficient operation implementation based on the Cambricon Machine Learning Unit (MLU) .

License

Notifications You must be signed in to change notification settings

leg190/mlu-ops

 
 

Repository files navigation

简介

MLU-OPS™提供基于寒武纪人工智能单元(MLU),使用 C 接口开发高性能算子的示例代码。 MLU-OPS™旨在通过提供示例代码,供开发者参考使用,可用于开发自定义算子,实现对应模型的计算。

MLU-OPS™提供了以下功能:

依赖条件

  • 操作系统:
    • 支持 x86_64 架构下的 Ubuntu20.04、Centos7.6、Centos8.5、Kylin10
    • MLU-OPS v1.0.0版本后将不再支持 Ubuntu18.04。Ubuntu22.04系统将在后续的版本提供支持。
  • 寒武纪 MLU SDK:
    • 编译和运行时依赖 CNToolkit v3.8.4 或更高版本,CNNL v1.23.2 或者更高版本
  • 寒武纪 MLU 驱动:
    • 运行时依赖驱动 v5.10.25 或更高版本
  • 外部链接库:
    • libxml2-dev、libprotobuf-dev、protobuf-compiler、llvm-6.0-dev、libeigen3-dev>=3.4
  • Python环境:
    • 依赖Python-3版本(默认版本 python 3.8.0,最低要求 python 3.6.0)

依赖环境准备

  • 获取 MLU-OPS™ 代码

以Ubuntu20.04版本为例

git clone https://github.com/Cambricon/mlu-ops.git
cd mlu-ops
git submodule update --init --recursive
  • 准备 CNToolkit、CNNL 环境

    wget https://sdk.cambricon.com/static/Basis/MLU370_X86_ubuntu20.04/cntoolkit_3.8.4-1.ubuntu20.04_amd64.deb
    wget https://sdk.cambricon.com/static/Basis/MLU370_X86_ubuntu20.04/cnnl_1.23.2-1.ubuntu20.04_amd64.deb
    sudo apt-get install ./cntoolkit-3.8.4-1.ubuntu20.04_amd64.deb
    sudo apt-get update
    sudo apt-get install cncc cnas cnbin cndrv cndev cnrt cnrtc cngdb cnperf
    sudo apt-get install ./cnnl_1.23.2-1.ubuntu20.04_amd64.deb
  • 准备 Python-3.8.0 环境

    wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
    tar -xvf Python-3.8.0.tgz
    cd Python-3.8.0
    make -j24 && make install
    
  • 准备链接库环境

    sudo apt-get update
    sudo apt-get install protobuf-compiler libxml2-dev libprotobuf-dev llvm-6.0-dev

获取关于 BANG 语言基础和开发相关工具介绍的文档

可查看最新版 开发者文档

目录文件结构

目录/文件 描述
cmake 存放编译相关的 make 文件。
core 存放公共数据类型的操作、运行时管理、日志等公共实现。
docker 存放 docker 打包脚本,提供 CI 构建环境。
docs 存放算子开发、测试、精度验收等说明文档。
kernels 算子代码实现,包含一元、二元算子模板供其他算子调用。
test 存放测试算子用的代码。
mlu_op.h 公共数据类型描述,以及 kernels 目录中的算子对外提供的 C 接口。

编译、开发与测试

提供基于寒武纪人工智能单元(MLU)开发高性能算子、C 接口封装的示例代码。

具体的编译、开发与测试介绍见 MLU-OPS™算子编译、开发与测试介绍.md

更多内容见 docs 目录下文档。

About

Efficient operation implementation based on the Cambricon Machine Learning Unit (MLU) .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 89.1%
  • C 8.4%
  • Python 1.7%
  • Shell 0.5%
  • CMake 0.3%
  • Smarty 0.0%