Closed jgouly closed 1 month ago
Thanks for reporting. This warning indicates that we are assuming support for targets that aren't actually supported, or that the detection logic has erroneously concluded a target is unavailable. In either case, it's good to understand and fix the cause.
The new NEON_BF16 target is indeed the trigger. It would be disabled unless we are compiling with Clang >= 17 or GCC >= 13.2. It should also only be used if the correct compiler flags are given. Can you confirm that adding the following at the top of your source file indeed triggers "all enabled"?
#if defined(__ARM_FEATURE_AES) && \
defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && \
defined(__ARM_FEATURE_DOTPROD) && \
defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
#error "all enabled"
#endif
If so, then we have the case where we're wanting to use something but the detection fails. Is this on Apple? If so, we're checking
if (HasCpuFeature("hw.optional.AdvSIMD_HPFPCvt") &&
HasCpuFeature("hw.optional.arm.FEAT_DotProd") &&
HasCpuFeature("hw.optional.arm.FEAT_BF16")) {
otherwise, we're checking getauxval(AT_HWCAP)
for HWCAP_ASIMDHP | HWCAP_ASIMDDP | HWCAP_ASIMDBF16
. Are any of those not set on your system?
This is an Apple M2 machine running Asahi Linux.
HWCAP_ASIMDBF16
is actually an AArch32 hwcap https://github.com/torvalds/linux/blob/master/arch/arm64/include/asm/hwcap.h#L38
I think that should be replaced with HWCAP2_BF16
: https://github.com/torvalds/linux/blob/master/arch/arm64/include/uapi/asm/hwcap.h#L76
Testing that, and the WARNING disappears.
Ah, thank you for pointing that out! Golly, that's an unexpected wart, given the naming. Fixing shortly :)
I updated Highway revisions and now get:
This seems to be because of 8b7899dfcb8f5ae62be7e70903342b7be0f305d9. If it's doing runtime detection, I'm not sure why it has to warn?