-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
How to build on windows? #103
Comments
At this point, there's support for CMake. The Python segments of the README should basically be the same. Once you install it, you can run
I'm not actually sure if you need Afterwards, the exe files should be in the build/Release folder, and you can call them in place of ./quantize and ./main
The current README points to a shell script for quantizing, but you can refer to an older version of the README for manual instructions. |
I usually run Linux, so I'm pretty unfamiliar with CMake, and there are probably better conventions for how to do this cleanly. I also tried everything in WSL and it seems to work fine. |
Probably over engineered, I just got it working on windows by using gcc compiler included in Strawberry Perl and Make distributed with chocolatey:
|
I will recommend using WSL2 on Windows, that's what I used and everything worked fine. |
Tried these steps, ran into this error. Any ideas? process_begin: CreateProcess(NULL, uname -s, ...) failed. cc -I. -O3 -DNDEBUG -std=c11 -fPIC -mfma -mf16c -mavx -mavx2 -c ggml.c -o ggml.o |
It seems you forgot to set gcc as CC command. Try running: set CC=C:\Strawberry\c\bin\gcc.exe |
It works great on Windows using the CMake. Though -t 16 is no faster than -t 8 Ryzen 9 5950x. I regenerated the prompt couple of times on 7B, and about half the time it gets it right. |
param([string]$modelPath, [switch]$removeF16)
Get-ChildItem $modelPath -Filter ggml-model-f16.bin* |
Foreach-Object {
$newName = $_.FullName.Replace("f16","q4_0");
Start-Process -FilePath ".\build\Release\quantize.exe" -ArgumentList $_.FullName, $newName, "2" -Wait
if ($removeF16) {
Remove-Item $_.FullName
}
} Call it like this
Just thought I’d share this quickly thrown together powershell script for the Windows version of |
@kaliber91 7B was terrible for me as well. 13B was a bit better. |
Solving some common issues people might come across on the latest version of Python when installing the requirements. This is specifically here as installed Windows versions of Python have compatibility issues with the chosen packages.
The sentencepiece-0.1.97-cp311-cp311-win_amd64.whl file is from here inside the wheelhouse folder. |
If you're running WSL2, it requires the creation or modification of a .wslconfig file in your user folder.
[wsl2]
memory=12GB
processors=6
swap=4GB My Setup
Based on this configuration. I succeeded in making the model conversions. However, when running edit --- |
I've manually built it using g++ via cmake, make from the msys2 distro |
I got the same error ("The system cannot find the file specified") while trying to start the build with CMake, despite I put the following at the beginning of my CMakeLists.txt file : Also, when I try g++ --version, i can see that's i'm on 6.3.0 so my WinGW is well installed. Any idea what could go wrong ? :( |
There is an very easy way to build on windows using mingw32 compilation in msys2.
|
hello, i can't find quantize.exe and llama.exe. only llama.lib in \build\Release |
Hey, all the .exe files will be located in /llama.cpp/build/bin/ after running the cmake commands. You just need to copy and paste them into the /llama.cpp/ directory. |
@fgblanch Look forward to your help, thank you! |
You saved me hours! Thank you so much. I expanded on your make command just a little to include OpenCL support: make LLAMA_CLBLAST=1 LDFLAGS='-D_POSIX_MAPPED_FILES -lmingw32_extended -lclblast -lOpenCL' CFLAGS='-D_POSIX_MAPPED_FILES -I. -O3 -DNDEBUG -std=c11 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -Wno-unused-function -mfma -mf16c -mavx -mavx2' CXXFLAGS='-D_POSIX_MAPPED_FILES -I. -I./examples -I./common -I/mingw64/include/CL -O3 -DNDEBUG -std=c++11 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function' Extra packages I needed: mingw-w64-x86_64-clblast, mingw-w64-x86_64-opencl-headers, mingw-w64-x86_64-opencl-icd ldd on quantize.exe after a successful build: Admin@nidhogg MINGW64 ~/llama.cpp Exciting times in open source these days!
|
This works.
|
Appreciate it, we've been using llama.cpp for local inference on 20x RTX
3070 Ti's and it is amazing. Can't wait to try it out on Blackwell GPUs
soon.
…On Mon, May 20, 2024 at 5:25 PM Robert Sinclair ***@***.***> wrote:
This works.
git clone --recurse-submodules https://github.com/ggerganov/llama.cpp
export CC=gcc
export CPP=g++
export LDFLAGS='-D_POSIX_MAPPED_FILES -DLLAMA_NATIVE=ON -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON -DLLMODEL_CUDA=OFF -static'
git reset --hard
git clean -fd
git pull
cd llama.cpp
mingw32-make.exe -j 6
—
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AECIFJWZS5ODQ4X44GU76LTZDJS27AVCNFSM6AAAAAAVZRRMF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRRGIZTKOJSGY>
.
You are receiving this because you commented.Message ID: <ggerganov/llama.
***@***.***>
|
Thank you @cgcha , my CPU is very old and only support AVX, doesn't support AVX2, so I have to compile it on my Windows PC. I test it today, the CMAKE_BUILD_TYPE is not necessary. Instead, if you want to utilize your Nvidia GPU like me, do the following:
cmake -S . -B build/ -D LLAMA_CUBLAS=on
cmake --build build/ --config Release This took much longer to compile then the pure CPU one. |
Please give instructions. There is nothing in README but it says that it supports it
The text was updated successfully, but these errors were encountered: