Skip to content

Commit

Permalink
[Feature](bangc-ops): delete MLU270/MLU290 compile message and test f…
Browse files Browse the repository at this point in the history
…ramework (Cambricon#362)
  • Loading branch information
duzekunKTH authored Jan 11, 2023
1 parent 8d60ac8 commit 89f8e7a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 49 deletions.
18 changes: 2 additions & 16 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For static threshold standard details, see: [MLU-OPS Accuracy Acceptance Standar

| No. | Details | Check Results |
|----------------|---------------------------|---------------------|
| 1 | Supported hardware | MLU270 <br> MLU290 <br>MLU370<br>MLU590|
| 1 | Supported hardware | MLU370<br>MLU590|
| 2 | Job types | block <br> U1 <br> U4 |
| 3 | Layouts | NHWC 、NCHW、ARRAY etc |
| 4 | Whether multi-dimensions are supported | |
Expand Down Expand Up @@ -73,27 +73,13 @@ Operation:
|Layout test |Supports NCHW/NHWC| | |
|Zero element test |Whether to support this test | | |
|Stability test |--gtest_repeat=NUM<br>--thread=NUM | | |
|Mult-platform test |MLU270/MLU290/MLU370/MLU590 | | |
|Mult-platform test |MLU370/MLU590 | | |
|Nan/INF test |Whether to support this test | | |

### 3.3 Performance Test

See [MLU-OPS Performance Acceptance Standard](../docs/MLU-OPS-Performance-Acceptance-Standard.md) for details.

Platform :MLU270

|Operation|Mlu_hardware_time(us)|Mlu_interface_time(us)|Mlu_io_efficiency|Mlu_compute_efficiency|Mlu_workwpace_size(Bytes)|Data_type|Shape|
|-----|----|----|----|----|----|------|-----|
|op_name| | | | | | | |
|op_name| | | | | | | |

Platform :MLU290

|Operation|Mlu_hardware_time(us)|Mlu_interface_time(us)|Mlu_io_efficiency|Mlu_compute_efficiency|Mlu_workwpace_size(Bytes)|Data_type|Shape|
|-----|----|----|----|----|----|------|-----|
|op_name| | | | | | | |
|op_name| | | | | | | |

Platform:MLU370

|Operation|Mlu_hardware_time(us)|Mlu_interface_time(us)|Mlu_io_efficiency|Mlu_compute_efficiency|Mlu_workwpace_size(Bytes)|Data_type|Shape|
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bangcops_release_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
strategy:
matrix:
runner: [mlu270-x5k, mlu290-m5, mlu370-m8]
runner: [mlu370-m8]
os: [ubuntu18.04, ubuntu20.04, debian10, centos7, centos8]
runs-on: ${{matrix.runner}}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
runner: [mlu270-x5k, mlu290-m5, mlu370-m8]
runner: [mlu370-m8]
runs-on: ${{matrix.runner}}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
test:
strategy:
matrix:
runner: [mlu270-x5k, mlu290-m5, mlu370-m8]
runner: [mlu370-m8]
runs-on: ${{matrix.runner}}
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 1 addition & 3 deletions bangc-ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ endif()

if (NOT MLUOP_MLU_ARCH_LIST)
message(STATUS "build all arch")
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_270"
"--bang-mlu-arch=mtp_290"
"--bang-mlu-arch=mtp_372"
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_372"
"--bang-mlu-arch=mtp_592")
else()
foreach (arch ${MLUOP_MLU_ARCH_LIST})
Expand Down
9 changes: 3 additions & 6 deletions bangc-ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,14 @@

- 多MLU平台架构编译

- 当不指定架构时,默认编译支持`MLU270/MLU290/MLU370`板卡的 `libmluops.so`,运行时动态选择`MLU270/MLU290/MLU370`
- 当不指定架构时,默认编译支持`MLU370`板卡的 `libmluops.so`,运行时动态选择`MLU370`

- 编译指定MLU板卡

```sh
./build.sh # 编译多架构的版本,libmluops.so 体积较大,cncc使用多arch的cnfatbin封装
./build.sh --mlu270 # 编译 MLU270 板卡专用版本,cncc使用选项--bang-mlu-arch=mtp_270
./build.sh --mlu290 # 编译 MLU290 板卡专用版本,cncc使用选项--bang-mlu-arch=mtp_290
./build.sh --mlu370 # 编译 MLU370 板卡专用版本,cncc使用选项--bang-mlu-arch=mtp_372
./build.sh --mlu270 --filter="abs;expand" # mlu270 下编译 abs 算子和 expand 算子
./build.sh --mlu270 --mlu370 --filter="abs;expand" # mlu270 和 mlu370 下编译 abs 算子和 expand 算子
./build.sh --mlu370 --filter="abs;expand" # mlu370 下编译 abs 算子和 expand 算子
```

- kernel_depends.toml
Expand All @@ -91,7 +88,7 @@
| `NEUWARE_HOME` | 用户声明,或`source ../env.sh`设置 | neuware路径,包含cnrt,cndrv | `NEUWARE_HOME` | |
| `MLUOP_BUILD_COVERAGE_TEST` | OFF | 代码覆盖率测试 | `MLUOP_BUILD_COVERAGE_TEST` | -c<br />--coverage |
| `MLUOP_BUILD_ASAN_CHECK` | OFF | 开启ASAN内存检查工具 | `MLUOP_BUILD_ASAN_CHECK` | --asan |
| `MLUOP_MLU_ARCH_LIST` | `mtp_270/mtp_290/mtp_372` | 目标mlu架构列表,分号分割的字符串,如"mtp_270;mtp_372" | `MLUOP_MLU_ARCH_LIST` | --mlu270<br />--mlu290<br />--mlu370 |
| `MLUOP_MLU_ARCH_LIST` | `mtp_372` | 目标mlu架构列表,分号分割的字符串,如"mtp_372" | `MLUOP_MLU_ARCH_LIST` | --mlu370 |
| `MLUOP_BUILD_SPECIFIC_OP` || 编译指定的算子 | `MLUOP_BUILD_SPECIFIC_OP` | --filter |


Expand Down
12 changes: 6 additions & 6 deletions bangpy-ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,30 @@
## 运行测试用例
首先确定当前的测试平台,如 `mlu270`,`mlu290` 等,之后可以用如下几种命令对算子进行测试:
首先确定当前的测试平台,如 `mlu370`,之后可以用如下几种命令对算子进行测试:
- 测试ops目录下的全部算子
```sh
cd mlu-ops/bangpy-ops
./utils/test_operators.sh --target=mlu2xx
./utils/test_operators.sh --target=mlu3xx
```
- 使用 `--filter` 测试指定的一个或多个算子
```sh
cd mlu-ops/bangpy-ops
./utils/test_operators.sh --filter=axx,bxx,cxx --target=mlu2xx
./utils/test_operators.sh --filter=axx,bxx,cxx --target=mlu3xx
```
- 使用 `--opsfile` 从存放算子列表的文件中读取指定算子并进行测试
```sh
cd mlu-ops/bangpy-ops
./utils/test_operators.sh --opsfile=./ops_xxx.txt --target=mlu2xx
./utils/test_operators.sh --opsfile=./ops_xxx.txt --target=mlu3xx
```

`注意` :
- 如果将指定算子列表存放在文件中,其格式是每行一个算子。
- 该脚本默认是每个算子先进行编译,再进行测试,如果想跳过编译阶段而直接进行测试,那么请在保证已完成算子编译的情况下对以上三种不同的 `./utils/test_operators.sh` 调用加上 `--only_test` 选项,例如
```sh
cd mlu-ops/bangpy-ops
./utils/test_operators.sh --target=mlu2xx --only_test
./utils/test_operators.sh --target=mlu3xx --only_test
```
测试结果会在所有算子测试完毕后显示。

Expand All @@ -92,7 +92,7 @@
- 生成并测试该包含ops目录下全部算子的算子库文件
```sh
cd mlu-ops/bangpy-ops
./release.sh -r -t --target=mlu2xx
./release.sh -r -t --target=mlu3xx
```
- `--filter``--opsfile` 参数对该脚本同样适用
```sh
Expand Down
16 changes: 1 addition & 15 deletions docs/MLU-OPS-Test-Report-Template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

| 序号 | 需求 | 需求详情 |
|----------------|---------------------------|---------------------|
| 1 | 支持硬件 | MLU270 <br> MLU290 <br>MLU370|
| 1 | 支持硬件 | MLU370|
| 2 | job类型 | block <br> U1 <br> U4 |
| 3 | layout | 支持NHWC 、NCHW、ARRAY等layout |
| 4 | 多维 | 是否支持多维 |
Expand Down Expand Up @@ -56,20 +56,6 @@

详见:[MLU-OPS性能验收标准](./MLU-OPS-Performance-Acceptance-Standard.md)

平台:MLU270

|operator|mlu_hardware_time(us)|mlu_interface_time(us)|mlu_io_efficiency|mlu_compute_efficiency|mlu_workwpace_size(Bytes)|data_type|shape|
|-----|----|----|----|----|----|------|-----|
|op_name| | | | | | | |
|op_name| | | | | | | |

平台:MLU290

|operator|mlu_hardware_time(us)|mlu_interface_time(us)|mlu_io_efficiency|mlu_compute_efficiency|mlu_workwpace_size(Bytes)|data_type|shape|
|-----|----|----|----|----|----|------|-----|
|op_name| | | | | | | |
|op_name| | | | | | | |

平台:MLU370

|operator|mlu_hardware_time(us)|mlu_interface_time(us)|mlu_io_efficiency|mlu_compute_efficiency|mlu_workwpace_size(Bytes)|data_type|shape|
Expand Down

0 comments on commit 89f8e7a

Please sign in to comment.