| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[bugfix]解决测试用例导包失败的问题 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> # message auto-generated for no-merge-commit merge: !199 merge init into dev [bugfix]解决测试用例导包失败的问题 Created-by: mazhixin00_00 Commit-by: mazhixin00_00 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20251224 --> # Which issue(s) this PR fixes or accomplishes 有些环境,跑测试用例导包失败的问题  # Test Plan 全量测试 # Test Report  See merge request: Ascend/MindIE-SD!199 | 4 个月前 | |
【docs】文档修改-增加API参考&加速API Co-authored-by: xiao-qing123<xiaoqing14@h-partners.com> # message auto-generated for no-merge-commit merge: !263 merge dev into dev 【docs】文档修改-增加API参考&加速API Created-by: xiao-qing123 Commit-by: xiao-qing123 Merged-by: ascend-robot Description: fixes [#86](https://gitcode.com/Ascend/MindIE-SD/issues/86) 1、新增API参考(社区API接口) 2、新增加速API(原社区layer层) 3、删除readme中的快速入门和单多卡并行示例内容(有单独的quick_start承载) 4、算子融合单独拆分出来,在特性章节独立存在 5、删除特性章节目录名称中的“加速特性” 6、黄区大模型检测问题修改 See merge request: Ascend/MindIE-SD!263 | 3 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 7 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 | |
[Bugfix][SLA]Fallback to BlockSparseAttention V1 when V2 aclnn is unavailable Co-authored-by: yujunyu2<yujunyu3@huawei.com> # message auto-generated for no-merge-commit merge: !403 merge dev into dev [Bugfix][SLA]Fallback to BlockSparseAttention V1 when V2 aclnn is unavailable Created-by: yjy_ac Commit-by: yujunyu2 Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes Fixes #199 关联 Issue:https://gitcode.com/Ascend/MindIE-SD/issues/199 # Purpose 修复 BSA PyTorch 插件在**仅含 V1 aclnn 符号的老版本 CANN** 上无法运行的问题。 部分 CANN 环境(如 CANN 9.0.0)的 libopapi.so 只交付 aclnnBlockSparseAttention(V1),不包含 aclnnBlockSparseAttentionV2。若插件硬绑 V2,运行期会在 dlsym 阶段直接失败,导致 SLA 等依赖 block_sparse_attention 的推理路径完全不可用。 **本 PR 改动:** | 模块 | 文件 | 说明 | |------|------|------| | PyTorch 插件 | csrc/plugin/block_sparse_attention.cpp | 运行时通过 GetOpApiFuncAddr 探测 aclnnBlockSparseAttentionV2 是否存在于 libopapi.so;存在则走 V2(支持 BF16/FP16/FP8),不存在则回退 aclnnBlockSparseAttention(V1,仅 BF16/FP16) | | 单元测试 | tests/plugin/test_rf_v3_attention.py | 增加 _is_bsa_v2_available() 探测;老 CANN 无 V2 时自动 skip FP8 用例,避免误报失败 | **行为说明:** - V2 可用:优先调用 aclnnBlockSparseAttentionV2,保持 FP8 等新特性路径 - V2 不可用、V1 可用:回退 V1,BF16/FP16 输入可正常推理 - V2 不可用且输入为 FP8:显式 TORCH_CHECK 报错,提示需升级 CANN 或改用 BF16/FP16 # Test Plan 1. **编译验证** - 编译 PyTorch 插件(build/build_plugin.sh 或 python setup.py bdist_wheel) - 确认 libPTAExtensionOPS.so 正常生成 2. **老 CANN(仅 V1 BSA)环境验证** - 确认 libopapi.so 无 V2 符号: nm -D $ASCEND_HOME_PATH/aarch64-linux/lib64/libopapi.so | grep -E 'aclnnBlockSparseAttention(V2)?(GetWorkspaceSize)?$' - 运行 SLA 层测试: python3 -m pytest tests/layers/flash_attn/test_sparse_linear_attn.py -v - 运行 RF-V3 attention 插件测试(无 V2 时 FP8 用例应被 skip,不应出现 not in libopapi.so 失败): python3 -m pytest tests/plugin/test_rf_v3_attention.py -v 3. **新 CANN(含 V2 BSA)回归(可选)** - 同上两条 pytest,确认 V2 路径与 FP8 用例仍正常 # Test Report **测试环境:** CANN 9.0.0(libopapi.so 仅含 V1 BSA 符号),Ascend 950 NPU,Python 3.11.15,pytest 8.3.2,aarch64 | 测试项 | 命令 | 结果 | |--------|------|------| | SLA SparseLinearAttention 层测试 | pytest tests/layers/flash_attn/test_sparse_linear_attn.py | ✅ 35 passed in 33.93s | | RF-V3 BSA 插件测试(老 CANN 无 V2) | pytest tests/plugin/test_rf_v3_attention.py | ✅ 9 skipped in 9.73s(无 failed/error;FP8 相关用例在无 V2 环境下 skip) | **SLA 测试通过截图(V1 回退路径,35 passed):**  **RF-V3 测试截图(老 CANN 无 V2,FP8 用例 skip):**  See merge request: Ascend/MindIE-SD!403 | 23 天前 | |
[Test]Standardize test infrastructure and fix lint compliance across test suite Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !340 merge test_correct_0608 into dev [Test]Standardize test infrastructure and fix lint compliance across test suite Created-by: changetheway Commit-by: changetheway Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #179 # Purpose 1. **统一测试基础设施** - 新增 tests/conftest.py,通过 pytest 内置机制配置 sys.path 和 ASCEND_CUSTOM_OPP_PATH,替代各测试文件中散落的 sys.path.append / sys.path.insert - 同时将各测试文件中散落的 sys.path.append / sys.path.insert和 ASCEND_CUSTOM_OPP_PATH添加到run.py中和run_test.sh中 - 新增 tests/utils/utils/torch_npu_mock.py,抽取统一的 mock_torch_npu() 工具函数,替代 tests/run.py 和 tests/UT/run.py 中重复的内联 mock 逻辑 2. **修复 lint 合规性** - 移除所有测试文件中手动的 sys.path 操作(由 conftest.py 统一接管) - 添加 # pylint: disable=no-name-in-module 消除 NPU 模块 import 告警 - 统一 @unittest.skipIf 装饰器为多行格式 - 修复 import 排序、去除多余空行和尾逗号 3. **Pre-commit 配置对齐** - pre-commit/pyproject.toml:pylint disable 列表新增 duplicate-code ## 运行测试 ### 全量测试 ** 使用 run_test.sh(推荐,含覆盖率报告)** bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only ### 执行单个测试用例 方式一:使用 run_test.sh 指定文件 bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py 方式二:使用 pytest 方式 bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v # Test Plan 1. CPU 模式验证:MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU",确认 mock 机制正确加载 2. Lint 检查:pre-commit run --all-files,确认新增 disable 项生效且无新增告警 3. 构建验证:在 CANN 8.x 环境执行 bash build/build_ops.sh,确认 customize_transformer 目录自动创建 4. NPU 模式回归:python tests/run.py,确认全量测试无回归 # Test Report 全量UT测试:  See merge request: Ascend/MindIE-SD!340 | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 个月前 | ||
| 3 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 7 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 23 天前 | ||
| 1 个月前 |