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

could you please tell me what are the flags for compiling it with bazel and switch XNNPACK OFF? python 2.12 and tensorflow 2.18.0 #193

Open
dicotom opened this issue Feb 3, 2025 · 4 comments

Comments

@dicotom
Copy link

dicotom commented Feb 3, 2025

Hi,
Although I disable all the avx instructions , it still fails with XNNPACK

ERROR: C:/users/user/_bazel_user/yopxtjri/external/XNNPACK/BUILD.bazel:803:36: Compiling external/XNNPACK/avx512vnni_prod_microkernels.c failed: (Exit 1): clang-cl.exe failed: error executing command (from target @XNNPACK//:avx512vnni_prod_microkernels)

@fo40225
Copy link
Owner

fo40225 commented Feb 5, 2025

Do you have C++ Clang Compiler for Windows, MSBuild support for LLVM (clang-cl) toolset and C++ Clang tools for Windows installed? (in Visual Studio installer)

Can you change the compiler in your build command from clang back to msvc?

@dicotom
Copy link
Author

dicotom commented Feb 5, 2025

of course, I followed this guide https://www.tensorflow.org/install/source_windows

The cpu does not support avx instructions, so in configure I included the relevant noavx flags and in bazel build --define=tflite_with_xnnpack=false, but still no luck.

The guide says:
Note: Clang will be the preferred compiler to build TensorFlow CPU wheels on the Windows Platform starting with TF 2.16.1 The currently supported version is LLVM/clang 17.0.6.
Note: To build with Clang on Windows, it is required to install both LLVM and Visual C++ Build tools as although Windows uses clang-cl.exe as the compiler, Visual C++ Build tools are needed to link to Visual C++ libraries

Do I need to use msvc? if yes, how do I do that? and which command line is it?
As you can see from the guide:

Version | Python version | Compiler | Build tools

tensorflow-2.18.0 | 3.9-3.12 | CLANG 17.0.6 | Bazel 6.5.0
tensorflow-2.17.0 | 3.9-3.12 | CLANG 17.0.6 | Bazel 6.5.0
tensorflow-2.16.1 | 3.9-3.12 | CLANG 17.0.6 | Bazel 6.5.0
tensorflow-2.15.0 | 3.9-3.11 | MSVC 2019 | Bazel 6.1.0

MSVC was used up to tensorflow 2.15.0

@fo40225
Copy link
Owner

fo40225 commented Feb 5, 2025

Sorry, I haven't compiled TensorFlow in a while.

You can refer to this link https://www.tensorflow.org/install/source_windows#cpu-only to use msvc or clang.

Try using msvc or make sure that your clang-cl and llvm/clang are installed correctly.

@dicotom
Copy link
Author

dicotom commented Feb 5, 2025

You did not get it. I know how to do that, but it does not work because it tries to compile the XNNPACK which uses avx512. Most probably when you did it, there was no XNNPACK integrated with tensorflow, but was only available with tensorflow lite.

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

2 participants