InferLLM icon indicating copy to clipboard operation
InferLLM copied to clipboard

在线程数>1时,会占满cpu核心

Open Yricky opened this issue 2 years ago • 3 comments

thread_pool.cpp38行的yield并不能成功出让线程,导致线程死循环

Yricky avatar Jun 11 '23 07:06 Yricky

怎么复现这种死循环?

chenqy4933 avatar Jun 11 '23 08:06 chenqy4933

怎么复现这种死循环?

在x86 linux (Linux 5.15.0-73-generic,ubuntu22.04,AMD R7 7735H) 或者android(arm v8a,NDK 25.2.9519653) 运行时设置线程数大于1即可复现

具体表现为用户输入后,即使回应结束了,cpu仍然满载

不知道其他平台的状况,应该都是可以复现的

Yricky avatar Jun 11 '23 08:06 Yricky

在 commit https://github.com/MegEngine/InferLLM/commit/c66b3d38a057bd1e0e707d6724fb422a2df9b833 中进行了修复。

chenqy4933 avatar Jun 12 '23 11:06 chenqy4933