diff --git a/guidelines/MindSpore_pull_request_specification_zh_cn.md b/guidelines/MindSpore_pull_request_specification_zh_cn.md index 244e3a3..6d90fb7 100644 --- a/guidelines/MindSpore_pull_request_specification_zh_cn.md +++ b/guidelines/MindSpore_pull_request_specification_zh_cn.md @@ -12,15 +12,15 @@ * 规范10:特性或bugfix必须补充用例(增量代码LLT覆盖率>=80%),如无用例,需澄清原因且经过committer认可 * 建议1:每个PR建议不超过200行代码(减掉用例代码) -# 用例上库规范 +## 用例上库规范 -- ST用例运行方式: MindSpore Python语言的ST用例仅支持pytest方式运行(不支持python直接运行),文件名以 `st_`开头,支持在一个文件中定义多个用例,门禁不支持传递参数,需要在用例中设置运行参数。 -- 目录结构: 存放在tests/st目录 -- 门禁使能: 在 `test_用例名称`的上面添加以下字段(注意事项:用例不要绑Device ID,直接使用Device ID就可以了) +* ST用例运行方式: MindSpore Python语言的ST用例仅支持pytest方式运行(不支持python直接运行),文件名以 `st_`开头,支持在一个文件中定义多个用例,门禁不支持传递参数,需要在用例中设置运行参数。 +* 目录结构: 存放在tests/st目录 +* 门禁使能: 在 `test_用例名称`的上面添加以下字段(注意事项:用例不要绑Device ID,直接使用Device ID就可以了) - - Ascend910 单P用例: + * Ascend910 单P用例: - ``` + ```python @pytest.mark.level0 # 说明: level0: 门禁构建用例 level1~level2: 版本构建用例 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @@ -29,9 +29,10 @@ xxx xxx ``` - - Ascend910 8P用例: - ``` + * Ascend910 8P用例: + + ```python @pytest.mark.level0 # 说明: level0: 门禁构建用例 level1~level2: 版本构建用例 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @@ -40,9 +41,10 @@ xxx xxx ``` - - GPU单P用例: - ``` + * GPU单P用例: + + ```python @pytest.mark.level0 # 说明: level0: 门禁构建用例 level1~level2: 版本构建用例 @pytest.mark.platform_x86_gpu_training # training 执行在Tesla V100; inference 执行在Tesla P4 (当前不提供) @pytest.mark.env_onecard # 说明: env_onecard为单P,env_single为8P @@ -50,9 +52,10 @@ xxx xxx ``` - - CPU用例: - ``` + * CPU用例: + + ```python @pytest.mark.level0 # 说明: level0: 门禁构建用例 level1~level2: 版本构建用例 @pytest.mark.platform_x86_cpu @pytest.mark.platform_arm_cpu @@ -61,9 +64,10 @@ xxx xxx ``` - - Ascend310 单P用例: - ``` + * Ascend310 单P用例: + + ```python @pytest.mark.level0 # 说明: level0: 门禁构建用例 level1~level2: 版本构建用例 @pytest.mark.platform_arm_ascend310_inference @pytest.mark.platform_x86_ascend310_inference @@ -72,24 +76,31 @@ xxx xxx ``` -- 导包规则 - - 调用 `tests/st/tbe_networks/resnet.py`中的 `resnet50`,则导入包名为: - ``` +* 导包规则 + + * 调用 `tests/st/tbe_networks/resnet.py`中的 `resnet50`,则导入包名为: + + ```python from test.st.tbe_networks.resnet import resnet50 ``` - - 调用 `models`目录中的包,导入包名为: - ``` + + * 调用 `models`目录中的包,导入包名为: + + ```python from models.bert.src.xxx ``` - - 调用 `example`目录中的包,导入包名为: - ``` + + * 调用 `example`目录中的包,导入包名为: + + ```python from example.xxx.xxx ``` -- 数据集约定目录 - - 输入数据集目录:`/home/workspace/mindspore_dataset` +* 数据集约定目录 + + * 输入数据集目录:`/home/workspace/mindspore_dataset` 例如: cifar10数据集:`/home/workspace/mindspore_dataset/cifar-10-batches-bin` - - 配置文件目录: `/home/workspace/mindspore_config` + * 配置文件目录: `/home/workspace/mindspore_config` 例如: `/home/workspace/mindspore_config/hccl/rank_table_8p.json` - - 注意事项: 数据集不要上库,找CIE存放在运行环境中 + * 注意事项: 数据集不要上库,找CIE存放在运行环境中