Skip to content

Commit 2bae3bb

Browse files
franklinicclaude
andcommitted
chore: native ANN vector index on the Tensors stack; drop external FaissNet
Replaces the broken external FaissNet backend (its IVF/PQ path dies with a process-fatal "Cannot load mkl_def.2.dll") with a dependency-free native ANN index built on AiDotNet.Tensors' fused ANN kernels. - AnnVectorIndex<T> : IVectorIndex<T> — Flat/IVF/PQ/IVFPQ over Tensors' AnnIndex. Bridges the incremental Add/Remove/Search index contract onto a train-then- populate ANN index via a live-vector source of truth + lazy rebuild, and AttachGpu() dispatches to the fused GPU ANN kernels across all 7 backends, falling back to the managed CPU reference. Reuses the existing VectorIndexDocumentStore adapter, so it plugs into the RAG facade unchanged. - AiModelBuilder.ConfigureNativeAnnIndex(...) (on both IAiModelBuilder and the concrete builder) surfaces it from the facade with optional GPU acceleration. - Bump AiDotNet.Tensors 0.114.0 -> 0.118.0 (brings Tensors #824, the native ANN kernel stack — the gating dependency). - Remove the AiDotNet.Storage.Faiss project, its tests, the FaissNet package reference, and all solution/csproj wiring: the native path supersedes it and takes no external native dependency. Tests: AnnVectorIndexTests 9/9 green on net471 + net10 (exact flat NN, in-cluster recall for IVF/PQ/IVFPQ on separable clusters, Add/Remove/Clear/ AddBatch/cosine-normalization). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b9222e9 commit 2bae3bb

14 files changed

Lines changed: 490 additions & 1320 deletions

File tree

AiDotNet.sln

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AiDotNet.Storage.Sqlite", "
4141
EndProject
4242
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AiDotNet.Storage.Neo4j", "src\AiDotNet.Storage.Neo4j\AiDotNet.Storage.Neo4j.csproj", "{AC1D46B1-1711-4DC4-AD97-DBC6FA2BF396}"
4343
EndProject
44-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AiDotNet.Storage.Faiss", "src\AiDotNet.Storage.Faiss\AiDotNet.Storage.Faiss.csproj", "{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}"
45-
EndProject
4644
Global
4745
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4846
Debug|Any CPU = Debug|Any CPU
@@ -185,18 +183,6 @@ Global
185183
{BBC4C51F-3BFD-419C-9B59-ADD7AB006095}.Release|x64.Build.0 = Release|Any CPU
186184
{BBC4C51F-3BFD-419C-9B59-ADD7AB006095}.Release|x86.ActiveCfg = Release|Any CPU
187185
{BBC4C51F-3BFD-419C-9B59-ADD7AB006095}.Release|x86.Build.0 = Release|Any CPU
188-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
189-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Debug|Any CPU.Build.0 = Debug|Any CPU
190-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Debug|x64.ActiveCfg = Debug|Any CPU
191-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Debug|x64.Build.0 = Debug|Any CPU
192-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Debug|x86.ActiveCfg = Debug|Any CPU
193-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Debug|x86.Build.0 = Debug|Any CPU
194-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Release|Any CPU.ActiveCfg = Release|Any CPU
195-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Release|Any CPU.Build.0 = Release|Any CPU
196-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Release|x64.ActiveCfg = Release|Any CPU
197-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Release|x64.Build.0 = Release|Any CPU
198-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Release|x86.ActiveCfg = Release|Any CPU
199-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53}.Release|x86.Build.0 = Release|Any CPU
200186
{B1427BFB-8A17-4735-8EC5-E594A612AB81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
201187
{B1427BFB-8A17-4735-8EC5-E594A612AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU
202188
{B1427BFB-8A17-4735-8EC5-E594A612AB81}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -255,7 +241,6 @@ Global
255241
{035B7687-2236-4D7F-97C5-8BA20567DD37} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
256242
{C1E3CF04-768E-46AE-A6EB-C9F9334365E6} = {66320409-64EC-F7C5-3DEF-65E7510DAAD1}
257243
{BBC4C51F-3BFD-419C-9B59-ADD7AB006095} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
258-
{A1F5C7D2-9E3B-4C6A-8D2F-1B7E4A9C0D53} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
259244
{B1427BFB-8A17-4735-8EC5-E594A612AB81} = {66320409-64EC-F7C5-3DEF-65E7510DAAD1}
260245
{D71746F5-5342-474C-B23E-4A07B29FA4F7} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
261246
{251CF282-40BA-452B-A563-FAE6B9826B8B} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}

Directory.Packages.props

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,13 @@
248248
PersistentInputRegistry}; the src/Training mirror classes stay as the consumer-side primitives
249249
(the fused-primitive centralization in #1847/#1848 wires every consumer through them) and now
250250
run against the fixed engine. 0.113.0 is PUBLISHED to NuGet and is a superset of 0.112.0 (also
251-
carries #765 compiled-ReduceMax axis fill), so all rationale above is retained. -->
252-
<PackageVersion Include="AiDotNet.Tensors" Version="0.114.0" />
251+
carries #765 compiled-ReduceMax axis fill), so all rationale above is retained.
252+
253+
Bumped 0.114.0 -> 0.118.0: brings AiDotNet.Tensors #824 — the native fused ANN kernel stack
254+
(IAnnBackend + AnnPrimitives + AnnIndex: Flat/IVF/PQ/IVFPQ across all 7 backends). This is the
255+
GATING dependency for the dependency-free NativeAnn vector index (AnnVectorIndex<T>) that
256+
replaces the broken external FaissNet IVF/PQ path. Requires publishing Tensors 0.118.0. -->
257+
<PackageVersion Include="AiDotNet.Tensors" Version="0.118.0" />
253258
<PackageVersion Include="AiDotNet.Native.OneDNN" Version="0.114.0" />
254259
<PackageVersion Include="AiDotNet.Native.OpenBLAS" Version="0.114.0" />
255260
<PackageVersion Include="AiDotNet.Native.CLBlast" Version="0.114.0" />
@@ -310,7 +315,6 @@
310315
<PackageVersion Include="Neo4j.Driver" Version="5.28.4" />
311316
<!-- Managed FAISS wrapper (native ANN: Flat/IVF/HNSW/PQ). Consumed only by the opt-in
312317
AiDotNet.Storage.Faiss metapackage; ships a net6.0 lib + win-x64 native runtime. -->
313-
<PackageVersion Include="FaissNet" Version="1.1.0" />
314318
<PackageVersion Include="Pinecone.Client" Version="4.0.2" />
315319
<PackageVersion Include="StackExchange.Redis" Version="2.13.17" />
316320
<PackageVersion Include="Stripe.net" Version="52.1.0" />

src/AiDotNet.Storage.Faiss/AiDotNet.Storage.Faiss.csproj

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/AiDotNet.Storage.Faiss/GlobalUsings.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)