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

readme steps don't work for me. Fails at setup_env.py #73

Closed
byjlw opened this issue Oct 22, 2024 · 8 comments
Closed

readme steps don't work for me. Fails at setup_env.py #73

byjlw opened this issue Oct 22, 2024 · 8 comments

Comments

@byjlw
Copy link

byjlw commented Oct 22, 2024

(.venv) PS C:\Users\jesse\Documents\source\BitNet> python setup_env.py --hf-repo HF1BitLLM/Llama3-8B-1.58-100B-tokens -q i2_s

Traceback (most recent call last):
  File "C:\Users\jesse\Documents\source\BitNet\setup_env.py", line 202, in <module>
    main()
  File "C:\Users\jesse\Documents\source\BitNet\setup_env.py", line 179, in main
    compile()
  File "C:\Users\jesse\Documents\source\BitNet\setup_env.py", line 163, in compile
    cmake_exists = subprocess.run(["cmake", "--version"], capture_output=True)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jesse\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jesse\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\jesse\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
@necrogay
Copy link

Same

@bmerkle
Copy link

bmerkle commented Oct 22, 2024

please make sure that in your build environment cmake is installed+in the path.
also assert that it matches the required version from readme (3.22)

there is a issue #34 + PR for this problem already.

@byjlw
Copy link
Author

byjlw commented Oct 22, 2024

installed latest version of cmake and Clang

(.venv) PS C:\Users\jesse\Documents\source\BitNet> python setup_env.py --hf-repo HF1BitLLM/Llama3-8B-1.58-100B-tokens -q i2_s
INFO:root:Compiling the code using CMake.
ERROR:root:Error occurred while running command: Command '['cmake', '-B', 'build', '-DBITNET_X86_TL2=ON', '-T', 'ClangCL']' returned non-zero exit status 1., check details in logs\generate_build_files.log

Log file entry

CMake Error at CMakeLists.txt:2 (project):
  Generator

    NMake Makefiles

  does not support toolset specification, but toolset

    ClangCL

  was specified.


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

@bmerkle
Copy link

bmerkle commented Oct 22, 2024

i first start the Developer Command Prompt for VS 2022
then i check cmake and clang (see screenshot)

then i start conda
conda activate bitnet-cpp

From your logoutput Command '['cmake', '-B', 'build', '-DBITNET_X86_TL2=ON', '-T', 'ClangCL']'
I can see that you are using ClangCL
ClangCL is the Clang compiler with a command-line interface compatible with Microsoft’s cl.exe (MSVC) compiler, which allows it to be used in environments typically meant for Visual Studio.

So please make sure that the Visual Studio clang compiler version is visible and installed:

(bitnet-cpp) C:\work\microsoft\BitNet>clang --version
clang version 17.0.3
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin

Hope you can resolve the error with this information

Image

@byjlw
Copy link
Author

byjlw commented Oct 22, 2024

Wait this project only works if you are using Visual Studio 2022? It doesn't work at all outside of it, like VSCode?

@bmerkle
Copy link

bmerkle commented Oct 22, 2024

it is C/C++ code. You have to build and compile it with a compiler (e.g. clang or clang from Visual Studio).

you should check the README :-) https://github.com/microsoft/BitNet?tab=readme-ov-file#installation

@byjlw
Copy link
Author

byjlw commented Oct 23, 2024

Let me clarify. Do i have to buy Visual studio Pro to use this library or can i use clang and CMAKE directly?
I read the readme. I don't want to buy visual studio and have clang and CMAKE installed on my machine, so i can't follow the steps to the T.

@grctest
Copy link

grctest commented Oct 30, 2024

I used the community version of visual studio, needed to add 2 extensions to enable building, then used conda and followed the readme.

I got similar errors to you when I tried using vs code insiders & venv

Now it works 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

5 participants