[CI] 【Hackathon 9th Sprint No.36】NO.36 功能模块单测补充
Motivation
NO.36 功能模块 fastdeploy/cache_manager/prefix_cache_manager.py 单测补充
Modifications
new tests/cache_manager/prefix_cache_manager.py
Usage or Command
tests/cache_manager/prefix_cache_manager.py:
python -m coverage run -m unittest tests.cache_manager.test_prefix_cache_manager \
&& python -m coverage report -m --include='fastdeploy/cache_manager/cache_manager.py'
Accuracy Tests
原覆盖:
File Stmts Miss Branch BrPart Cover(%) Missing
fastdeploy/cache_manager/prefix_cache_manager.py 897 455 306 48 46
tests/cache_manager/prefix_cache_manager.py:
Name Stmts Miss Cover Missing
--------------------------------------------------------------------------------
fastdeploy/cache_manager/prefix_cache_manager.py 909 123 86% 252, 348, 423, 644-646, 653, 857, 863-865, 871, 874-876
, 898, 908, 917-919, 939, 949, 952-954, 1005, 1068, 1084, 1091-1094, 1099, 1112, 1119-1120, 1126-1129, 1142-1144, 1162, 1169-119
1, 1243, 1251, 1294-1295, 1303-1312, 1317-1323, 1348, 1371, 1384-1386, 1388-1390, 1396-1402, 1414, 1416, 1422, 1484, 1495-1497,
1503-1509, 1518, 1523, 1564, 1570, 1585, 1617, 1620, 1657-1660, 1670, 1694, 1697, 1699, 1710, 1732-1734, 1750, 1789-1790, 1798,
1830
--------------------------------------------------------------------------------
TOTAL 909 123 86%
覆盖 ++332 行
Checklist
- [x] Add at least a tag in the PR title.
- Tag list: [
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]] - You can add new tags based on the PR content, but the semantics must be clear.
- Tag list: [
- [x] Format your code, run
pre-commitbefore commit. - [x] Add unit tests. Please write the reason in this PR if no unit tests.
- [x] Provide accuracy results.
- [x] If the current PR is submitting to the
releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.
Thanks for your contribution!
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:warning: Please upload report for BASE (develop@532f9ba). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## develop #5058 +/- ##
==========================================
Coverage ? 61.83%
==========================================
Files ? 329
Lines ? 41160
Branches ? 6274
==========================================
Hits ? 25453
Misses ? 13781
Partials ? 1926
| Flag | Coverage Δ | |
|---|---|---|
| GPU | 61.83% <ø> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@CSWYF3634076 All passed,Review required.
@CSWYF3634076 新pr修改内容 将可见设备的配置标准化为环境变量字符串
有些调用方会修改(patch 或 override):func:get_all_visible_devices 函数,让其返回设备 ID 的列表或元组(例如 ["0"])
由于启动命令的各个部分必须是字符串,如果直接把这种列表拼接到命令中,就会导致 TypeError 错误
这个辅助函数的作用是:无论输入的是字符串还是序列(列表/元组),它都能保证最终生成一个合法的环境变量赋值字符串
@CSWYF3634076 新pr修改内容 将可见设备的配置标准化为环境变量字符串
有些调用方会修改(patch 或 override):func:get_all_visible_devices 函数,让其返回设备 ID 的列表或元组(例如 ["0"])
由于启动命令的各个部分必须是字符串,如果直接把这种列表拼接到命令中,就会导致 TypeError 错误
这个辅助函数的作用是:无论输入的是字符串还是序列(列表/元组),它都能保证最终生成一个合法的环境变量赋值字符串
但是函数get_all_visible_devices只返回的是固定字符串 https://github.com/PaddlePaddle/FastDeploy/blob/develop/fastdeploy/cache_manager/ops.py#L84
@liyonghua0910 麻烦review
LGTM
0.3⭐️ cc @luotao1
合入后和pr_5544存在冲突,麻烦修复后再提交一个新的PR
合入后和pr_5544存在冲突,麻烦修复后再提交一个新的PR
问题已在PR https://github.com/PaddlePaddle/FastDeploy/pull/5609 中修复 @luotao1