LLamaSharp icon indicating copy to clipboard operation
LLamaSharp copied to clipboard

If llama.dll is built in Debug mode, gibberish is produced when called from LLamaSharp

Open antiufo opened this issue 2 years ago • 1 comments

I tried to build my own libllama.dll (at 6b73ef120114beb5664ea94aab48d07ed248ee52, since that's what the committed libllama.dll is built from)

cmake --build . --target llama --config Debug
copy "C:\Source\llama.cpp\build\bin\Debug\llama.dll" "C:\Source\LLamaSharp\LLama.Examples\bin\Debug\net7.0\libllama.dll"

However, it appears to produce gibberish. On the other hand, it works correctly if I compile as Release. At first I thought this was a llama.cpp issue, but the C++ binary main.exe works fine both in Debug and in Release mode.

Note: The reason I'm trying to use the Debug build it to more easily debug an unrelated problem.

antiufo avatar Oct 03 '23 22:10 antiufo

That's very odd! I've just had a look through llama.cpp and I can't see any behaviour that should be different between release/debug.

The only thing I can suggest at the moment is tracing some of the low level calls and seeing if you can spot a difference in the parameters being passed or the values being returned.

martindevans avatar Oct 03 '23 22:10 martindevans