已合并
[Docs] modify public profile of QUICKSTART #4605
huang-chuhong创建于 4月24日
[Docs] modify public profile of QUICKSTART #4605
已合并
共 4 个文件变更+37-29
| @@ -22,27 +22,24 @@ | |||
| 22 | 22 | ||
| 23 | ### 1. 进入项目源码 | 23 | ### 1. 进入项目源码 |
| 24 | 24 | ||
| 25 | -1. 检查源码版本。 | 25 | +- WebIDE环境: |
| 26 | - | 26 | + |
| 27 | - 根据[release仓库](https://gitcode.com/cann/release-management)CANN版本配套关系检查源码版本是否配套,若不配套请参考下述命令重新下载,\$\{tag\_version\}替换为目标分支标签。 | 27 | + 默认提供最新商发版CANN包配套的项目源码,进入源码目录,\$\{gitCode\_id\}替换为开发者个人gitCode账号。 |
| 28 | - | 28 | + |
| 29 | - > 说明:对于WebIDE环境,**已默认提供最新商发版CANN配套的项目源码**。 | 29 | + ``` |
| 30 | + cd /mnt/workspace/gitCode/${gitCode_id}/ops-transformer | ||
| 31 | + ``` | ||
| 32 | +- 非WebIDE环境: | ||
| 33 | + | ||
| 34 | + 根据[release仓库](https://gitcode.com/cann/release-management)源码与CANN版本配套关系,执行如下命令下载源码,\$\{tag\_version\}替换为目标分支标签,例如9.0.0。 | ||
| 30 | 35 | ||
| 31 | - ```bash | 36 | + ```bash |
| 32 | - git clone -b ${tag_version} https://gitcode.com/cann/ops-transformer.git | 37 | + git clone -b ${tag_version} https://gitcode.com/cann/ops-transformer.git && cd ops-transformer |
| 33 | - ``` | 38 | + ``` |
| 34 | 39 | ||
| 35 | - 若出现提示信息`fatal: destination path 'ops-transformer' already exists and is not an empty directory.`,说明项目源码已存在。 | 40 | +> 说明:如需切换源码分支版本,请参考如下指导。 |
| 36 | - | 41 | +> 1. 在源码目录执行`git branch`,查询当前源码版本。 |
| 37 | -2. 进入源码目录。 | 42 | +> 2. 在源码目录执行`git checkout ${tag_version}`,切换到目标分支源码,注意满足源码与CANN版本配套关系。若源码已存在,执行`git pull`拉取最新源码。 |
| 38 | - - Docker或手动安装场景下源码位于: | ||
| 39 | - ```bash | ||
| 40 | - cd ops-transformer | ||
| 41 | - ``` | ||
| 42 | - - WebIDE场景下源码位于: | ||
| 43 | - ```bash | ||
| 44 | - cd /mnt/workspace/ops-transformer | ||
| 45 | - ``` | ||
| 46 | 43 | ||
| 47 | ### 2. 编译AddExample算子 | 44 | ### 2. 编译AddExample算子 |
| 48 | 45 | ||
| @@ -51,13 +48,22 @@ | |||
| 51 | 以AddExample算子为例,编译命令如下: | 48 | 以AddExample算子为例,编译命令如下: |
| 52 | 49 | ||
| 53 | ```bash | 50 | ```bash |
| 54 | -bash build.sh --pkg --soc=ascend910b --ops=add_example -j16 | 51 | +bash build.sh --pkg --soc=${soc_version} --ops=add_example -j16 |
| 55 | ``` | 52 | ``` |
| 53 | +\$\{soc\_version\}设置方法如下: | ||
| 54 | + | ||
| 55 | +访问[CANN下载中心](https://www.hiascend.com/cann/download),根据页面提示复制硬件查询命令,在当前环境中执行,返回芯片ID信息,再回填到官网按Enter键获取产品名,产品名对应的${soc_version}取值如下,请按实际场景传参。 | ||
| 56 | + | ||
| 57 | +- Atlas A2 训练系列产品/Atlas A2 推理系列产品:取值为ascend910b | ||
| 58 | +- Atlas A3 训练系列产品/Atlas A3 推理系列产品:取值为ascend910_93 | ||
| 59 | +- Atlas 350 加速卡:取值为ascend950 | ||
| 60 | + | ||
| 61 | +<img src="./zh/figures/socInfo.png" alt="芯片版本" width="800px" height="160px"> | ||
| 56 | 62 | ||
| 57 | 若提示如下信息,说明编译成功。 | 63 | 若提示如下信息,说明编译成功。 |
| 58 | 64 | ||
| 59 | ```bash | 65 | ```bash |
| 60 | -Self-extractable archive "cann-ops-transformer-custom-linux.${arch}.run" successfully created. | 66 | +Self-extractable archive "cann-ops-transformer-custom_linux.${arch}.run" successfully created. |
| 61 | ``` | 67 | ``` |
| 62 | 68 | ||
| 63 | 编译成功后,run包存放于项目根目录的build_out目录下。 | 69 | 编译成功后,run包存放于项目根目录的build_out目录下。 |
| @@ -131,11 +137,11 @@ __aicore__ inline void AddExample<T>::Compute(int32_t progress) | |||
| 131 | 137 | ||
| 132 | 1. **重新编译**: | 138 | 1. **重新编译**: |
| 133 | 先回到项目根目录,编译命令如下: | 139 | 先回到项目根目录,编译命令如下: |
| 134 | - | 140 | + |
| 135 | ```bash | 141 | ```bash |
| 136 | bash build.sh --pkg --soc=ascend910b --ops=add_example -j16 | 142 | bash build.sh --pkg --soc=ascend910b --ops=add_example -j16 |
| 137 | ``` | 143 | ``` |
| 138 | - | 144 | + |
| 139 | 2. **重新安装**: | 145 | 2. **重新安装**: |
| 140 | 146 | ||
| 141 | ```bash | 147 | ```bash |
| @@ -175,7 +181,7 @@ __aicore__ inline void AddExample<T>::Compute(int32_t progress) | |||
| 175 | * **printf** | 181 | * **printf** |
| 176 | 182 | ||
| 177 | 该接口支持打印Scalar类型数据,如整数、字符型、布尔型等,详细介绍请参见[《Ascend C API》](https://hiascend.com/document/redirect/CannCommunityAscendCApi)中“Ascend C算子开发接口 > SIMD API > 基础API > 调试接口 > 上板打印 > printf”。 | 183 | 该接口支持打印Scalar类型数据,如整数、字符型、布尔型等,详细介绍请参见[《Ascend C API》](https://hiascend.com/document/redirect/CannCommunityAscendCApi)中“Ascend C算子开发接口 > SIMD API > 基础API > 调试接口 > 上板打印 > printf”。 |
| 178 | - | 184 | + |
| 179 | ```c++ | 185 | ```c++ |
| 180 | blockLength_ = (tilingData->totalLength + AscendC::GetBlockNum() - 1) / AscendC::GetBlockNum(); | 186 | blockLength_ = (tilingData->totalLength + AscendC::GetBlockNum() - 1) / AscendC::GetBlockNum(); |
| 181 | tileNum_ = tilingData->tileNum; | 187 | tileNum_ = tilingData->tileNum; |
| @@ -230,7 +236,7 @@ __aicore__ inline void AddExample<T>::Compute(int32_t progress) | |||
| 230 | ```c++ | 236 | ```c++ |
| 231 | int main() { | 237 | int main() { |
| 232 | // ... 初始化代码 ... | 238 | // ... 初始化代码 ... |
| 233 | - | 239 | + |
| 234 | // === ① 修改selfX的输入 === | 240 | // === ① 修改selfX的输入 === |
| 235 | // 修改前:shape = {32, 4, 4, 4}, 数值全为1 | 241 | // 修改前:shape = {32, 4, 4, 4}, 数值全为1 |
| 236 | // 修改后:将输入shape改为 {8, 8, 8, 8},并填充不同的测试数据 | 242 | // 修改后:将输入shape改为 {8, 8, 8, 8},并填充不同的测试数据 |
| @@ -241,7 +247,7 @@ int main() { | |||
| 241 | selfXHostData[i] = static_cast<float>(i % 10); // 填充0-9的循环值 | 247 | selfXHostData[i] = static_cast<float>(i % 10); // 填充0-9的循环值 |
| 242 | } | 248 | } |
| 243 | // === ② 参考selfX,同理修改selfY、selfZ的输入 === | 249 | // === ② 参考selfX,同理修改selfY、selfZ的输入 === |
| 244 | - | 250 | + |
| 245 | // ... 后续执行代码 ... | 251 | // ... 后续执行代码 ... |
| 246 | } | 252 | } |
| 247 | ``` | 253 | ``` |
| @@ -19,15 +19,17 @@ | |||
| 19 | 19 | ||
| 20 | ### 方式1:WebIDE环境 | 20 | ### 方式1:WebIDE环境 |
| 21 | 21 | ||
| 22 | -对于无昇腾设备的开发者,可直接使用WebIDE开发平台,即“**算子一站式开发平台**”,该平台为您提供在线可直接运行的昇腾环境,环境中已安装必备的驱动固件、软件包和依赖,无需手动安装。 | 22 | +对于无昇腾设备的开发者,可直接使用WebIDE开发平台,即“**一站式开发平台**”,该平台为您提供在线可直接运行的昇腾环境,环境中已安装必备的驱动固件、软件包和依赖,无需手动安装。 |
| 23 | 23 | ||
| 24 | -> **说明**:环境默认安装最新商发版CANN包,源码下载时注意与软件配套。更多关于开发平台的介绍请参考[LINK](https://gitcode.com/org/cann/discussions/54)。 | 24 | +> **说明**:环境默认安装最新商发版CANN包,源码下载时注意与软件配套。更多关于开发平台的介绍请参考[WebIDE指导](https://gitcode.com/org/cann/discussions/54)。 |
| 25 | 25 | ||
| 26 | 1. 进入开源项目,单击“`云开发`”按钮,使用已认证过的华为云账号登录。若未注册或认证,请根据页面提示进行注册和认证。 | 26 | 1. 进入开源项目,单击“`云开发`”按钮,使用已认证过的华为云账号登录。若未注册或认证,请根据页面提示进行注册和认证。 |
| 27 | 27 | ||
| 28 | <img src="../figures/cloudIDE.png" alt="云平台" width="750px" height="90px"> | 28 | <img src="../figures/cloudIDE.png" alt="云平台" width="750px" height="90px"> |
| 29 | 29 | ||
| 30 | -2. 根据页面提示创建并启动云开发环境,单击“`连接 > WebIDE`”进入算子一站式开发平台,开源项目的源码资源默认在`/mnt/workspace`目录下。 | 30 | +2. 根据页面提示创建NPU环境并配置规格,启动云开发环境后,单击“`连接 > WebIDE`”进入一站式开发平台。 |
| 31 | + | ||
| 32 | + 当前开源项目资源默认在`/mnt/workspace/gitCode/${gitCode_id}`目录下,\$\{gitCode\_id\}表示开发者个人gitCode账号。 | ||
| 31 | 33 | ||
| 32 | <img src="../figures/webIDE.png" alt="云平台" width="1000px" height="150px"> | 34 | <img src="../figures/webIDE.png" alt="云平台" width="1000px" height="150px"> |
| 33 | 35 | ||