Skip to content

Commit 08ad650

Browse files
committed
Update on "[Executorch][llama] Set # of threads to use performant cores"
When using all cores, slower ones are dragging the performance down by blocking large cores. Perhaps when we have uarch specific implementation, we may not need this, but this tool is useful in general until we have better API Differential Revision: [D54766071](https://our.internmc.facebook.com/intern/diff/D54766071/) [ghstack-poisoned]
2 parents ed02e0c + 17d7c60 commit 08ad650

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backends/xnnpack/threadpool/threadpool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ size_t ThreadPool::get_thread_count() const {
4545
}
4646

4747
bool ThreadPool::_unsafe_reset_threadpool(uint32_t new_thread_count) {
48-
// No need to do anything if the count is same
49-
if (new_thread_count == get_thread_count()) {
48+
// No need to do anything if the count is same or 0
49+
if (new_thread_count == get_thread_count() || new_thread_count == 0) {
5050
return true;
5151
}
5252

0 commit comments

Comments
 (0)