Skip to content

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

License

Notifications You must be signed in to change notification settings

edimetia3d/mlu-ops

 
 

Repository files navigation

Cambricon MLU-OPS

ci

MLU-OPS 提供基于寒武纪机器学习单元(Machine Learning Unit,MLU),使用 C 接口或者 Python 接口开发高性能算子的示例代码。

依赖条件

  • 操作系统:
    • 目前只支持 Ubuntu 16.04 x86_64
  • 寒武纪 MLU SDK:
    • 编译和运行时依赖 CNToolkit v2.6.1 版本
  • 寒武纪 MLU 驱动:
    • 运行时依赖驱动 v4.15.3 或更高版本
  • 外部链接库:
    • libxml2-dev libprotobuf-dev protobuf-compiler llvm-6.0-dev
  • Python环境:
    • 依赖Python-3.8.0版本

MLU-OPS 依赖环境准备

  • 获取 MLU-OPS 代码

    git clone https://github.com/Cambricon/mlu-ops.git
  • 准备 CNToolkit 环境

    sudo apt-get install ./cntoolkit-x.x.x_ubuntuxx.xx_amd64.deb
    sudo apt-get update
    sudo apt-get install cncc cnas cnbin cndrv cnrt cnrtc
  • 准备 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
  • 准备 BANGPy 环境

    pip3.8 install bangpy-x.x.x-py3-none-any.whl
  • 准备链接库环境

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

编译和运行测试用例

当前C接口(BANGC)和 Python接口(BANGPy)开发编译和测试分开,后续会将两种接口开发编译、测试统一到一起。

新算子开发流程

详情可以参考文档 BANGC-OPS 算子开发流程.mdBANGPy-OPS 算子开发流程.md 以及 docs 目录下的其它补充说明, 同时也需要参考 C 接口说明文档README.md 和 Python 接口说明文档README.md

目录文件结构

目录/文件 描述
bangc-ops C 接口算子开发目录
bangpy-ops Python 接口算子开发目录
docker 存放docker打包脚本,提供CI构建环境。
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.6%
  • Python 5.0%
  • C 3.5%
  • Shell 1.1%
  • CMake 0.5%
  • Dockerfile 0.2%
  • Smarty 0.1%