33 Star 38 Fork 135

Ascend / parser

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MulanPSL-2.0

Ascend CANN Parser

Ascend CANN Parser(简称parser)配合TF_Adapter、 ATC工具、IR构图等使用,开发者通过以上工具,借助parser能方便地将第三方框架的算法表示转换成Ascend IR,充分利用昇腾AI处理器卓越的运算能力。 parser系统框架

目录结构介绍

parser
├── inc                                #  相关头文件
├── parser                            
|   ├── caffe                          #  caffe模型转换为Ascend IR
|   ├── common                         #  转换使用的公共接口
|   ├── func_to_graph                  #  Convert the tensorflow functionDefs in the input model file to single GraphDefs
|   ├── onnx                           #  onnx模型转换为Ascend IR
|   ├── tensorflow                     #  tensorflow模型转换为Ascend IR
├── tests                              #  DT测试目录

环境准备

parser支持源码编译,进行源码编译前,首先确保你有昇腾910AI处理器的环境,同时确保系统满足以下要求:

  • 编译环境已安装CANN开发套件包(Ascend-cann-toolkit_<soc_version>_linux_<arch>),CANN开发套件软件包请从Link获取。支持的操作系统、安装依赖及安装步骤请参见对应的用户手册的“CANN软件包支持的操作系统”与“安装开发环境”章节。

说明: Parser仓源代码与CANN软件包存在配套关系,源码编译前请获取并安装对应版本的CANN软件包。

  • GCC == 7.X (建议7.5.0)
  • CMake >= 3.20.0 (建议3.20.0)
  • Autoconf >= 2.64
  • Libtool >= 2.4.6
  • Automake >= 1.15.1

代码下载

$ git clone https://gitee.com/ascend/parser.git
$ cd parser
$ git submodule init && git submodule update

编译

Parser仓提供一键式编译能力,具体可以通过bash build.sh -h查看:

bash build.sh --ascend_custom_path=${CANN_INSTALL_PATH}

ascend_custom_path默认路径为/usr/local/Ascend/latest,编译完成后会在output/package目录下生成CANN-parser-linux.{x86_64/aarch64}.run

本地验证(UT/ST)

Parser仓提供一键式编译执行开发者测试,详细配置可通过bash tests/run_test.sh -h查看

bash tests/run_test.sh -u --ascend_custom_path=${CANN_INSTALL_PATH}

ascend_custom_path默认路径为/usr/local/Ascend/latest

安装

编译完成后,可通过如下命令安装或回滚:

# 安装:
./CANN-parser-linux.{x86_64/aarch64}.run --full --quiet --install-path=${CANN_INSTALL_PATH}
# 回滚:
./CANN-parser-linux.{x86_64/aarch64}.run --rollback --quiet --install-path=${CANN_INSTALL_PATH}

贡献指南

针对Parser仓,开发者准备本地代码与提交PR时需要重点关注如下几点:

  1. 请输出满足Google编程规范的代码,详细可参见Google 开源项目风格指南
  2. 提交PR时,请按照PR模板仔细填写本次PR的业务背景、目的、方案等信息。
  3. 若您的修改不是简单的bug修复,而是涉及到新增特性、新增接口、新增配置参数或者修改代码流程等,请务必先通过Issue进行方案讨论,以避免您的代码被拒绝合入。若您不确定本次修改是否可被归为“简单的bug修复”,亦可通过提交Issue进行方案讨论。
Mulan Permissive Software License,Version 2 Mulan Permissive Software License,Version 2 (Mulan PSL v2) January 2020 http://license.coscl.org.cn/MulanPSL2 Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: 0. Definition Software means the program and related documents which are licensed under this License and comprise all Contribution(s). Contribution means the copyrightable work licensed by a particular Contributor under this License. Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. Legal Entity means the entity making a Contribution and all its Affiliates. Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. 1. Grant of Copyright License Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. 2. Grant of Patent License Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. 3. No Trademark License No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4. 4. Distribution Restriction You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. 5. Disclaimer of Warranty and Limitation of Liability THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 6. Language THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. END OF THE TERMS AND CONDITIONS How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: i. Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; ii. Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package; iii. Attach the statement to the appropriate annotated syntax at the beginning of each source file. Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

简介

Ascend CANN Parser 展开 收起
MulanPSL-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/ascend/parser.git
git@gitee.com:ascend/parser.git
ascend
parser
parser
master

搜索帮助