Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation for x86 and armv8 platforms #242

Closed
dongxiao92 opened this issue Dec 5, 2019 · 3 comments
Closed

compilation for x86 and armv8 platforms #242

dongxiao92 opened this issue Dec 5, 2019 · 3 comments

Comments

@dongxiao92
Copy link

Hi, I try to build xnnpack on my devices, a nvidia jetson tx2 and a macbook pro(2015), but encounter some probelms. I use the scripts/build-local.sh to build.
For tx2, the detected arch is aarch64 which is set in CMAKE_SYSTEM_PROCESSOR. In this situation, the -march=armv8.2-a+fp16 flag is added but tx2 does not implement armv8.2 instruction set. Similarly, on x86, the arch is x86_64 and avx512 is used in compilation. Even though I comment related source files(XNNPACK_AVX512F_MICROKERNEL_SRCS) and compilation flag(-mavx512f) in CMakeList.txt, avx512 code still exists in files like f32-rmax.cc in benchmark, which is activated if the marcro XNN_ARCH_X86 orXNN_ARCH_X86_64 is defined.

It seems the armv8.2 and avx512 support is necessary in default for aarch and x86, respectively. Will xnnpack support older arm archs like armv8 and x86 without avx512?

Sorry to open a new issue. But I think describing problems with a more related title helps.

@Maratyszcza
Copy link
Contributor

XNNPACK requires neither ARMv8.2 nor AVX512. The minimum requirements are ARMv7 with NEON, ARM64, x86 with SSE2, or WebAssembly. On x86/x86-64 XNNPACK will use SSE4.1, AVX, FMA3, AVX2, and AVX512F if the host processor supports these instruction sets (this is detected in runtime). FP16 compute instructions from ARMv8.2 are currently not used in XNNPACK operators, but there are experimental micro-kernels with unit test and benchmarks that leverage these instructions.

@dongxiao92
Copy link
Author

Thanks for your reply.

@misterBart
Copy link

misterBart commented Mar 12, 2024

Reopening this issue. I believe the OP experienced a build error, not a runtime error of Xnnpack. I bumped into the same issue myself today: unrecognized command line option '-mavx512vnni'. This is due to using an old Linux toolchain (in order to support old Linux platforms). For the Arm you can circumvent a similar error with -DXNNPACK_ENABLE_ARM_BF16=OFF -DXNNPACK_ENABLE_ARM_I8MM=OFF (#1465 (comment)) It would be convenient if similar flags would exist to circumvent the use of -mavx512vnni during building. Specifying -DXNNPACK_ENABLE_AVX512AMX=OFF -DXNNPACK_ENABLE_AVXVNNI=OFF did not work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants