You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usage of stl functions is known to possibly leak intrinsic instructions in template functions: during linkage time, the linker is free to choose the instantiation of template functions, and if the linker chooses the instantiation that is built with, say, avx512, and then the code is run on a machine that does not have avx512, segfault with "illegal instruction" happens.
We might want to explicitly ban all usage of c++ headers, and avoid the use of any template instantiations, in .cc files (and included header files) that are built with -mavx2 and -mavx512f.
The text was updated successfully, but these errors were encountered:
This particular file ( GenerateKernelU8S8S32ACC16Avx512.cc) is not compiled with -mavx2 or -mavx512 flag. It does generate avx512 code but at runtime. We did clean up files compiled with -mavx2 and -mavx512 flags in a series of diffs (https://github.com/pytorch/FBGEMM/commits/master; series of diffs on Dec 5) to minimize the use of STL. However, there are still very few STL functions used (e.g., min/max/nearbyint in src/QuantUtilsAvx2.cc) in files compiled with -mavx2/-mavx512 that can be cleaned up by providing a local implementation.
In code here:
https://github.com/pytorch/FBGEMM/blob/master/src/GenerateKernelU8S8S32ACC16Avx512.cc#L294
STL functions are used (from iostream). This is also seen in avx2 part of the code here:
FBGEMM/src/FbgemmI8DepthwiseAvx2.cc
Lines 9 to 12 in 895646c
Usage of stl functions is known to possibly leak intrinsic instructions in template functions: during linkage time, the linker is free to choose the instantiation of template functions, and if the linker chooses the instantiation that is built with, say, avx512, and then the code is run on a machine that does not have avx512, segfault with "illegal instruction" happens.
We might want to explicitly ban all usage of c++ headers, and avoid the use of any template instantiations, in .cc files (and included header files) that are built with -mavx2 and -mavx512f.
The text was updated successfully, but these errors were encountered: