mirror of https://github.com/milvus-io/milvus.git
Use Knowhere AIO Context Init Defalut Value and Panic when Fail (#26286)
Signed-off-by: Patrick Weizhi Xu <weizhi.xu@zilliz.com>pull/26319/head
parent
5b8d716cbc
commit
09da953a19
|
@ -74,7 +74,10 @@ KnowhereSetSimdType(const char* value) {
|
|||
void
|
||||
KnowhereInitThreadPool(const uint32_t num_threads) {
|
||||
knowhere::ThreadPool::InitGlobalThreadPool(num_threads);
|
||||
knowhere::KnowhereConfig::SetAioContextPool(num_threads, 32);
|
||||
if (!knowhere::KnowhereConfig::SetAioContextPool(num_threads)) {
|
||||
PanicInfo("Failed to set aio context pool with num_threads " +
|
||||
std::to_string(num_threads));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace milvus::config
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
set( KNOWHERE_VERSION 4f99dc0)
|
||||
set( KNOWHERE_VERSION aa4a42f )
|
||||
|
||||
message(STATUS "Building knowhere-${KNOWHERE_SOURCE_VER} from source")
|
||||
message(STATUS ${CMAKE_BUILD_TYPE})
|
||||
|
|
|
@ -10,7 +10,10 @@
|
|||
// or implied. See the License for the specific language governing permissions and limitations under the License
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <exception>
|
||||
|
||||
#include "config/ConfigKnowhere.h"
|
||||
#include "gtest/gtest-death-test.h"
|
||||
#include "segcore/segcore_init_c.h"
|
||||
#include "test_utils/DataGen.h"
|
||||
|
||||
|
@ -22,3 +25,15 @@ TEST(Init, Naive) {
|
|||
auto simd_type = SegcoreSetSimdType("auto");
|
||||
free(simd_type);
|
||||
}
|
||||
|
||||
TEST(Init, KnowhereThreadPoolInit) {
|
||||
#ifdef BUILD_DISK_ANN
|
||||
try {
|
||||
milvus::config::KnowhereInitThreadPool(0);
|
||||
} catch (std::exception& e) {
|
||||
ASSERT_TRUE(std::string(e.what()).find(
|
||||
"Failed to set aio context pool") != std::string::npos);
|
||||
}
|
||||
#endif
|
||||
milvus::config::KnowhereInitThreadPool(8);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue