| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor(tensor_cast): unify word embedding tp config Co-authored-by: Kudo__shinichi<liuning119@huawei.com> # message auto-generated for no-merge-commit merge: !344 merge codex/word-embedding-tp-normalize into develop refactor(tensor_cast): unify word embedding tp config Created-by: Kudo__shinichi Commit-by: Kudo__shinichi 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 修复) - [x] Docs(文档更新) - [ ] CI/CD(持续集成/持续部署) - [x] Refactor(代码重构) - [ ] Perf(性能优化) - [x] Test-Cases(测试用例更新) - [ ] Other(其他) ## 🔍 Motivation / 变更动机 word_embedding_tp and word_embedding_tp_mode represented the same configuration concept in two fields: one field toggled word embedding TP, and the other selected the TP mode. This PR reduces the public and internal configuration shape to a single parameter so users only need to configure word_embedding_tp as disabled, col, or row. ------ ## 📝 Modification / 修改内容 - Make UserInputConfig.word_embedding_tp the single nullable word embedding TP mode field. - Remove word_embedding_tp_mode and embedding_parallel_mode from the config model. - Pass the normalized word_embedding_tp mode directly into ParallelConfig.embedding_parallel and the embedding transformation. - Keep legacy bool input normalization for compatibility: True -> col, False/None -> disabled. - Remove redundant CLI-side bool/mode conversion and update related benchmark cases and user guide docs. - Add regression coverage for single-field config, legacy bool normalization, and invalid word_embedding_tp values. ------ ## 📐 Associated Test Results / 关联测试结果 - python -m pytest tests/regression/tensor_cast/test_user_config.py -q: 6 passed - python -m pytest tests/regression/tensor_cast/test_user_config.py tests/regression/web_ui/test_command_builder.py tests/regression/tensor_cast/test_adapter_automation.py -q: 98 passed - python -m pytest tests/regression/tensor_cast/test_text_generate.py -k word_embedding_parallel -q: 2 passed, 113 deselected - python -m pytest tests/regression/tensor_cast/test_sequence_parallel_pass.py -o addopts= -m "nightly and not npu and not network" -q: 2 passed - python -m pytest tests/benchmark/models/test_model_regression.py --collect-only -q: 15 tests collected - python -m ruff check <changed python files>: All checks passed - python -m pre_commit run --from-ref origin/develop --to-ref HEAD: passed - git diff --check HEAD~1 HEAD: passed ------ ## 🌟 Use cases (Optional) / 使用案例(可选) - Disable word embedding TP: word_embedding_tp=None - Enable column mode: word_embedding_tp="col" - Enable row mode: word_embedding_tp="row" - CLI usage: --word-embedding-tp col or --word-embedding-tp row ------ ## ✅ 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!344 | 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 | 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 | 28 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 17 天前 | ||
| 24 天前 | ||
| 28 天前 |