Comments (7)
Could you please take a look of the file structure of your output directory? (x64/debug/net6.0/runtimes
for example) Then please use NativeLibraryConfig.Instance.WithLogs()
to see the details during backend selection.
from llamasharp.
Test 1: only CPU nuget
Time taken: 29 secs
<PackageReference Include="LLamaSharp" />
<PackageReference Include="LLamaSharp.Backend.Cpu" />
[LLamaSharp Native] [Info] NativeLibraryConfig Description:
- Path:
- PreferCuda: True
- PreferredAvxLevel: AVX2
- AllowFallback: True
- SkipCheck: False
- Logging: True
- SearchDirectories and Priorities: { ./ }
[LLamaSharp Native] [Info] Detected OS Platform: WINDOWS
[LLamaSharp Native] [Info] Detected cuda major version 12.
[LLamaSharp Native] [Info] Tried to load runtimes/win-x64/native/cuda12/libllama.dll but failed.
[LLamaSharp Native] [Info] ./runtimes/win-x64/native/avx2/libllama.dll is selected and loaded successfully.
Test 2: only CUDA 12 nuget
Time taken: 22 secs
<PackageReference Include="LLamaSharp" />
<PackageReference Include="LLamaSharp.Backend.Cuda12" />
[LLamaSharp Native] [Info] NativeLibraryConfig Description:
- Path:
- PreferCuda: True
- PreferredAvxLevel: AVX2
- AllowFallback: True
- SkipCheck: False
- Logging: True
- SearchDirectories and Priorities: { ./ }
[LLamaSharp Native] [Info] Detected OS Platform: WINDOWS
[LLamaSharp Native] [Info] Detected cuda major version 12.
[LLamaSharp Native] [Info] ./runtimes/win-x64/native/cuda12/libllama.dll is selected and loaded successfully.
Under "native" there's only one folder with the DLL inside:
Test 3: both CPU and CUDA 12 nugets
Time taken: 29 secs
<PackageReference Include="LLamaSharp" />
<PackageReference Include="LLamaSharp.Backend.Cpu" />
<PackageReference Include="LLamaSharp.Backend.Cuda12" />
[LLamaSharp Native] [Info] NativeLibraryConfig Description:
- Path:
- PreferCuda: True
- PreferredAvxLevel: AVX2
- AllowFallback: True
- SkipCheck: False
- Logging: True
- SearchDirectories and Priorities: { ./ }
[LLamaSharp Native] [Info] Detected OS Platform: WINDOWS
[LLamaSharp Native] [Info] Detected cuda major version 12.
[LLamaSharp Native] [Info] ./runtimes/win-x64/native/cuda12/libllama.dll is selected and loaded successfully.
FunctionalTests\bin\Debug\net7.0\runtimes:
FunctionalTests\bin\Debug\net7.0\runtimes\win-x64\native:
from llamasharp.
@AsakusaRinne so everything looks ok from the logs, but as you can see the time taken doesn't match.
- Test 1: only CPU nuget - Time taken: 29 secs
- Test 2: only CUDA 12 nuget - Time taken: 22 secs
- Test 3: both CPU and CUDA 12 nugets - Time taken: 29 secs
from llamasharp.
If you delete the libllama.dll
at the root of output path, would the time taken act as expected? Note that after removing the file, please don't re-compile the project.
from llamasharp.
Also you could try adding a breakpoint in here. From there you can see the exact set of binaries it's going to try (libraryTryLoadOrder
) and which one it succeeds on.
from llamasharp.
I've created a new project to run these tests and taken the steps to manually delete the DLL files. Interestingly, in this new project, the performance timings between cuda12 and avx2 are too close to definitively say if there's an issue. For the time being, I'm placing my trust in the logs. If an opportunity arises where I can obtain a machine with a more powerful Nvidia card, I'll conduct further tests where the performance gap would likely be more evident.
from llamasharp.
@dluc If needed, you could set GpuLayerCount
a larger number to increase the time gap between cpu version and gpu version.
from llamasharp.
Related Issues (20)
- [BUG]: v0.14.0 hangs when initializing ModelParams HOT 3
- [BUG]: RTX 4080 - crash while loading Vulkan HOT 8
- [BUG]: Vulkan backend crash on model loading HOT 3
- [BUG]: Different continuation after restoring state HOT 1
- Improve `LLamaEmbedder` HOT 2
- [BUG]: KernelMemory.AskAsync() does not work - exception: object reference not set to an instance of an object HOT 25
- [BUG]: fatal error using gemma-2-2b-it HOT 3
- [BUG]: "The type or namespace 'Common' does not exist in the namespace 'LLama'" HOT 4
- Application Not Using GPU Despite Installing LlamaSharp.Backend.Cuda12 HOT 1
- [Feature]: Add development support for Dev Containers HOT 6
- How do i use RAG by kernel memory and Semantic kernel Handlebar Planner with llama3 HOT 3
- versioning issue HOT 11
- [BUG]: gemma-2-9b-it-GGUF - error loading model HOT 3
- [BUG]: Error when starting LLama Cuda11/12 HOT 6
- [BUG]: Second Response Empty when using Grammar HOT 3
- LLamaSharp v0.15.0 broke cuda backend HOT 15
- [BUG]: KernelMemory - Simultaneous execution of AskDocument & ImportDocument HOT 18
- [BUG]: Error setting variables HOT 1
- [BUG:] When switching to new versions of LLamaSharp 0.16.0, there was a slowdown HOT 30
- A few moments in the process of work LLamaSharp & KernelMemory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llamasharp.