diff --git a/src/EmbeddingSpMDM.cc b/src/EmbeddingSpMDM.cc index 8dbcc78420..b2ca0df574 100644 --- a/src/EmbeddingSpMDM.cc +++ b/src/EmbeddingSpMDM.cc @@ -1310,8 +1310,11 @@ typename EmbeddingSpMDMKernelSignature:: } #ifdef FBGEMM_AUTOVEC_AVAILABLE - if (!is_autovec_disabled()) { - // There is only the reference implementation for FP8 embedding + if (!cpuinfo_initialize()) { + throw std::runtime_error("Failed to initialize cpuinfo!"); + } + if ((is_autovec_forced() || fbgemmHasArmSve2Support()) && + !is_autovec_disabled()) { return GenerateEmbeddingSpMDMFP8WithStrides_autovec< /*IndexType=*/indxType, /*OffsetType=*/offsetType, @@ -1473,7 +1476,11 @@ GenerateEmbeddingSpMDMRowWiseSparse( #endif #ifdef FBGEMM_AUTOVEC_AVAILABLE - if (is_autovec_forced()) { + if (!cpuinfo_initialize()) { + throw std::runtime_error("Failed to initialize cpuinfo!"); + } + if ((is_autovec_forced() || fbgemmHasArmSve2Support()) && + !is_autovec_disabled()) { return GenerateEmbeddingSpMDMRowWiseSparse_autovec< /*InType=*/inType, /*IndexType=*/indxType,