Skip to content

chore: native ANN vector index on the Tensors stack; drop external FaissNet#1899

Open
ooples wants to merge 2 commits into
feat/rag-productionizationfrom
feat/native-ann-store
Open

chore: native ANN vector index on the Tensors stack; drop external FaissNet#1899
ooples wants to merge 2 commits into
feat/rag-productionizationfrom
feat/native-ann-store

Conversation

@ooples

@ooples ooples commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Native ANN vector index on the AiDotNet stack — replaces external FaissNet

Consumes the native fused ANN kernels from AiDotNet.Tensors #824 to give FAISS-style IVF/PQ/IVFPQ/Flat search with no external native dependency, and removes the broken FaissNet backend.

Why: FaissNet's IVF/PQ path is unusable — it ships an incomplete MKL redist and dies with a process-fatal Intel MKL FATAL ERROR: Cannot load mkl_def.2.dll that can't be caught. This PR moves the whole ANN stack onto AiDotNet's own Tensors kernels.

What's here

  • AnnVectorIndex<T> : IVectorIndex<T> — Flat / IVF / PQ / IVFPQ over Tensors' AnnIndex. Bridges the incremental Add/Remove/Search contract onto a train-then-populate ANN index (live-vector source of truth + lazy rebuild), and AttachGpu(...) dispatches distance / assignment / PQ scans to the fused GPU ANN kernels (IAnnBackend) across all 7 backends, falling back to the managed CPU reference. Reuses the existing VectorIndexDocumentStore adapter, so it plugs into the RAG facade unchanged.
  • ConfigureNativeAnnIndex(...) on both IAiModelBuilder and the concrete builder — surfaces the native index from the facade with optional GPU acceleration.
  • Bump AiDotNet.Tensors 0.114.0 → 0.118.0 (the gating dependency: Tensors fix: allow setparameters on untrained time series models #824's native ANN kernel stack).
  • Removes the AiDotNet.Storage.Faiss project, its tests, the FaissNet package reference, and all solution/csproj wiring — the native path supersedes it.

Verification

  • Core builds clean against Tensors 0.118.0.
  • 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.

Merge order

Base is feat/rag-productionization (#1896) since the FaissNet code being removed was added there. Requires publishing AiDotNet.Tensors 0.118.0 (from Tensors PR #824) before CI restore goes green; verified locally against a 0.118.0 package built from that branch.

Generated with Claude Code

…issNet

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>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aidotnet_website Ready Ready Preview, Comment Jul 20, 2026 5:02am

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/franklins-projects-02a0b5a0?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5b3faf93-bf9d-41aa-a4e0-8e3e2597f5f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/native-ann-store

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Commit messages auto-fixed

One or more commit messages did not follow Conventional Commits, so they were rewritten to comply (subject case, header length ≤ 100, valid type). Each commit and its diff were preserved — no squashing.

The branch was force-pushed with the corrected messages. If you have local work on this branch, run git pull --rebase (or reset to the remote) before pushing again.

@ooples
ooples force-pushed the feat/native-ann-store branch from f0c8f83 to 2bae3bb Compare July 20, 2026 05:05
@github-actions github-actions Bot changed the title Native ANN vector index on the Tensors stack; drop external FaissNet chore: native ANN vector index on the Tensors stack; drop external FaissNet Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Title Auto-Fixed

Your PR title was automatically updated to follow Conventional Commits format.

Original title:
Native ANN vector index on the Tensors stack; drop external FaissNet

New title:
chore: native ANN vector index on the Tensors stack; drop external FaissNet

Detected type: chore: (default type)
Version impact: No release


Valid types and their effects:

  • feat: - New feature (MINOR bump: 0.1.0 → 0.2.0)
  • fix: - Bug fix (MINOR bump)
  • docs: - Documentation (MINOR bump)
  • refactor: - Code refactoring (MINOR bump)
  • perf: - Performance improvement (MINOR bump)
  • test: - Tests only (no release)
  • chore: - Build/tooling (no release)
  • ci: - CI/CD changes (no release)
  • style: - Code formatting (no release)
  • deps: - Dependency update (no release)

If the detected type is incorrect, you can manually edit the PR title.

… feat/native-ann-store

# Conflicts:
#	Directory.Packages.props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants