Skip to content

[CI]【Hackathon 10th Spring No.32】load_weight_utils unit test#6740

Merged
CSWYF3634076 merged 8 commits intoPaddlePaddle:developfrom
cloudforge1:task/h10-032-load-weight-utils-test
Mar 20, 2026
Merged

[CI]【Hackathon 10th Spring No.32】load_weight_utils unit test#6740
CSWYF3634076 merged 8 commits intoPaddlePaddle:developfrom
cloudforge1:task/h10-032-load-weight-utils-test

Conversation

@cloudforge1
Copy link
Copy Markdown
Contributor

@cloudforge1 cloudforge1 commented Mar 9, 2026

Motivation

No.32 功能模块 fastdeploy/model_executor/load_weight_utils.py 单测补充

Modifications

add unittest tests/model_executor/test_load_weight_utils.py

develop 分支:覆盖率45%,Miss行数161(62, 83-84, 87, 97, 106-110, 120, 128, 150->160, 167-169, 198, 200, 205-210, 237-247, 254-376, 383-387, 408-421, 428-435, 442-446, 486-493, 497-517, 532-564)

当前PR:覆盖率97%,Miss行数10

完成单测覆盖行数 161-10 = 151

Usage or Command

pytest tests/model_executor/test_load_weight_utils.py

Accuracy Tests

no need

Checklist

  • Add at least a tag in the PR title.
  • Format your code, run pre-commit before commit.
  • Add unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch.

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Mar 9, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Mar 9, 2026
@cloudforge1 cloudforge1 marked this pull request as draft March 9, 2026 15:02
@cloudforge1 cloudforge1 changed the title [Tests]【Hackathon 10th Spring No.32】Unit test for load_weight_utils.py [CI]【Hackathon 10th Spring No.32】load_weight_utils unit test Mar 9, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@d73fd87). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6740   +/-   ##
==========================================
  Coverage           ?   73.74%           
==========================================
  Files              ?      399           
  Lines              ?    55620           
  Branches           ?     8766           
==========================================
  Hits               ?    41015           
  Misses             ?    11704           
  Partials           ?     2901           
Flag Coverage Δ
GPU 73.74% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Pytest-style, single class, monkeypatch-based
- 36 tests, 460 lines, 66% coverage (205/310 stmts)
- develop baseline: 0% → PR: 66%, ratio 2.2x
- No MagicMock, no unittest.TestCase
…o 83%

- Add test_load_ep_checkpoint_basic: exercises EP checkpoint loading with minimal fixture
- Add test_composite_ep_branch: covers EP path in load_composite_checkpoint
- Add test_get_weight_iterator_unordered: covers unordered sharded safetensors path
- Coverage: 66% → 83% (257/310 stmts)
@cloudforge1 cloudforge1 force-pushed the task/h10-032-load-weight-utils-test branch from dafef1a to 57cbd37 Compare March 12, 2026 16:11
@cloudforge1 cloudforge1 force-pushed the task/h10-032-load-weight-utils-test branch from 57cbd37 to b9f96a0 Compare March 13, 2026 07:36
@cloudforge1 cloudforge1 marked this pull request as ready for review March 13, 2026 09:25
…tils

- Add test_is_layers_grouped: test layers_are_grouped() with grouped, interleaved, and no-layer keys
- Add test_save_model_bf16_cache: exercise save_model decorator with is_checkpoint_bf16=True
- Add test_composite_checkpoint_ep: test load_composite_checkpoint use_ep=True branch
- Add test_composite_checkpoint_rank_mismatch: test tp_size != rank_dirs ValueError
- Add test_composite_checkpoint_kv_quant: test float8_e4m3fn kv_cache path
- Add __main__ block for direct execution
- Branch coverage: 72% -> 80%
@cloudforge1 cloudforge1 force-pushed the task/h10-032-load-weight-utils-test branch from 7b887b3 to 51ccbf1 Compare March 14, 2026 04:16
@cloudforge1 cloudforge1 marked this pull request as draft March 14, 2026 06:07
@cloudforge1 cloudforge1 marked this pull request as ready for review March 14, 2026 11:13
@cloudforge1
Copy link
Copy Markdown
Contributor Author

@luotao1 @CSWYF3634076 请review,谢谢!

@cloudforge1 cloudforge1 force-pushed the task/h10-032-load-weight-utils-test branch from a9de20d to e50efa5 Compare March 19, 2026 13:56
Cover L237-247 (load_reordered_experts), L541 (pre-sharded checkpoint path),
and L557 (empty state_dict ValueError). Delta: 139 → 151.
Copy link
Copy Markdown
Collaborator

@CSWYF3634076 CSWYF3634076 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CSWYF3634076 CSWYF3634076 merged commit aca733b into PaddlePaddle:develop Mar 20, 2026
23 of 24 checks passed
@CSWYF3634076
Copy link
Copy Markdown
Collaborator

0.2⭐️
@luotao1

@cloudforge1
Copy link
Copy Markdown
Contributor Author

cloudforge1 commented Mar 20, 2026

已合入,谢谢评审。

@luotao1
Copy link
Copy Markdown
Collaborator

luotao1 commented Mar 27, 2026

进展汇总(截至 2026-03-26)

更新自 前次汇报 — No.47 MiniMax-M1 模型实现 PR 已提交。


✅ 已合入(确认 0.3⭐)

任务 模块 PR 评级 合入日
No.32 load_weight_utils.py FD#6740 0.2⭐ 03-20
No.35 resource_manager.py FD#6734 0.1⭐ 03-19

📊 覆盖率单测 — 7 PR 待审核(FastDeploy)

GPU 验证:全部 7 项均已在 AI Studio V100 实测通过 ✅

任务 模块 PR Δ 覆盖行 预估⭐ CI GPU 实测
No.29 engine.py FD#6771 150 0.2⭐ ✅ V100 14/14
No.33 config.py FD#6730 ~150 0.2⭐ ✅ V100 61/61
No.34 async_expert_loader.py FD#6731 ~150 0.2⭐ ✅ V100 17/17
No.36 worker_process.py FD#6736 152 0.2⭐ ✅ V100 28/28
No.39 fused_moe_marlin_backend.py FD#6737 115 0.1⭐ ✅ V100 4/4
No.43 ernie4_5_mtp.py FD#6738 88 0.1⭐ ✅ V100 8/8
No.44 fused_moe_deepgemm_backend.py FD#6739 57 0.1⭐ ✅ V100 5/5

🔧 构建工具 — 5 PR 待审核

任务 组件 PR 预估⭐ 平台验证 CI
No.45 SM-tier 编译守卫 FD#6941 T4+V100
No.45-part2 cpp_extensions 编译守卫 FD#6977
No.46 (1/3) Windows C++ guards FD#6881 ⭐⭐ Win2022 MSVC 31/31
No.46 (2/3) Windows build system FD#6882 Win2022 MSVC 31/31
No.46 (3/3) Windows Python guards FD#6883 Win2022 MSVC 31/31

⚡ 内核优化 — 1 PR 待审核

任务 算子 PR 预估⭐ SM90 实测 Sync 消除 CI
No.49 ngram_match · hybrid_mtp_ngram FD#6960 1.03× 13→0

🚀 模型实现 — 2 PR 待审核(FastDeploy)

任务 模型 PR 预估⭐ CI
No.47 MiniMax-M1 (456B MoE) FD#6994 ⭐⭐ ✅ 32/32 H20
No.50 MiniCPM4.1-8B FD#6982 ⭐⭐ ⏳ 验证中

🧪 PaddleMaterials 模型复现 — 3 PR 完整(RFC + 代码)

每个模型需提交 RFC(community)+ 代码实现(PaddleMaterials),按模型整体评分

任务 模型 RFC PR 代码 PR GPU 验证 预估⭐
No.6 CrystalLLM community#1256 PM#255 ✅ 500-sample 推理 ⭐⭐
No.12 AlloyGAN community#1255 PM#254 ✅ Softmax 对齐 ⭐⭐
No.18 SchNet community#1257 PM#253 ✅ MAE 验证 ⭐⭐

📋 FastDeploy 设计文档 — 3 PR 待审核

任务 模型 PR 状态
No.47 MiniMax-M1 community#1252 RFC 待审
No.48 SD3/Flux community#1253 RFC 待审
No.50 MiniCPM4.1-8B community#1251 RFC 待审

📈 总览

类别 任务 PR 已确认⭐ 待审⭐
✅ 已合入 2 2 0.3⭐
📊 覆盖率单测 7 7 1.1⭐
🔧 构建工具 2 5 3.0⭐
⚡ 内核优化 1 1 1.0⭐
🚀 模型实现 2 2 4.0⭐
🧪 模型复现 3 6 6.0⭐
📋 设计文档 3 3
合计 20 26 0.3⭐ 15.1⭐

@CSWYF3634076 @luotao1 全部待审 PR 的 CI 已通过(仅 CI_HPU / iluvatar 基础设施除外)。No.47 MiniMax-M1 模型实现 PR 已添加(32/32 tests H20 ✅)。待审合计 30,200 CNY(@2000/⭐)。

@luotao1
Copy link
Copy Markdown
Collaborator

luotao1 commented Mar 27, 2026

@cloudforge1 It is recommended that you create an issue at https://github.com/PaddlePaddle/community/issues to track the progress. The comments under the original issue PaddlePaddle/Paddle#77429 have been deleted, as they would affect the automatic form updates by the bot. Thank you for your understanding.

@cloudforge1
Copy link
Copy Markdown
Contributor Author

好的,已创建:PaddlePaddle/community#1282
后续进展更新均在该 issue 中汇报。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants