Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new CUDA autodetection and
NativeLibraryConfig
lost one major feature of the previous loading system that it replaced - automatic detection of AVX levels. Reintroduced that by probing support in theNativeLibraryConfig
constructor.I also added in support for
AVX512
even on dotnet versions that don't support it! Autodetection won't detect AVX512 except on dotnet 8.0, but you can manually specify it yourself by callingWithAvx(AvxLevel.Avx512)
.A few other minor changes to the
NativeLibraryConfig
system while I was there:NativeLibraryConfig.Default
toNativeLibraryConfig.Instance
. I don't thinkDefault
makes sense since it's mutable (so it's not the default after you've changed it)!Lazy<T>
to initialize it automatically, just a little cleaner than doing it with a lock but basically the same thing.Regression
I noticed that there's probably a (minor, ish) regression in the current 0.8.0 release for CPU only inference. Previously the default libllama.dll required AVX2 support, now the system uses no SIMD at all for the default version. That makes sense, we get wider support for older platforms. However 0.8.0 didn't ship any of the more advanced binaries for CPU, so this is probably a big slowdown for pure CPU inference!
@AsakusaRinne can we aim to get a 0.8.1 patch out next weekend with all of the various SIMD binaries for Windows and Linux? I can get started on a PR for that tomorrow if so :)