Skip to content

johanlabs/vs4x400

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VS4x400 is a high-performance, dual-core hardware accelerator for vector similarity search, designed for next-generation on-device AI.

License: ISC Version


🔹 Overview

VS4x400 enables ultra-fast similarity search for embeddings on edge devices. Its architecture allows low-latency vector computations while maintaining high energy efficiency. Ideal for embedding-based search, recommendation systems, and real-time AI applications.


⚙️ Features

  • Dual-core accelerator optimized for vector operations.
  • Zero-overhead hardware pipeline for N×D matrix-vector computations.
  • Support for large embeddings (up to 16k×1024 tested).
  • Energy-efficient design with extreme speedups compared to CPU implementations.
  • Easy integration into existing Python or C++ pipelines.

🏎️ Benchmark Specs

We evaluated the VS4x400 dual-core vector accelerator using different database sizes and embedding dimensions. Results show significant speedups and energy efficiency compared to software execution on a standard CPU.

Config (N×D) Hardware Cycles Hardware Time (ms) Software Time (ms) Speedup Energy Gain
1024 × 128 16,384 0.0410 0.1415 3.45× 345.4×
4096 × 256 131,072 0.3277 1.4109 4.31× 430.6×
8192 × 512 524,288 1.3107 6.3500 4.84× 484.5×
16,384 × 1024 2,097,152 5.2429 24.0144 4.58× 458.0×

Note: Hardware time is estimated for the VS4x400 running at 400 MHz with 8 MAC cores. Energy gain is calculated relative to a CPU consuming 10 W versus the VS4x400 consuming 0.1 W.


🛠️ Installation

# Clone the repository
git clone https://github.com/johanlabs/vs4x400.git
cd vs4x400

# Install dependencies
yarn install
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

⚡ Quick Start

Run the benchmark script to verify performance:

yarn benchmark

Example output:

=== VS4x400 Zero-Overhead Benchmark ===
Config: N=1024, D=128
  Hardware Time:   0.0410 ms
  Software Time:   0.1415 ms
  SPEEDUP:         3.45x
  ENERGY GAIN:     345.4x
...

📚 Usage

Python API

from vs4x400 import VectorR

engine = VectorR()
embeddings = engine.load_embeddings("data/embeddings.npy")
results = engine.query(embeddings, query_vector)

C++ API

#include "vs4x400.hpp"

VectorR engine;
engine.load_embeddings("data/embeddings.bin");
auto results = engine.query(query_vector);

📄 License

This project is licensed under the ISC License – see the LICENSE file for details.

About

VS4x400 is a high-performance, dual-core hardware accelerator for vector similarity search, designed for next-generation on-device AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors