| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !266 merge refactor-tests into develop 【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Created-by: AvadaKedavrua Commit-by: liujiawang;AvadaKedavrua Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [x] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [x] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 现有 UT 目录混合了 smoke、regression、benchmark、模型配置资产和脚本测试,导致本地执行入口不统一、CI 无法稳定做增量选择,nightly 也缺少统一的 test_map 刷新和报告链路。旧的 tests/run_ut.sh 入口难以表达“快速 smoke / 完整 regression / benchmark / PR gate / nightly”这些不同场景,新增或删除源码时也缺少基于 test_map 的覆盖检查。 本 PR 目标是把测试体系拆成清晰分层,并补齐 CI gate、nightly、coverage gate、test_map 构建和文档,让开发者和流水线都能按同一套目录与脚本执行测试。同时修复整理过程中暴露出的少量模型配置、serving 输出文本和文档问题。 ------ ## 📝 Modification / 修改内容 本次按 hunk/主题重新整理为 17 个提交,主要修改如下: - 重构测试目录:将旧 tests/test_tensor_cast、serving_cast/tests、web_ui/tests、tests/tools、tests/perf_database、tests/st 拆分到 tests/smoke/、tests/regression/、tests/benchmark/。 - 统一测试资产:将模型配置移动到 tests/assets/model_config/,同步更新 pre-commit exclude、缓存目录和文档说明。 - 新增共享测试 helper:补充断言、配置工厂、fake subprocess、模型构造、op registry 等公共测试工具,减少测试重复代码。 - 新增 CI gate helper:增加 diff 分类、test_map 读取、AST 符号映射、coverage gate、增量测试选择和 gate policy 配置。 - 新增 nightly helper:增加 pytest 结果解析、报告模型、报告构建、Feishu webhook 通知、test_map 刷新和 benchmark 调度入口。 - 新增统一脚本入口:新增 scripts/run_smoke.sh、scripts/run_regression.sh、scripts/run_benchmark.sh、scripts/run_ci_gate.sh、scripts/run_nightly.sh,替换旧 tests/run_ut.sh。 - 更新配置与文档:补充 pyproject.toml 的 pytest marker/testpaths/filterwarnings,更新 README.md、tests/README.md、docs/en/web_ui.md、web_ui/README.md、tools/perf_data_collection/README.md。 - 修复模型/输出细节:为 DeepseekV32DecoderLayer 注册 config_class;规范 serving_cast optimizer summary 的冒号和 runner 日志文案。 ### 后续 UT 怎么上 - 新增快速兜底用例放到 tests/smoke/:覆盖导入、基础 compile path、轻量 config resolver、轻量 serving/tensor_cast 主路径,要求无 NPU、无大模型权重、反馈快,适合每个 PR 先跑。 - 新增功能回归用例放到 tests/regression/<domain>/:按 tensor_cast、serving_cast、cli、web_ui、scripts/helpers 等领域归档,覆盖具体 bugfix、边界条件、行为契约和工具脚本逻辑。 - 新增长耗时或性能相关用例放到 tests/benchmark/:模型基准、perf_database、trace/CSV 性能数据处理等不阻塞普通 PR gate 的测试归到 benchmark 层。 - 新增模型配置、fixture、样例数据优先放到 tests/assets/ 或就近 fixtures/,避免继续散落在测试包内部;大文件或生成缓存走 .msmodeling_cache/、tests/assets/cache/,不直接进入源码目录。 - 新测试默认使用 tests/helpers/ 的公共构造器和断言工具;需要 fake subprocess、模型配置、op registry 时复用已有 helper,减少每个测试重复 mock 和手写配置。 - 需要 NPU 的用例必须打 @pytest.mark.npu;只应 nightly 跑的大模型/长耗时 compile 用例打 @pytest.mark.nightly,避免进入默认本地和 PR 快速路径。 ### 怎么根据语义上 UT - 测试不再只按文件名机械归类,而是按“被测语义”挂到对应源码符号:产品源码的函数、类、方法、顶层行为需要在 test_map 中映射到验证它的测试 nodeid。 - 新增产品源码时,如果是可执行逻辑,应新增对应 smoke 或 regression 用例,并让 test_map 能找到该源码/符号;确实不需要测试的符号需要在 exemption 中写明原因。 - 修改已有源码时,CI gate 会用 AST 定位变更行落在哪个 top-level definition 或 class/method span,再通过 test_map 选择关联测试;如果符号没有映射,会阻断或扩大测试范围,避免“改了逻辑但没跑语义相关 UT”。 - 删除源码时,CI gate 会检查 test_map 中是否仍有引用该源码的测试,防止遗留无效映射;删除测试时也会检查是否破坏已有源码覆盖关系。 - 跨层依赖变更会按语义优先选择所属 regression layer,无法明确归属或配置变更时升级为更完整的套件,保证增量选择不会漏测。 - test_map 由 nightly 在完整测试通过后刷新,PR gate 消费稳定版本;这样避免每个 PR 临时生成不可信映射,同时让语义映射随主干测试演进。 ### 流水线做了什么调整 - 本地与 CI 统一入口:run_smoke.sh 跑快速 smoke,run_regression.sh 跑完整 regression,run_benchmark.sh 跑 benchmark,run_ci_gate.sh 跑 PR 增量门禁,run_nightly.sh 跑夜间全流程。 - PR gate 从“固定跑一批 UT”改为“diff -> classify changes -> load test_map -> apply gate rules -> run selected pytest -> coverage gate”。配置变更、源码新增/删除、测试新增/删除、源码修改会走不同 gate 规则。 - coverage gate 统一读取 MSMODELING_TEST_LINE_THRESHOLD 和 MSMODELING_TEST_BRANCH_THRESHOLD,默认 line 70、branch 50;pytest 默认排除 npu,PR gate 额外排除 nightly。 - nightly 分两阶段:先跑非 NPU、非 nightly 的 smoke/regression 并在通过后刷新 test_map;再跑 nightly 标记用例与 benchmark,并构建结构化报告。 - 流水线统一支持 MSMODELING_OFFLINE、MSMODELING_TEST_WEIGHTS_PRUNE、MSMODELING_TEST_MAP_PATH 等环境变量,减少不同脚本各自处理缓存、离线和权重清理的差异。 - benchmark 不纳入普通 coverage gate,避免性能/长耗时用例拖慢 PR 门禁;必要时可通过独立 benchmark pipeline 或 nightly 验证。 - pre-commit exclude 同步到新目录,模型配置资产和 fixtures 不再被无意义格式化或误报。 已处理问题清单: - 旧 UT 入口单一,无法区分 smoke、regression、benchmark、nightly 和 PR gate。 - 模型配置资产散落在测试用例目录下,pre-commit 与测试引用路径容易漂移。 - 新增/删除源码缺少 test_map 覆盖检查,CI 不能精准阻断未补测试的变更。 - coverage 阈值、pytest marker、离线模式、权重缓存清理等 CI 参数缺少统一入口。 - nightly 缺少结构化报告、失败摘要和 Feishu 通知链路。 - web UI 测试仍在模块内,未纳入统一 regression 层级。 - DeepseekV32DecoderLayer 缺少 config_class,影响配置类识别一致性。 - serving_cast 部分日志/summary 文案有多余空格或表达不统一。 ------ ## 📐 Associated Test Results / 关联测试结果 提交过程中每个 commit 均触发 pre-commit hook,已通过已检查文件的 trailing whitespace、EOF、YAML/JSON、大文件、merge conflict、private key、ruff、ruff-format、codespell、pylint、bandit、typos 等检查。 本地未额外执行完整 smoke/regression/benchmark 全量测试;推送后以 GitCode CI 结果为准。建议重点关注: - bash ./scripts/run_smoke.sh - bash ./scripts/run_regression.sh - bash ./scripts/run_ci_gate.sh(需设置 MSMODELING_TEST_MAP_PATH) - bash ./scripts/run_nightly.sh(需设置 MSMODELING_TEST_MAP_PATH) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - 本地快速验证:开发者运行 bash ./scripts/run_smoke.sh 获取快速反馈。 - 本地完整回归:开发者运行 bash ./scripts/run_regression.sh 覆盖主要回归用例。 - PR 增量门禁:CI 设置 MSMODELING_TEST_MAP_PATH 后运行 bash ./scripts/run_ci_gate.sh,按 diff 与 test_map 选择用例并执行 coverage gate。 - 夜间任务:nightly 先跑非 nightly 的 smoke/regression 并刷新 test_map,再执行 nightly/benchmark 并生成报告,可选 Feishu 通知。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!266 | 27 天前 | |
[feat] 补充serving_cast/scripts/cli的ut用例 Co-authored-by: wendellX<wenxiaoping6@huawei.com> # message auto-generated for no-merge-commit merge: !300 merge ut_serve_cast into develop [feat] 补充serving_cast/scripts/cli的ut用例 Created-by: wendellX Commit-by: wendellX Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!300 | 22 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !266 merge refactor-tests into develop 【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Created-by: AvadaKedavrua Commit-by: liujiawang;AvadaKedavrua Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [x] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [x] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 现有 UT 目录混合了 smoke、regression、benchmark、模型配置资产和脚本测试,导致本地执行入口不统一、CI 无法稳定做增量选择,nightly 也缺少统一的 test_map 刷新和报告链路。旧的 tests/run_ut.sh 入口难以表达“快速 smoke / 完整 regression / benchmark / PR gate / nightly”这些不同场景,新增或删除源码时也缺少基于 test_map 的覆盖检查。 本 PR 目标是把测试体系拆成清晰分层,并补齐 CI gate、nightly、coverage gate、test_map 构建和文档,让开发者和流水线都能按同一套目录与脚本执行测试。同时修复整理过程中暴露出的少量模型配置、serving 输出文本和文档问题。 ------ ## 📝 Modification / 修改内容 本次按 hunk/主题重新整理为 17 个提交,主要修改如下: - 重构测试目录:将旧 tests/test_tensor_cast、serving_cast/tests、web_ui/tests、tests/tools、tests/perf_database、tests/st 拆分到 tests/smoke/、tests/regression/、tests/benchmark/。 - 统一测试资产:将模型配置移动到 tests/assets/model_config/,同步更新 pre-commit exclude、缓存目录和文档说明。 - 新增共享测试 helper:补充断言、配置工厂、fake subprocess、模型构造、op registry 等公共测试工具,减少测试重复代码。 - 新增 CI gate helper:增加 diff 分类、test_map 读取、AST 符号映射、coverage gate、增量测试选择和 gate policy 配置。 - 新增 nightly helper:增加 pytest 结果解析、报告模型、报告构建、Feishu webhook 通知、test_map 刷新和 benchmark 调度入口。 - 新增统一脚本入口:新增 scripts/run_smoke.sh、scripts/run_regression.sh、scripts/run_benchmark.sh、scripts/run_ci_gate.sh、scripts/run_nightly.sh,替换旧 tests/run_ut.sh。 - 更新配置与文档:补充 pyproject.toml 的 pytest marker/testpaths/filterwarnings,更新 README.md、tests/README.md、docs/en/web_ui.md、web_ui/README.md、tools/perf_data_collection/README.md。 - 修复模型/输出细节:为 DeepseekV32DecoderLayer 注册 config_class;规范 serving_cast optimizer summary 的冒号和 runner 日志文案。 ### 后续 UT 怎么上 - 新增快速兜底用例放到 tests/smoke/:覆盖导入、基础 compile path、轻量 config resolver、轻量 serving/tensor_cast 主路径,要求无 NPU、无大模型权重、反馈快,适合每个 PR 先跑。 - 新增功能回归用例放到 tests/regression/<domain>/:按 tensor_cast、serving_cast、cli、web_ui、scripts/helpers 等领域归档,覆盖具体 bugfix、边界条件、行为契约和工具脚本逻辑。 - 新增长耗时或性能相关用例放到 tests/benchmark/:模型基准、perf_database、trace/CSV 性能数据处理等不阻塞普通 PR gate 的测试归到 benchmark 层。 - 新增模型配置、fixture、样例数据优先放到 tests/assets/ 或就近 fixtures/,避免继续散落在测试包内部;大文件或生成缓存走 .msmodeling_cache/、tests/assets/cache/,不直接进入源码目录。 - 新测试默认使用 tests/helpers/ 的公共构造器和断言工具;需要 fake subprocess、模型配置、op registry 时复用已有 helper,减少每个测试重复 mock 和手写配置。 - 需要 NPU 的用例必须打 @pytest.mark.npu;只应 nightly 跑的大模型/长耗时 compile 用例打 @pytest.mark.nightly,避免进入默认本地和 PR 快速路径。 ### 怎么根据语义上 UT - 测试不再只按文件名机械归类,而是按“被测语义”挂到对应源码符号:产品源码的函数、类、方法、顶层行为需要在 test_map 中映射到验证它的测试 nodeid。 - 新增产品源码时,如果是可执行逻辑,应新增对应 smoke 或 regression 用例,并让 test_map 能找到该源码/符号;确实不需要测试的符号需要在 exemption 中写明原因。 - 修改已有源码时,CI gate 会用 AST 定位变更行落在哪个 top-level definition 或 class/method span,再通过 test_map 选择关联测试;如果符号没有映射,会阻断或扩大测试范围,避免“改了逻辑但没跑语义相关 UT”。 - 删除源码时,CI gate 会检查 test_map 中是否仍有引用该源码的测试,防止遗留无效映射;删除测试时也会检查是否破坏已有源码覆盖关系。 - 跨层依赖变更会按语义优先选择所属 regression layer,无法明确归属或配置变更时升级为更完整的套件,保证增量选择不会漏测。 - test_map 由 nightly 在完整测试通过后刷新,PR gate 消费稳定版本;这样避免每个 PR 临时生成不可信映射,同时让语义映射随主干测试演进。 ### 流水线做了什么调整 - 本地与 CI 统一入口:run_smoke.sh 跑快速 smoke,run_regression.sh 跑完整 regression,run_benchmark.sh 跑 benchmark,run_ci_gate.sh 跑 PR 增量门禁,run_nightly.sh 跑夜间全流程。 - PR gate 从“固定跑一批 UT”改为“diff -> classify changes -> load test_map -> apply gate rules -> run selected pytest -> coverage gate”。配置变更、源码新增/删除、测试新增/删除、源码修改会走不同 gate 规则。 - coverage gate 统一读取 MSMODELING_TEST_LINE_THRESHOLD 和 MSMODELING_TEST_BRANCH_THRESHOLD,默认 line 70、branch 50;pytest 默认排除 npu,PR gate 额外排除 nightly。 - nightly 分两阶段:先跑非 NPU、非 nightly 的 smoke/regression 并在通过后刷新 test_map;再跑 nightly 标记用例与 benchmark,并构建结构化报告。 - 流水线统一支持 MSMODELING_OFFLINE、MSMODELING_TEST_WEIGHTS_PRUNE、MSMODELING_TEST_MAP_PATH 等环境变量,减少不同脚本各自处理缓存、离线和权重清理的差异。 - benchmark 不纳入普通 coverage gate,避免性能/长耗时用例拖慢 PR 门禁;必要时可通过独立 benchmark pipeline 或 nightly 验证。 - pre-commit exclude 同步到新目录,模型配置资产和 fixtures 不再被无意义格式化或误报。 已处理问题清单: - 旧 UT 入口单一,无法区分 smoke、regression、benchmark、nightly 和 PR gate。 - 模型配置资产散落在测试用例目录下,pre-commit 与测试引用路径容易漂移。 - 新增/删除源码缺少 test_map 覆盖检查,CI 不能精准阻断未补测试的变更。 - coverage 阈值、pytest marker、离线模式、权重缓存清理等 CI 参数缺少统一入口。 - nightly 缺少结构化报告、失败摘要和 Feishu 通知链路。 - web UI 测试仍在模块内,未纳入统一 regression 层级。 - DeepseekV32DecoderLayer 缺少 config_class,影响配置类识别一致性。 - serving_cast 部分日志/summary 文案有多余空格或表达不统一。 ------ ## 📐 Associated Test Results / 关联测试结果 提交过程中每个 commit 均触发 pre-commit hook,已通过已检查文件的 trailing whitespace、EOF、YAML/JSON、大文件、merge conflict、private key、ruff、ruff-format、codespell、pylint、bandit、typos 等检查。 本地未额外执行完整 smoke/regression/benchmark 全量测试;推送后以 GitCode CI 结果为准。建议重点关注: - bash ./scripts/run_smoke.sh - bash ./scripts/run_regression.sh - bash ./scripts/run_ci_gate.sh(需设置 MSMODELING_TEST_MAP_PATH) - bash ./scripts/run_nightly.sh(需设置 MSMODELING_TEST_MAP_PATH) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - 本地快速验证:开发者运行 bash ./scripts/run_smoke.sh 获取快速反馈。 - 本地完整回归:开发者运行 bash ./scripts/run_regression.sh 覆盖主要回归用例。 - PR 增量门禁:CI 设置 MSMODELING_TEST_MAP_PATH 后运行 bash ./scripts/run_ci_gate.sh,按 diff 与 test_map 选择用例并执行 coverage gate。 - 夜间任务:nightly 先跑非 nightly 的 smoke/regression 并刷新 test_map,再执行 nightly/benchmark 并生成报告,可选 Feishu 通知。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!266 | 27 天前 | |
feat(deps): adopt uv lockfile for reproducible dependency management Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !267 merge uv into develop feat(deps): adopt uv lockfile for reproducible dependency management Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** msmodeling 是 **CPU 仿真**框架,但依赖 Python / PyTorch / Transformers 强耦合,现有 pip install -r requirements.txt 带来大量环境类问题: | 痛点 | 现状 | | --- | --- | | 版本不可复现 | 无 lockfile,每人/每次 CI 解析结果不同,issue 难复现 | | CUDA wheel 误装 | CPU 仿真却默认拉 multi-GB CUDA PyTorch,安装慢 | | Python 版本分裂 | 原 >=3.9 与 Transformers 5.x(需 ≥3.10)冲突 | | 依赖源漂移 | requirements.txt 与运行时行为不一致;check_dependencies() 静默 pip install 覆盖用户环境 | | **PyTorch 生态版本匹配** | 装好 torch 后,再装 torchvision 等组件需上网查兼容版本,费时易错 | | **手写 manifest** | 新加依赖需手改 pyproject.toml / requirements.txt,易 typo、漏约束 | **本 PR 目标**:引入 **uv + 纳入版本库的 uv.lock** 作为可复现依赖契约,同时保留 requirements.txt 作为 pip 兼容路径。 **uv / uv.lock 价值(本 PR 核心)** 1. **可复现** — uv.lock 锁定完整传递依赖树(含 hash);开发、CI、维护者对照同一份版本基线。 2. **CPU-only PyTorch** — pyproject.toml 通过 [tool.uv.sources] 走官方 CPU index(torch / torchvision)。 3. **受控升级** — manifest 声明 bounds;具体版本由 lock 固定;升级需 uv lock + PR 审查。 4. **CI 防漂移** — 所有 run_*.sh 经 common.sh 执行 uv sync --frozen --group ci。 5. **双路径兼容** — README 推荐 uv;pip + requirements.txt 仍可用(无 lock,有意接受漂移)。 **uv add 工作流价值** | 场景 | 以前 | 现在 | | --- | --- | --- | | 新增依赖 | 手改 manifest + 自行查 torch/torchvision 兼容版本 | uv add <pkg> 一次完成解析、写 manifest、更新 lock | | 本地包开发 | 手配 -e | uv add --editable ./path | | 临时试验 | 污染 venv 或忘记卸载 | uv run --with <pkg> … 不改 lockfile | 示例:本 PR 通过 uv add torchvision 加入依赖——工具层未直接调用,但部分模型底层会 import torchvision;resolver 自动匹配与 locked torch 兼容的 0.25.0。 **为何将 uv.lock 纳入版本库(而非仅自动解析)** msmodeling 是克隆即运行的**应用/工具仓库**,不是发布到 PyPI 供下游再锁版本的 library。若不上库 lock、每次 uv sync 自动重新解析: | | **上库 uv.lock(本 PR)** | **不上库、自动解析** | | --- | --- | --- | | 可复现性 | 全树 pinned,issue 可对照 lock 复现 | 随 PyPI/时间变化,「我这边能跑」类 issue 复发 | | CI | --frozen 保证 manifest/lock 同步 | 须去掉 --frozen,CI 结果非确定 | | 升级 | 改 bounds → uv lock → 审 lock diff | 隐式升级,难追溯 | | 与 pip 路径关系 | lock = 开发/CI 真相;requirements.txt = 无 lock 的兼容退路 | 两条路径都不可复现 | **结论**:uv.lock **必须上库**;否则 uv 只剩「安装快」,无法解决版本漂移根因,且与现有 --frozen CI 矛盾。 **Lockfile 维护约定**:依赖变更 PR 须同时提交 pyproject.toml + uv.lock;优先 uv add;冲突时 rebase 后 uv lock,勿手改 lock。 Related: [#69](https://gitcode.com/Ascend/msmodeling/issues/69), RFC [docs/RFC/rfc_uv_dependency_management_en.md](docs/RFC/rfc_uv_dependency_management_en.md) **Out of scope**: NPU torch-npu 依赖 — 后续通过华为云源统一绑定。 ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** - **pyproject.toml + uv.lock(上库)** — 运行时依赖;CPU index 路由 torch / torchvision;lint / ci groups - **新增 torchvision>=0.25.0** — 模型 import 路径需要;经 uv add 解析并与 locked torch 对齐 - **.pre-commit-config.yaml** — uv.lock 排除 large-file 检查 - **移除 check_dependencies()** — 版本由 uv / lockfile 管理 - **scripts/lib/common.sh** — uv sync --frozen --group ci(所有 run_*.sh) - **requirements.txt** — 对齐 bounds,含 torchvision;pip 退路 - **RFC** — 补充 uv add / --editable / --with 及 PyTorch 生态匹配痛点 ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** - 本地 uv sync --frozen --group ci 通过 - CodeArts pipeline 已触发验证(docs-ci-pipeline-success) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** **推荐(uv + 上库 lockfile)** bash pip install uv uv venv --python 3.13 .venv && source .venv/bin/activate uv sync uv add torchvision # 新增依赖:自动匹配 torch 版本并更新 lock uv run python -m cli.inference.text_generate --help **临时试验(不改 lock)** bash uv run --with some-package python -c "import some_package" **CI / 本地测试入口** bash bash scripts/run_smoke.sh # common.sh → uv sync --frozen --group ci **pip 兼容(无 lock)** bash pip install "torch>=2.7,<=2.10" "torchvision>=0.25.0" --index-url https://download.pytorch.org/whl/cpu pip install -r requirements.txt ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!267 | 24 天前 | |
【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !266 merge refactor-tests into develop 【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Created-by: AvadaKedavrua Commit-by: liujiawang;AvadaKedavrua Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [x] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [x] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 现有 UT 目录混合了 smoke、regression、benchmark、模型配置资产和脚本测试,导致本地执行入口不统一、CI 无法稳定做增量选择,nightly 也缺少统一的 test_map 刷新和报告链路。旧的 tests/run_ut.sh 入口难以表达“快速 smoke / 完整 regression / benchmark / PR gate / nightly”这些不同场景,新增或删除源码时也缺少基于 test_map 的覆盖检查。 本 PR 目标是把测试体系拆成清晰分层,并补齐 CI gate、nightly、coverage gate、test_map 构建和文档,让开发者和流水线都能按同一套目录与脚本执行测试。同时修复整理过程中暴露出的少量模型配置、serving 输出文本和文档问题。 ------ ## 📝 Modification / 修改内容 本次按 hunk/主题重新整理为 17 个提交,主要修改如下: - 重构测试目录:将旧 tests/test_tensor_cast、serving_cast/tests、web_ui/tests、tests/tools、tests/perf_database、tests/st 拆分到 tests/smoke/、tests/regression/、tests/benchmark/。 - 统一测试资产:将模型配置移动到 tests/assets/model_config/,同步更新 pre-commit exclude、缓存目录和文档说明。 - 新增共享测试 helper:补充断言、配置工厂、fake subprocess、模型构造、op registry 等公共测试工具,减少测试重复代码。 - 新增 CI gate helper:增加 diff 分类、test_map 读取、AST 符号映射、coverage gate、增量测试选择和 gate policy 配置。 - 新增 nightly helper:增加 pytest 结果解析、报告模型、报告构建、Feishu webhook 通知、test_map 刷新和 benchmark 调度入口。 - 新增统一脚本入口:新增 scripts/run_smoke.sh、scripts/run_regression.sh、scripts/run_benchmark.sh、scripts/run_ci_gate.sh、scripts/run_nightly.sh,替换旧 tests/run_ut.sh。 - 更新配置与文档:补充 pyproject.toml 的 pytest marker/testpaths/filterwarnings,更新 README.md、tests/README.md、docs/en/web_ui.md、web_ui/README.md、tools/perf_data_collection/README.md。 - 修复模型/输出细节:为 DeepseekV32DecoderLayer 注册 config_class;规范 serving_cast optimizer summary 的冒号和 runner 日志文案。 ### 后续 UT 怎么上 - 新增快速兜底用例放到 tests/smoke/:覆盖导入、基础 compile path、轻量 config resolver、轻量 serving/tensor_cast 主路径,要求无 NPU、无大模型权重、反馈快,适合每个 PR 先跑。 - 新增功能回归用例放到 tests/regression/<domain>/:按 tensor_cast、serving_cast、cli、web_ui、scripts/helpers 等领域归档,覆盖具体 bugfix、边界条件、行为契约和工具脚本逻辑。 - 新增长耗时或性能相关用例放到 tests/benchmark/:模型基准、perf_database、trace/CSV 性能数据处理等不阻塞普通 PR gate 的测试归到 benchmark 层。 - 新增模型配置、fixture、样例数据优先放到 tests/assets/ 或就近 fixtures/,避免继续散落在测试包内部;大文件或生成缓存走 .msmodeling_cache/、tests/assets/cache/,不直接进入源码目录。 - 新测试默认使用 tests/helpers/ 的公共构造器和断言工具;需要 fake subprocess、模型配置、op registry 时复用已有 helper,减少每个测试重复 mock 和手写配置。 - 需要 NPU 的用例必须打 @pytest.mark.npu;只应 nightly 跑的大模型/长耗时 compile 用例打 @pytest.mark.nightly,避免进入默认本地和 PR 快速路径。 ### 怎么根据语义上 UT - 测试不再只按文件名机械归类,而是按“被测语义”挂到对应源码符号:产品源码的函数、类、方法、顶层行为需要在 test_map 中映射到验证它的测试 nodeid。 - 新增产品源码时,如果是可执行逻辑,应新增对应 smoke 或 regression 用例,并让 test_map 能找到该源码/符号;确实不需要测试的符号需要在 exemption 中写明原因。 - 修改已有源码时,CI gate 会用 AST 定位变更行落在哪个 top-level definition 或 class/method span,再通过 test_map 选择关联测试;如果符号没有映射,会阻断或扩大测试范围,避免“改了逻辑但没跑语义相关 UT”。 - 删除源码时,CI gate 会检查 test_map 中是否仍有引用该源码的测试,防止遗留无效映射;删除测试时也会检查是否破坏已有源码覆盖关系。 - 跨层依赖变更会按语义优先选择所属 regression layer,无法明确归属或配置变更时升级为更完整的套件,保证增量选择不会漏测。 - test_map 由 nightly 在完整测试通过后刷新,PR gate 消费稳定版本;这样避免每个 PR 临时生成不可信映射,同时让语义映射随主干测试演进。 ### 流水线做了什么调整 - 本地与 CI 统一入口:run_smoke.sh 跑快速 smoke,run_regression.sh 跑完整 regression,run_benchmark.sh 跑 benchmark,run_ci_gate.sh 跑 PR 增量门禁,run_nightly.sh 跑夜间全流程。 - PR gate 从“固定跑一批 UT”改为“diff -> classify changes -> load test_map -> apply gate rules -> run selected pytest -> coverage gate”。配置变更、源码新增/删除、测试新增/删除、源码修改会走不同 gate 规则。 - coverage gate 统一读取 MSMODELING_TEST_LINE_THRESHOLD 和 MSMODELING_TEST_BRANCH_THRESHOLD,默认 line 70、branch 50;pytest 默认排除 npu,PR gate 额外排除 nightly。 - nightly 分两阶段:先跑非 NPU、非 nightly 的 smoke/regression 并在通过后刷新 test_map;再跑 nightly 标记用例与 benchmark,并构建结构化报告。 - 流水线统一支持 MSMODELING_OFFLINE、MSMODELING_TEST_WEIGHTS_PRUNE、MSMODELING_TEST_MAP_PATH 等环境变量,减少不同脚本各自处理缓存、离线和权重清理的差异。 - benchmark 不纳入普通 coverage gate,避免性能/长耗时用例拖慢 PR 门禁;必要时可通过独立 benchmark pipeline 或 nightly 验证。 - pre-commit exclude 同步到新目录,模型配置资产和 fixtures 不再被无意义格式化或误报。 已处理问题清单: - 旧 UT 入口单一,无法区分 smoke、regression、benchmark、nightly 和 PR gate。 - 模型配置资产散落在测试用例目录下,pre-commit 与测试引用路径容易漂移。 - 新增/删除源码缺少 test_map 覆盖检查,CI 不能精准阻断未补测试的变更。 - coverage 阈值、pytest marker、离线模式、权重缓存清理等 CI 参数缺少统一入口。 - nightly 缺少结构化报告、失败摘要和 Feishu 通知链路。 - web UI 测试仍在模块内,未纳入统一 regression 层级。 - DeepseekV32DecoderLayer 缺少 config_class,影响配置类识别一致性。 - serving_cast 部分日志/summary 文案有多余空格或表达不统一。 ------ ## 📐 Associated Test Results / 关联测试结果 提交过程中每个 commit 均触发 pre-commit hook,已通过已检查文件的 trailing whitespace、EOF、YAML/JSON、大文件、merge conflict、private key、ruff、ruff-format、codespell、pylint、bandit、typos 等检查。 本地未额外执行完整 smoke/regression/benchmark 全量测试;推送后以 GitCode CI 结果为准。建议重点关注: - bash ./scripts/run_smoke.sh - bash ./scripts/run_regression.sh - bash ./scripts/run_ci_gate.sh(需设置 MSMODELING_TEST_MAP_PATH) - bash ./scripts/run_nightly.sh(需设置 MSMODELING_TEST_MAP_PATH) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - 本地快速验证:开发者运行 bash ./scripts/run_smoke.sh 获取快速反馈。 - 本地完整回归:开发者运行 bash ./scripts/run_regression.sh 覆盖主要回归用例。 - PR 增量门禁:CI 设置 MSMODELING_TEST_MAP_PATH 后运行 bash ./scripts/run_ci_gate.sh,按 diff 与 test_map 选择用例并执行 coverage gate。 - 夜间任务:nightly 先跑非 nightly 的 smoke/regression 并刷新 test_map,再执行 nightly/benchmark 并生成报告,可选 Feishu 通知。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!266 | 27 天前 | |
【FIX】【TEST】修复 README/文档失效链接并默认运行完整 benchmark 套件 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !331 merge fix into develop 【FIX】【TEST】修复 README/文档失效链接并默认运行完整 benchmark 套件 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 修改原因 1. README.md 社区区公众号二维码指向 msinsight 仓库旧路径,资源已 404,用户扫码/预览失败。 2. OP_PLUGIN_MAPPING_TUTORIAL.md 中 Op Mapping skill 相对路径错误,文档内链接跳转失败。 3. benchmark 入口默认只跑 tests/benchmark/ops/,tests/benchmark/models/ 模型回归被静默跳过,CI/nightly 覆盖不足。 4. 全量 benchmark 启用后,qwen3-30b-a3b decode/prefill baseline 与当前 compile 输出不一致,需刷新。 --- ## 修改内容 | 类别 | 文件 | 变更 | |------|------|------| | 文档链接 | README.md | 公众号图片 URL 换为可用 user-images 资源;TOC 补全 Contributions / Community 等章节锚点 | | 文档链接 | docs/perf_database/tutorial/OP_PLUGIN_MAPPING_TUTORIAL.md | skill 路径 ../skills/... → ../../../.agents/skills/op-mapping/SKILL.md | | benchmark 默认行为 | scripts/run_benchmark.sh、scripts/helpers/nightly/main.py | 移除 MSMODELING_BENCHMARK_MODELS 开关,固定跑 tests/benchmark/ 全目录 | | 设计文档 | docs/design/ut_refactor.md | 同步 benchmark phase 描述 | | baseline | tests/benchmark/models/cases/qwen3-30b-a3b-{decode,prefill}.json | 刷新 baseline_time_s 与 operator top-N | | lint | experimental/optix/、scripts/、tensor_cast/、tests/ 等 | 为 inspect.* 误报补 pylint: disable 注释 | --- ## 自验证 ### README 公众号图片链接 目的:确认旧链接 404、新链接可访问。 步骤: 1. 检查旧 URL HTTP 状态 2. 检查新 URL HTTP 状态 bash curl -sI "https://raw.gitcode.com/Ascend/msinsight/raw/master/docs/zh/user_guide/figures/readme/officialAccount.jpg" | head -1 curl -sI "https://raw.gitcode.com/user-images/assets/8428112/2a22a707-de26-4bb3-b312-4952035e021b/30be980e7fd65b2486d251b48a7999f3.jpg" | head -1 结果: text HTTP/1.1 404 Not Found HTTP/1.1 200 OK ### Op Mapping skill 文档路径 目的:确认教程内链接指向真实文件。 步骤: 1. 在仓库根目录检查 skill 文件是否存在 bash test -f .agents/skills/op-mapping/SKILL.md && echo OK 结果: text OK ### Benchmark 入口默认全量 目的:确认 run_benchmark.sh 不再依赖 MSMODELING_BENCHMARK_MODELS,默认覆盖 models 子目录。 步骤: 1. 查看脚本 benchmark target 配置 bash grep -n "TESTS_BENCHMARK" scripts/run_benchmark.sh 结果: text run_pytest "${TESTS_BENCHMARK}/" \ ### CI 流水线 目的:确认改动未破坏现有 CI/docs CI。 步骤: 1. 查看 PR #331 CI label 状态 结果:PR 已打标 ci-pipeline-passed、docs-ci-pipeline-success。 See merge request: Ascend/msmodeling!331 | 17 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
【FEAT】MindStudio CLI 统一 stderr Logo Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !307 merge feat-logo into develop 【FEAT】MindStudio CLI 统一 stderr Logo Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 修改原因 MindStudio Modeling 各 Python CLI 启动时缺少统一品牌标识,用户在仿真、吞吐寻优、适配与 profiling 工具间切换时难以从终端首屏确认产品归属。本 PR 在 parse_args 成功后向 stderr 输出固定四行 MindStudio Logo,并支持 TTY/TERM 降级与 Windows colorama 控制台初始化。 --- ## 修改内容 - 新增共享模块 cli/logo.py:render_logo / print_logo,65 列块 + 终端居中 + ANSI/纯文本降级 - 在 11 个 Python 入口(cli/inference/*、serving_cast/main.py、tools/perf_data_collection 驱动脚本)于 parse_args 后调用 print_logo();--help 路径不输出 Logo - 依赖: - **运行时** colorama>=0.4.6 — 写入 [project] dependencies 与 requirements.txt,Windows 上调用 just_fix_windows_console() 启用控制台 VT/ANSI 输出 - **CI 静态检查** types-colorama>=0.4.15 — 写入 [dependency-groups] ci,见下方说明 - 详设文档:docs/design/mindstudio-brand-logo-design.md(本仓仅 Python 范围) - 测试:tests/regression/cli/test_logo.py(14 条模块 UT)+ tests/regression/cli/test_logo_cli_hooks.py(help 抑制与入口 hook 回归,in-process run_module_main) ### 为何需要 types-colorama(CI 组,非运行时) cli/logo.py 在 Windows 路径下会调用 colorama.just_fix_windows_console()。colorama 包本身未提供完整的 inline 类型注解,mypy / 仓库 type_check 在无 stub 时会报 *Cannot find implementation or library stub for module named "colorama"*,或将其视为 untyped 调用。 types-colorama 是社区维护的 **PEP 561 stub 包**(.pyi),仅用于开发态与 CI 的类型检查,**不会**随默认 uv sync 进入用户仿真运行时环境(位于 dependency-groups.ci,与 pytest-cov 等工具同属 CI 组)。 加入该依赖的目的: 1. 让 uv sync --group ci + mypy 能正确解析 colorama API,满足本 PR 静态检查门禁,**无需**在业务代码中使用 # type: ignore 绕过规范 2. 与项目现有做法一致:第三方库缺类型时,在 ci 组补 types-* stub,而非放宽 mypy 配置 若仅安装运行时依赖(uv sync / pip install -r requirements.txt),**不需要**也**不会**安装 types-colorama;Logo 功能仅依赖运行时 colorama。 --- ## 自验证 ### Logo 四行块渲染(纯文本 / 80 列居中) 目的:确认固定四行布局、品牌行与 Slogan 居中、无前置空行。 步骤: 1. 在仓库根目录执行: bash uv run python -c "from cli.logo import render_logo; print(render_logo(color=False, terminal_cols=80))" 结果:  ### Logo 模块 + CLI hook 回归测试 目的:满足 CI Gate 对新增 print_logo 路径的覆盖;确认 --help 不泄漏 Logo,正常 parse_args 后 stderr 含品牌块。 步骤: 1. 在仓库根目录执行: bash uv run pytest tests/regression/cli/test_logo.py tests/regression/cli/test_logo_cli_hooks.py -v --tb=no 结果:  ### --help 不输出 Logo 目的:确认 argparse 在 print_logo 之前退出,help 路径保持干净。 步骤: 1. 执行: bash uv run python -m cli.inference.text_generate --help 2>&1 | head -5 结果:  ### 端到端  See merge request: Ascend/msmodeling!307 | 19 天前 | |
【FEAT】MindStudio CLI 统一 stderr Logo Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !307 merge feat-logo into develop 【FEAT】MindStudio CLI 统一 stderr Logo Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 修改原因 MindStudio Modeling 各 Python CLI 启动时缺少统一品牌标识,用户在仿真、吞吐寻优、适配与 profiling 工具间切换时难以从终端首屏确认产品归属。本 PR 在 parse_args 成功后向 stderr 输出固定四行 MindStudio Logo,并支持 TTY/TERM 降级与 Windows colorama 控制台初始化。 --- ## 修改内容 - 新增共享模块 cli/logo.py:render_logo / print_logo,65 列块 + 终端居中 + ANSI/纯文本降级 - 在 11 个 Python 入口(cli/inference/*、serving_cast/main.py、tools/perf_data_collection 驱动脚本)于 parse_args 后调用 print_logo();--help 路径不输出 Logo - 依赖: - **运行时** colorama>=0.4.6 — 写入 [project] dependencies 与 requirements.txt,Windows 上调用 just_fix_windows_console() 启用控制台 VT/ANSI 输出 - **CI 静态检查** types-colorama>=0.4.15 — 写入 [dependency-groups] ci,见下方说明 - 详设文档:docs/design/mindstudio-brand-logo-design.md(本仓仅 Python 范围) - 测试:tests/regression/cli/test_logo.py(14 条模块 UT)+ tests/regression/cli/test_logo_cli_hooks.py(help 抑制与入口 hook 回归,in-process run_module_main) ### 为何需要 types-colorama(CI 组,非运行时) cli/logo.py 在 Windows 路径下会调用 colorama.just_fix_windows_console()。colorama 包本身未提供完整的 inline 类型注解,mypy / 仓库 type_check 在无 stub 时会报 *Cannot find implementation or library stub for module named "colorama"*,或将其视为 untyped 调用。 types-colorama 是社区维护的 **PEP 561 stub 包**(.pyi),仅用于开发态与 CI 的类型检查,**不会**随默认 uv sync 进入用户仿真运行时环境(位于 dependency-groups.ci,与 pytest-cov 等工具同属 CI 组)。 加入该依赖的目的: 1. 让 uv sync --group ci + mypy 能正确解析 colorama API,满足本 PR 静态检查门禁,**无需**在业务代码中使用 # type: ignore 绕过规范 2. 与项目现有做法一致:第三方库缺类型时,在 ci 组补 types-* stub,而非放宽 mypy 配置 若仅安装运行时依赖(uv sync / pip install -r requirements.txt),**不需要**也**不会**安装 types-colorama;Logo 功能仅依赖运行时 colorama。 --- ## 自验证 ### Logo 四行块渲染(纯文本 / 80 列居中) 目的:确认固定四行布局、品牌行与 Slogan 居中、无前置空行。 步骤: 1. 在仓库根目录执行: bash uv run python -c "from cli.logo import render_logo; print(render_logo(color=False, terminal_cols=80))" 结果:  ### Logo 模块 + CLI hook 回归测试 目的:满足 CI Gate 对新增 print_logo 路径的覆盖;确认 --help 不泄漏 Logo,正常 parse_args 后 stderr 含品牌块。 步骤: 1. 在仓库根目录执行: bash uv run pytest tests/regression/cli/test_logo.py tests/regression/cli/test_logo_cli_hooks.py -v --tb=no 结果:  ### --help 不输出 Logo 目的:确认 argparse 在 print_logo 之前退出,help 路径保持干净。 步骤: 1. 执行: bash uv run python -m cli.inference.text_generate --help 2>&1 | head -5 结果:  ### 端到端  See merge request: Ascend/msmodeling!307 | 19 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !266 merge refactor-tests into develop 【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Created-by: AvadaKedavrua Commit-by: liujiawang;AvadaKedavrua Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [x] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [x] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 现有 UT 目录混合了 smoke、regression、benchmark、模型配置资产和脚本测试,导致本地执行入口不统一、CI 无法稳定做增量选择,nightly 也缺少统一的 test_map 刷新和报告链路。旧的 tests/run_ut.sh 入口难以表达“快速 smoke / 完整 regression / benchmark / PR gate / nightly”这些不同场景,新增或删除源码时也缺少基于 test_map 的覆盖检查。 本 PR 目标是把测试体系拆成清晰分层,并补齐 CI gate、nightly、coverage gate、test_map 构建和文档,让开发者和流水线都能按同一套目录与脚本执行测试。同时修复整理过程中暴露出的少量模型配置、serving 输出文本和文档问题。 ------ ## 📝 Modification / 修改内容 本次按 hunk/主题重新整理为 17 个提交,主要修改如下: - 重构测试目录:将旧 tests/test_tensor_cast、serving_cast/tests、web_ui/tests、tests/tools、tests/perf_database、tests/st 拆分到 tests/smoke/、tests/regression/、tests/benchmark/。 - 统一测试资产:将模型配置移动到 tests/assets/model_config/,同步更新 pre-commit exclude、缓存目录和文档说明。 - 新增共享测试 helper:补充断言、配置工厂、fake subprocess、模型构造、op registry 等公共测试工具,减少测试重复代码。 - 新增 CI gate helper:增加 diff 分类、test_map 读取、AST 符号映射、coverage gate、增量测试选择和 gate policy 配置。 - 新增 nightly helper:增加 pytest 结果解析、报告模型、报告构建、Feishu webhook 通知、test_map 刷新和 benchmark 调度入口。 - 新增统一脚本入口:新增 scripts/run_smoke.sh、scripts/run_regression.sh、scripts/run_benchmark.sh、scripts/run_ci_gate.sh、scripts/run_nightly.sh,替换旧 tests/run_ut.sh。 - 更新配置与文档:补充 pyproject.toml 的 pytest marker/testpaths/filterwarnings,更新 README.md、tests/README.md、docs/en/web_ui.md、web_ui/README.md、tools/perf_data_collection/README.md。 - 修复模型/输出细节:为 DeepseekV32DecoderLayer 注册 config_class;规范 serving_cast optimizer summary 的冒号和 runner 日志文案。 ### 后续 UT 怎么上 - 新增快速兜底用例放到 tests/smoke/:覆盖导入、基础 compile path、轻量 config resolver、轻量 serving/tensor_cast 主路径,要求无 NPU、无大模型权重、反馈快,适合每个 PR 先跑。 - 新增功能回归用例放到 tests/regression/<domain>/:按 tensor_cast、serving_cast、cli、web_ui、scripts/helpers 等领域归档,覆盖具体 bugfix、边界条件、行为契约和工具脚本逻辑。 - 新增长耗时或性能相关用例放到 tests/benchmark/:模型基准、perf_database、trace/CSV 性能数据处理等不阻塞普通 PR gate 的测试归到 benchmark 层。 - 新增模型配置、fixture、样例数据优先放到 tests/assets/ 或就近 fixtures/,避免继续散落在测试包内部;大文件或生成缓存走 .msmodeling_cache/、tests/assets/cache/,不直接进入源码目录。 - 新测试默认使用 tests/helpers/ 的公共构造器和断言工具;需要 fake subprocess、模型配置、op registry 时复用已有 helper,减少每个测试重复 mock 和手写配置。 - 需要 NPU 的用例必须打 @pytest.mark.npu;只应 nightly 跑的大模型/长耗时 compile 用例打 @pytest.mark.nightly,避免进入默认本地和 PR 快速路径。 ### 怎么根据语义上 UT - 测试不再只按文件名机械归类,而是按“被测语义”挂到对应源码符号:产品源码的函数、类、方法、顶层行为需要在 test_map 中映射到验证它的测试 nodeid。 - 新增产品源码时,如果是可执行逻辑,应新增对应 smoke 或 regression 用例,并让 test_map 能找到该源码/符号;确实不需要测试的符号需要在 exemption 中写明原因。 - 修改已有源码时,CI gate 会用 AST 定位变更行落在哪个 top-level definition 或 class/method span,再通过 test_map 选择关联测试;如果符号没有映射,会阻断或扩大测试范围,避免“改了逻辑但没跑语义相关 UT”。 - 删除源码时,CI gate 会检查 test_map 中是否仍有引用该源码的测试,防止遗留无效映射;删除测试时也会检查是否破坏已有源码覆盖关系。 - 跨层依赖变更会按语义优先选择所属 regression layer,无法明确归属或配置变更时升级为更完整的套件,保证增量选择不会漏测。 - test_map 由 nightly 在完整测试通过后刷新,PR gate 消费稳定版本;这样避免每个 PR 临时生成不可信映射,同时让语义映射随主干测试演进。 ### 流水线做了什么调整 - 本地与 CI 统一入口:run_smoke.sh 跑快速 smoke,run_regression.sh 跑完整 regression,run_benchmark.sh 跑 benchmark,run_ci_gate.sh 跑 PR 增量门禁,run_nightly.sh 跑夜间全流程。 - PR gate 从“固定跑一批 UT”改为“diff -> classify changes -> load test_map -> apply gate rules -> run selected pytest -> coverage gate”。配置变更、源码新增/删除、测试新增/删除、源码修改会走不同 gate 规则。 - coverage gate 统一读取 MSMODELING_TEST_LINE_THRESHOLD 和 MSMODELING_TEST_BRANCH_THRESHOLD,默认 line 70、branch 50;pytest 默认排除 npu,PR gate 额外排除 nightly。 - nightly 分两阶段:先跑非 NPU、非 nightly 的 smoke/regression 并在通过后刷新 test_map;再跑 nightly 标记用例与 benchmark,并构建结构化报告。 - 流水线统一支持 MSMODELING_OFFLINE、MSMODELING_TEST_WEIGHTS_PRUNE、MSMODELING_TEST_MAP_PATH 等环境变量,减少不同脚本各自处理缓存、离线和权重清理的差异。 - benchmark 不纳入普通 coverage gate,避免性能/长耗时用例拖慢 PR 门禁;必要时可通过独立 benchmark pipeline 或 nightly 验证。 - pre-commit exclude 同步到新目录,模型配置资产和 fixtures 不再被无意义格式化或误报。 已处理问题清单: - 旧 UT 入口单一,无法区分 smoke、regression、benchmark、nightly 和 PR gate。 - 模型配置资产散落在测试用例目录下,pre-commit 与测试引用路径容易漂移。 - 新增/删除源码缺少 test_map 覆盖检查,CI 不能精准阻断未补测试的变更。 - coverage 阈值、pytest marker、离线模式、权重缓存清理等 CI 参数缺少统一入口。 - nightly 缺少结构化报告、失败摘要和 Feishu 通知链路。 - web UI 测试仍在模块内,未纳入统一 regression 层级。 - DeepseekV32DecoderLayer 缺少 config_class,影响配置类识别一致性。 - serving_cast 部分日志/summary 文案有多余空格或表达不统一。 ------ ## 📐 Associated Test Results / 关联测试结果 提交过程中每个 commit 均触发 pre-commit hook,已通过已检查文件的 trailing whitespace、EOF、YAML/JSON、大文件、merge conflict、private key、ruff、ruff-format、codespell、pylint、bandit、typos 等检查。 本地未额外执行完整 smoke/regression/benchmark 全量测试;推送后以 GitCode CI 结果为准。建议重点关注: - bash ./scripts/run_smoke.sh - bash ./scripts/run_regression.sh - bash ./scripts/run_ci_gate.sh(需设置 MSMODELING_TEST_MAP_PATH) - bash ./scripts/run_nightly.sh(需设置 MSMODELING_TEST_MAP_PATH) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - 本地快速验证:开发者运行 bash ./scripts/run_smoke.sh 获取快速反馈。 - 本地完整回归:开发者运行 bash ./scripts/run_regression.sh 覆盖主要回归用例。 - PR 增量门禁:CI 设置 MSMODELING_TEST_MAP_PATH 后运行 bash ./scripts/run_ci_gate.sh,按 diff 与 test_map 选择用例并执行 coverage gate。 - 夜间任务:nightly 先跑非 nightly 的 smoke/regression 并刷新 test_map,再执行 nightly/benchmark 并生成报告,可选 Feishu 通知。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!266 | 27 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
完善 GLM5 shape grid 生成与 microbench 回填支持 Co-authored-by: Secluded_Ocean<tangchuxiao0709@qq.com> # message auto-generated for no-merge-commit merge: !252 merge codex/debug-shape-grid-generation into develop 完善 GLM5 shape grid 生成与 microbench 回填支持 Created-by: Secluded_Ocean Commit-by: Secluded_Ocean Merged-by: ascend-robot Description: ## Summary - improve GLM5 shape grid generation and EP32 DFC replay coverage - normalize shape matching and dedupe behavior - extend microbench update/replay tooling and related tests ## Validation - Not run locally because pytest is not installed for the available Python interpreter. See merge request: Ascend/msmodeling!252 | 24 天前 | |
【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !266 merge refactor-tests into develop 【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Created-by: AvadaKedavrua Commit-by: liujiawang;AvadaKedavrua Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [x] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [x] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 现有 UT 目录混合了 smoke、regression、benchmark、模型配置资产和脚本测试,导致本地执行入口不统一、CI 无法稳定做增量选择,nightly 也缺少统一的 test_map 刷新和报告链路。旧的 tests/run_ut.sh 入口难以表达“快速 smoke / 完整 regression / benchmark / PR gate / nightly”这些不同场景,新增或删除源码时也缺少基于 test_map 的覆盖检查。 本 PR 目标是把测试体系拆成清晰分层,并补齐 CI gate、nightly、coverage gate、test_map 构建和文档,让开发者和流水线都能按同一套目录与脚本执行测试。同时修复整理过程中暴露出的少量模型配置、serving 输出文本和文档问题。 ------ ## 📝 Modification / 修改内容 本次按 hunk/主题重新整理为 17 个提交,主要修改如下: - 重构测试目录:将旧 tests/test_tensor_cast、serving_cast/tests、web_ui/tests、tests/tools、tests/perf_database、tests/st 拆分到 tests/smoke/、tests/regression/、tests/benchmark/。 - 统一测试资产:将模型配置移动到 tests/assets/model_config/,同步更新 pre-commit exclude、缓存目录和文档说明。 - 新增共享测试 helper:补充断言、配置工厂、fake subprocess、模型构造、op registry 等公共测试工具,减少测试重复代码。 - 新增 CI gate helper:增加 diff 分类、test_map 读取、AST 符号映射、coverage gate、增量测试选择和 gate policy 配置。 - 新增 nightly helper:增加 pytest 结果解析、报告模型、报告构建、Feishu webhook 通知、test_map 刷新和 benchmark 调度入口。 - 新增统一脚本入口:新增 scripts/run_smoke.sh、scripts/run_regression.sh、scripts/run_benchmark.sh、scripts/run_ci_gate.sh、scripts/run_nightly.sh,替换旧 tests/run_ut.sh。 - 更新配置与文档:补充 pyproject.toml 的 pytest marker/testpaths/filterwarnings,更新 README.md、tests/README.md、docs/en/web_ui.md、web_ui/README.md、tools/perf_data_collection/README.md。 - 修复模型/输出细节:为 DeepseekV32DecoderLayer 注册 config_class;规范 serving_cast optimizer summary 的冒号和 runner 日志文案。 ### 后续 UT 怎么上 - 新增快速兜底用例放到 tests/smoke/:覆盖导入、基础 compile path、轻量 config resolver、轻量 serving/tensor_cast 主路径,要求无 NPU、无大模型权重、反馈快,适合每个 PR 先跑。 - 新增功能回归用例放到 tests/regression/<domain>/:按 tensor_cast、serving_cast、cli、web_ui、scripts/helpers 等领域归档,覆盖具体 bugfix、边界条件、行为契约和工具脚本逻辑。 - 新增长耗时或性能相关用例放到 tests/benchmark/:模型基准、perf_database、trace/CSV 性能数据处理等不阻塞普通 PR gate 的测试归到 benchmark 层。 - 新增模型配置、fixture、样例数据优先放到 tests/assets/ 或就近 fixtures/,避免继续散落在测试包内部;大文件或生成缓存走 .msmodeling_cache/、tests/assets/cache/,不直接进入源码目录。 - 新测试默认使用 tests/helpers/ 的公共构造器和断言工具;需要 fake subprocess、模型配置、op registry 时复用已有 helper,减少每个测试重复 mock 和手写配置。 - 需要 NPU 的用例必须打 @pytest.mark.npu;只应 nightly 跑的大模型/长耗时 compile 用例打 @pytest.mark.nightly,避免进入默认本地和 PR 快速路径。 ### 怎么根据语义上 UT - 测试不再只按文件名机械归类,而是按“被测语义”挂到对应源码符号:产品源码的函数、类、方法、顶层行为需要在 test_map 中映射到验证它的测试 nodeid。 - 新增产品源码时,如果是可执行逻辑,应新增对应 smoke 或 regression 用例,并让 test_map 能找到该源码/符号;确实不需要测试的符号需要在 exemption 中写明原因。 - 修改已有源码时,CI gate 会用 AST 定位变更行落在哪个 top-level definition 或 class/method span,再通过 test_map 选择关联测试;如果符号没有映射,会阻断或扩大测试范围,避免“改了逻辑但没跑语义相关 UT”。 - 删除源码时,CI gate 会检查 test_map 中是否仍有引用该源码的测试,防止遗留无效映射;删除测试时也会检查是否破坏已有源码覆盖关系。 - 跨层依赖变更会按语义优先选择所属 regression layer,无法明确归属或配置变更时升级为更完整的套件,保证增量选择不会漏测。 - test_map 由 nightly 在完整测试通过后刷新,PR gate 消费稳定版本;这样避免每个 PR 临时生成不可信映射,同时让语义映射随主干测试演进。 ### 流水线做了什么调整 - 本地与 CI 统一入口:run_smoke.sh 跑快速 smoke,run_regression.sh 跑完整 regression,run_benchmark.sh 跑 benchmark,run_ci_gate.sh 跑 PR 增量门禁,run_nightly.sh 跑夜间全流程。 - PR gate 从“固定跑一批 UT”改为“diff -> classify changes -> load test_map -> apply gate rules -> run selected pytest -> coverage gate”。配置变更、源码新增/删除、测试新增/删除、源码修改会走不同 gate 规则。 - coverage gate 统一读取 MSMODELING_TEST_LINE_THRESHOLD 和 MSMODELING_TEST_BRANCH_THRESHOLD,默认 line 70、branch 50;pytest 默认排除 npu,PR gate 额外排除 nightly。 - nightly 分两阶段:先跑非 NPU、非 nightly 的 smoke/regression 并在通过后刷新 test_map;再跑 nightly 标记用例与 benchmark,并构建结构化报告。 - 流水线统一支持 MSMODELING_OFFLINE、MSMODELING_TEST_WEIGHTS_PRUNE、MSMODELING_TEST_MAP_PATH 等环境变量,减少不同脚本各自处理缓存、离线和权重清理的差异。 - benchmark 不纳入普通 coverage gate,避免性能/长耗时用例拖慢 PR 门禁;必要时可通过独立 benchmark pipeline 或 nightly 验证。 - pre-commit exclude 同步到新目录,模型配置资产和 fixtures 不再被无意义格式化或误报。 已处理问题清单: - 旧 UT 入口单一,无法区分 smoke、regression、benchmark、nightly 和 PR gate。 - 模型配置资产散落在测试用例目录下,pre-commit 与测试引用路径容易漂移。 - 新增/删除源码缺少 test_map 覆盖检查,CI 不能精准阻断未补测试的变更。 - coverage 阈值、pytest marker、离线模式、权重缓存清理等 CI 参数缺少统一入口。 - nightly 缺少结构化报告、失败摘要和 Feishu 通知链路。 - web UI 测试仍在模块内,未纳入统一 regression 层级。 - DeepseekV32DecoderLayer 缺少 config_class,影响配置类识别一致性。 - serving_cast 部分日志/summary 文案有多余空格或表达不统一。 ------ ## 📐 Associated Test Results / 关联测试结果 提交过程中每个 commit 均触发 pre-commit hook,已通过已检查文件的 trailing whitespace、EOF、YAML/JSON、大文件、merge conflict、private key、ruff、ruff-format、codespell、pylint、bandit、typos 等检查。 本地未额外执行完整 smoke/regression/benchmark 全量测试;推送后以 GitCode CI 结果为准。建议重点关注: - bash ./scripts/run_smoke.sh - bash ./scripts/run_regression.sh - bash ./scripts/run_ci_gate.sh(需设置 MSMODELING_TEST_MAP_PATH) - bash ./scripts/run_nightly.sh(需设置 MSMODELING_TEST_MAP_PATH) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - 本地快速验证:开发者运行 bash ./scripts/run_smoke.sh 获取快速反馈。 - 本地完整回归:开发者运行 bash ./scripts/run_regression.sh 覆盖主要回归用例。 - PR 增量门禁:CI 设置 MSMODELING_TEST_MAP_PATH 后运行 bash ./scripts/run_ci_gate.sh,按 diff 与 test_map 选择用例并执行 coverage gate。 - 夜间任务:nightly 先跑非 nightly 的 smoke/regression 并刷新 test_map,再执行 nightly/benchmark 并生成报告,可选 Feishu 通知。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!266 | 27 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
完善 GLM5 shape grid 生成与 microbench 回填支持 Co-authored-by: Secluded_Ocean<tangchuxiao0709@qq.com> # message auto-generated for no-merge-commit merge: !252 merge codex/debug-shape-grid-generation into develop 完善 GLM5 shape grid 生成与 microbench 回填支持 Created-by: Secluded_Ocean Commit-by: Secluded_Ocean Merged-by: ascend-robot Description: ## Summary - improve GLM5 shape grid generation and EP32 DFC replay coverage - normalize shape matching and dedupe behavior - extend microbench update/replay tooling and related tests ## Validation - Not run locally because pytest is not installed for the available Python interpreter. See merge request: Ascend/msmodeling!252 | 24 天前 | |
完善 GLM5 shape grid 生成与 microbench 回填支持 Co-authored-by: Secluded_Ocean<tangchuxiao0709@qq.com> # message auto-generated for no-merge-commit merge: !252 merge codex/debug-shape-grid-generation into develop 完善 GLM5 shape grid 生成与 microbench 回填支持 Created-by: Secluded_Ocean Commit-by: Secluded_Ocean Merged-by: ascend-robot Description: ## Summary - improve GLM5 shape grid generation and EP32 DFC replay coverage - normalize shape matching and dedupe behavior - extend microbench update/replay tooling and related tests ## Validation - Not run locally because pytest is not installed for the available Python interpreter. See merge request: Ascend/msmodeling!252 | 24 天前 | |
【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !266 merge refactor-tests into develop 【REFACTOR】【TESTS】重构 tests 目录并补充 smoke 测试 Created-by: AvadaKedavrua Commit-by: liujiawang;AvadaKedavrua Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [x] Bugfix(Bug 修复) - [x] Docs(文档更新) - [x] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [x] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 现有 UT 目录混合了 smoke、regression、benchmark、模型配置资产和脚本测试,导致本地执行入口不统一、CI 无法稳定做增量选择,nightly 也缺少统一的 test_map 刷新和报告链路。旧的 tests/run_ut.sh 入口难以表达“快速 smoke / 完整 regression / benchmark / PR gate / nightly”这些不同场景,新增或删除源码时也缺少基于 test_map 的覆盖检查。 本 PR 目标是把测试体系拆成清晰分层,并补齐 CI gate、nightly、coverage gate、test_map 构建和文档,让开发者和流水线都能按同一套目录与脚本执行测试。同时修复整理过程中暴露出的少量模型配置、serving 输出文本和文档问题。 ------ ## 📝 Modification / 修改内容 本次按 hunk/主题重新整理为 17 个提交,主要修改如下: - 重构测试目录:将旧 tests/test_tensor_cast、serving_cast/tests、web_ui/tests、tests/tools、tests/perf_database、tests/st 拆分到 tests/smoke/、tests/regression/、tests/benchmark/。 - 统一测试资产:将模型配置移动到 tests/assets/model_config/,同步更新 pre-commit exclude、缓存目录和文档说明。 - 新增共享测试 helper:补充断言、配置工厂、fake subprocess、模型构造、op registry 等公共测试工具,减少测试重复代码。 - 新增 CI gate helper:增加 diff 分类、test_map 读取、AST 符号映射、coverage gate、增量测试选择和 gate policy 配置。 - 新增 nightly helper:增加 pytest 结果解析、报告模型、报告构建、Feishu webhook 通知、test_map 刷新和 benchmark 调度入口。 - 新增统一脚本入口:新增 scripts/run_smoke.sh、scripts/run_regression.sh、scripts/run_benchmark.sh、scripts/run_ci_gate.sh、scripts/run_nightly.sh,替换旧 tests/run_ut.sh。 - 更新配置与文档:补充 pyproject.toml 的 pytest marker/testpaths/filterwarnings,更新 README.md、tests/README.md、docs/en/web_ui.md、web_ui/README.md、tools/perf_data_collection/README.md。 - 修复模型/输出细节:为 DeepseekV32DecoderLayer 注册 config_class;规范 serving_cast optimizer summary 的冒号和 runner 日志文案。 ### 后续 UT 怎么上 - 新增快速兜底用例放到 tests/smoke/:覆盖导入、基础 compile path、轻量 config resolver、轻量 serving/tensor_cast 主路径,要求无 NPU、无大模型权重、反馈快,适合每个 PR 先跑。 - 新增功能回归用例放到 tests/regression/<domain>/:按 tensor_cast、serving_cast、cli、web_ui、scripts/helpers 等领域归档,覆盖具体 bugfix、边界条件、行为契约和工具脚本逻辑。 - 新增长耗时或性能相关用例放到 tests/benchmark/:模型基准、perf_database、trace/CSV 性能数据处理等不阻塞普通 PR gate 的测试归到 benchmark 层。 - 新增模型配置、fixture、样例数据优先放到 tests/assets/ 或就近 fixtures/,避免继续散落在测试包内部;大文件或生成缓存走 .msmodeling_cache/、tests/assets/cache/,不直接进入源码目录。 - 新测试默认使用 tests/helpers/ 的公共构造器和断言工具;需要 fake subprocess、模型配置、op registry 时复用已有 helper,减少每个测试重复 mock 和手写配置。 - 需要 NPU 的用例必须打 @pytest.mark.npu;只应 nightly 跑的大模型/长耗时 compile 用例打 @pytest.mark.nightly,避免进入默认本地和 PR 快速路径。 ### 怎么根据语义上 UT - 测试不再只按文件名机械归类,而是按“被测语义”挂到对应源码符号:产品源码的函数、类、方法、顶层行为需要在 test_map 中映射到验证它的测试 nodeid。 - 新增产品源码时,如果是可执行逻辑,应新增对应 smoke 或 regression 用例,并让 test_map 能找到该源码/符号;确实不需要测试的符号需要在 exemption 中写明原因。 - 修改已有源码时,CI gate 会用 AST 定位变更行落在哪个 top-level definition 或 class/method span,再通过 test_map 选择关联测试;如果符号没有映射,会阻断或扩大测试范围,避免“改了逻辑但没跑语义相关 UT”。 - 删除源码时,CI gate 会检查 test_map 中是否仍有引用该源码的测试,防止遗留无效映射;删除测试时也会检查是否破坏已有源码覆盖关系。 - 跨层依赖变更会按语义优先选择所属 regression layer,无法明确归属或配置变更时升级为更完整的套件,保证增量选择不会漏测。 - test_map 由 nightly 在完整测试通过后刷新,PR gate 消费稳定版本;这样避免每个 PR 临时生成不可信映射,同时让语义映射随主干测试演进。 ### 流水线做了什么调整 - 本地与 CI 统一入口:run_smoke.sh 跑快速 smoke,run_regression.sh 跑完整 regression,run_benchmark.sh 跑 benchmark,run_ci_gate.sh 跑 PR 增量门禁,run_nightly.sh 跑夜间全流程。 - PR gate 从“固定跑一批 UT”改为“diff -> classify changes -> load test_map -> apply gate rules -> run selected pytest -> coverage gate”。配置变更、源码新增/删除、测试新增/删除、源码修改会走不同 gate 规则。 - coverage gate 统一读取 MSMODELING_TEST_LINE_THRESHOLD 和 MSMODELING_TEST_BRANCH_THRESHOLD,默认 line 70、branch 50;pytest 默认排除 npu,PR gate 额外排除 nightly。 - nightly 分两阶段:先跑非 NPU、非 nightly 的 smoke/regression 并在通过后刷新 test_map;再跑 nightly 标记用例与 benchmark,并构建结构化报告。 - 流水线统一支持 MSMODELING_OFFLINE、MSMODELING_TEST_WEIGHTS_PRUNE、MSMODELING_TEST_MAP_PATH 等环境变量,减少不同脚本各自处理缓存、离线和权重清理的差异。 - benchmark 不纳入普通 coverage gate,避免性能/长耗时用例拖慢 PR 门禁;必要时可通过独立 benchmark pipeline 或 nightly 验证。 - pre-commit exclude 同步到新目录,模型配置资产和 fixtures 不再被无意义格式化或误报。 已处理问题清单: - 旧 UT 入口单一,无法区分 smoke、regression、benchmark、nightly 和 PR gate。 - 模型配置资产散落在测试用例目录下,pre-commit 与测试引用路径容易漂移。 - 新增/删除源码缺少 test_map 覆盖检查,CI 不能精准阻断未补测试的变更。 - coverage 阈值、pytest marker、离线模式、权重缓存清理等 CI 参数缺少统一入口。 - nightly 缺少结构化报告、失败摘要和 Feishu 通知链路。 - web UI 测试仍在模块内,未纳入统一 regression 层级。 - DeepseekV32DecoderLayer 缺少 config_class,影响配置类识别一致性。 - serving_cast 部分日志/summary 文案有多余空格或表达不统一。 ------ ## 📐 Associated Test Results / 关联测试结果 提交过程中每个 commit 均触发 pre-commit hook,已通过已检查文件的 trailing whitespace、EOF、YAML/JSON、大文件、merge conflict、private key、ruff、ruff-format、codespell、pylint、bandit、typos 等检查。 本地未额外执行完整 smoke/regression/benchmark 全量测试;推送后以 GitCode CI 结果为准。建议重点关注: - bash ./scripts/run_smoke.sh - bash ./scripts/run_regression.sh - bash ./scripts/run_ci_gate.sh(需设置 MSMODELING_TEST_MAP_PATH) - bash ./scripts/run_nightly.sh(需设置 MSMODELING_TEST_MAP_PATH) ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - 本地快速验证:开发者运行 bash ./scripts/run_smoke.sh 获取快速反馈。 - 本地完整回归:开发者运行 bash ./scripts/run_regression.sh 覆盖主要回归用例。 - PR 增量门禁:CI 设置 MSMODELING_TEST_MAP_PATH 后运行 bash ./scripts/run_ci_gate.sh,按 diff 与 test_map 选择用例并执行 coverage gate。 - 夜间任务:nightly 先跑非 nightly 的 smoke/regression 并刷新 test_map,再执行 nightly/benchmark 并生成报告,可选 Feishu 通知。 ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!266 | 27 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 | |
feat(serving_cast): support chunked prefill modeling Co-authored-by: jia_ya_nan<jiayanan3@h-partners.com> # message auto-generated for no-merge-commit merge: !250 merge feat/chunked-prefill-impl into develop feat(serving_cast): support chunked prefill modeling Created-by: jia_ya_nan Commit-by: jia_ya_nan Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [x] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** 当前 throughput_optimizer 在混部模式下使用 max_prefill_tokens 作为 prefill token budget,并要求有效输入长度不超过该值。当长上下文请求的 effective_input_length 大于 token budget 时,工具会直接报错,无法模拟实际服务中常见的 chunked prefill 场景。 本 PR 旨在补齐 msmodeling 对 chunked prefill 的建模能力,使吞吐优化器可以在长 prompt 或较小 batch token budget 场景下,自动将 prefill 拆分为多个 chunk 进行估算,并更合理地建模 prefill 与 decode 混部执行对 TTFT、TPOT 和吞吐的影响。 ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** - 将 CLI 参数 --max-prefill-tokens 重命名为 --max-batched-tokens,用于表达单个 prefill / mixed step 的 token budget。 - 新增 prefill chunk plan 生成逻辑,当 effective_input_length > max_batched_tokens 时自动按 max_batched_tokens 切分 prefill。 - 新增默认调度策略 DecodeFirstWithSlack,支持 decode-first 调度,并允许 15% slack 以避免 decode token 占用导致 prefill chunk 无法调度。 - 聚合模式中新增 chunked prefill 轻量级时间模拟,支持已完成 prefill 的请求提前进入 decode,不再要求所有请求完成 prefill 后统一 decode。 - PD 分离模式中 prefill 阶段支持 chunked prefill,decode 阶段保持原有逻辑。 - 优化 latency cache key,使其区分不同的 query_len、seq_len 和并发形态。 - 输出结果新增 effective_input_length、max_batched_tokens、prefill_num_chunks,便于分析 chunked prefill 配置影响。 - 更新 Web UI 参数生成、表单校验、相关文档和单元测试。 ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** 以32条 32k请求为例,无chunk改动前: python -m cli.inference.throughput_optimizer Qwen/Qwen3-32B --device ATLAS_800_A2_280T_64G --quantize-linear-action DISABLED --input-length 32000 --output-length 1024 --tp-sizes 8 --compile --batch-range 32 32 --num-devices 8 --max-prefill-tokens 32000 --log-level info  无chunk改动后: python -m cli.inference.throughput_optimizer Qwen/Qwen3-32B --device ATLAS_800_A2_280T_64G --quantize-linear-action DISABLED --input-length 32000 --output-length 1024 --tp-sizes 8 --compile --batch-range 32 32 --num-devices 8 --max-batched-tokens 32000 --log-level info  结果不变,不影响之前的调度逻辑 chunk为2000: python -m cli.inference.throughput_optimizer Qwen/Qwen3-32B --device ATLAS_800_A2_280T_64G --quantize-linear-action DISABLED --input-length 32000 --output-length 1024 --tp-sizes 8 --compile --batch-range 32 32 --num-devices 8 --max-batched-tokens 2000 --log-level info  chunk为4000: python -m cli.inference.throughput_optimizer Qwen/Qwen3-32B --device ATLAS_800_A2_280T_64G --quantize-linear-action DISABLED --input-length 32000 --output-length 1024 --tp-sizes 8 --compile --batch-range 32 32 --num-devices 8 --max-batched-tokens 4000 --log-level info  chunk为8000: python -m cli.inference.throughput_optimizer Qwen/Qwen3-32B --device ATLAS_800_A2_280T_64G --quantize-linear-action DISABLED --input-length 32000 --output-length 1024 --tp-sizes 8 --compile --batch-range 32 32 --num-devices 8 --max-batched-tokens 4000 --log-level info  从趋势上看,chunk size越小,对tpot越友好;同时chunk 越小,prefill阶段调度越多,ttft会增加,符合预期; 另外,由于开启chunk prefill后,prefill会增加多次计算,导致耗时呈线性增长;可以考虑并行一次性跑完所有切分的prefill,但对资源消耗巨大,考虑在下个PR内提升性能 ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [x] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [x] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [x] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!250 | 24 天前 | |
【feat】补充tools/perf_data*目录下UT Co-authored-by: hqx<1343153389@qq.com> # message auto-generated for no-merge-commit merge: !299 merge ut1 into develop 【feat】补充tools/perf_data*目录下UT Created-by: h7star Commit-by: hqx Merged-by: ascend-robot Description: # PR Template Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。 **PR Type / PR类型** - [ ] Feature(功能新增) - [ ] Bugfix(Bug 修复) - [ ] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [ ] Refactor(代码重构) - [ ] Perf(性能优化) - [ ] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 **Please describe the motivation of this PR and the goal you want to achieve through this PR.** **请描述您的拉取请求的动机和您希望通过此拉取请求实现的目标。** ------ ## 📝 Modification / 修改内容 **Please briefly describe what modification is made in this PR.** **请简要描述此拉取请求中进行的修改。** ------ ## 📐 Associated Test Results / 关联测试结果 **Please provide the related test results, such as test reports, etc.** **请提供相关测试结果,例如测试报告等。** ------ ## 🌟 Use cases (Optional) / 使用案例(可选) **If this PR introduces a new feature, it is better to list some use cases here and update the documentation.** **如果此拉取请求引入了新功能,最好在此处列出一些用例并更新文档。** ------ ## ✅ Checklist / 检查列表 **Before PR**: - [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。 - [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。 - [ ] All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。 - [ ] Please ensure code files contain no Chinese comments. / 请保证代码文件中不含中文注释。 ------ See merge request: Ascend/msmodeling!299 | 23 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 27 天前 | ||
| 22 天前 | ||
| 23 天前 | ||
| 27 天前 | ||
| 24 天前 | ||
| 27 天前 | ||
| 17 天前 | ||
| 23 天前 | ||
| 23 天前 | ||
| 19 天前 | ||
| 19 天前 | ||
| 23 天前 | ||
| 23 天前 | ||
| 27 天前 | ||
| 23 天前 | ||
| 24 天前 | ||
| 27 天前 | ||
| 23 天前 | ||
| 24 天前 | ||
| 24 天前 | ||
| 27 天前 | ||
| 23 天前 | ||
| 24 天前 | ||
| 23 天前 |