-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
c_api内存池的几个bug #3817
c_api内存池的几个bug #3817
Conversation
qiqikit
commented
May 21, 2022
- 修了一下c_api allocator参数的几个bug
- 做了个内存池最大使用内存限制功能,功能比较粗糙
- 提升了 allocator 的 emptyCache() 方法,小内存的设备需要
|
Codecov Report
@@ Coverage Diff @@
## master #3817 +/- ##
==========================================
+ Coverage 91.75% 93.29% +1.53%
==========================================
Files 674 674
Lines 171538 172106 +568
==========================================
+ Hits 157402 160564 +3162
+ Misses 14136 11542 -2594
Continue to review full report at Codecov.
|
This pull request introduces 2 alerts when merging 9b917d5 into c2fb93b - view on LGTM.com new alerts:
|
emptyCache 看起来就是原来的 clear 嘛?所以直接把 clear 提升到基类也ok? |
对的,一些内存比较少的国产环境中顺序推理多张图片时,识别完一张图片时,调用一下emptyCache() 可以为后续图像算法之类争取到更多一点儿内存……
叶子
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2022年5月21日(星期六) 晚上9:36
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [Tencent/ncnn] c_api内存池的几个bug (PR #3817)
emptyCache 看起来就是原来的 clear 嘛?所以直接把 clear 提升到基类也ok?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
我试了直接提升clear() 好像改动会更大一些,vk也有重名的,就单独加了名字。要是 cpu 和 vk 能统一内存池接口应该是最好的方案。没有写内存池的经验,逻辑可能欠妥,看着改就行。另外 clear() 不如 emptyCache()描述形象, pytorch里用的是后者。
叶子
|
move part of this pr to #4360 |