Skip to content

[WIP] feat Pipeline Cache #6150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed

[WIP] feat Pipeline Cache #6150

wants to merge 7 commits into from

Conversation

futz12
Copy link
Contributor

@futz12 futz12 commented Jun 24, 2025

new funaction:

    int load_pipeline_cache(const std::vector<unsigned char>& buf) const;
    int save_pipeline_cache(std::vector<unsigned char>& buf) const;
#ifdef NCNN_STDIO
    int load_pipeline_cache(FILE* fp) const;
    int load_pipeline_cache(const char* filename) const;
    int save_pipeline_cache(FILE* fp) const;
    int save_pipeline_cache(const char* filename) const;
#endif

使用 PipelineCache 加速 Pipeline 创建过程
测试环境
CPU: i9 13900HX
GPU: 4060Laptop
驱动版本: 576.80

以 MobileNetv3 为例,热启动(在驱动有缓存的情况下):

test_gpu_pipecache passed, time = 590.000 ms
test_gpu_pipecache passedtest_gpu_pipecache passed after loading pipeline cache, time = 449.000 ms

Resnet50 冷启动

test_gpu_pipecache passed, time = 2725.000 ms
test_gpu_pipecache passedtest_gpu_pipecache passed after loading pipeline cache, time = 609.000 ms

聊胜于无

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

github-actions bot commented Jun 24, 2025

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15602512 15611816 +9304 ⚠️
armhf 6611348 6616728 +5380 ⚠️
aarch64 9921904 9922440 +536 ⚠️

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2025

Codecov Report

Attention: Patch coverage is 71.08434% with 24 lines in your changes missing coverage. Please review.

Project coverage is 95.82%. Comparing base (7557f5c) to head (eeefe33).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/gpu.cpp 71.08% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6150      +/-   ##
==========================================
+ Coverage   95.81%   95.82%   +0.01%     
==========================================
  Files         831      831              
  Lines      264948   265030      +82     
==========================================
+ Hits       253851   253963     +112     
+ Misses      11097    11067      -30     

☔ 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.

@futz12 futz12 changed the title Pipeline Cache feat Pipeline Cache Jul 10, 2025
@futz12 futz12 changed the title feat Pipeline Cache [WIP] feat Pipeline Cache Jul 13, 2025
@futz12
Copy link
Contributor Author

futz12 commented Jul 31, 2025

#6221

@futz12 futz12 closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants