mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-22 19:56:25 +00:00
* docs: Add comprehensive GNN v2 implementation plans Add 22 detailed planning documents for 19 advanced GNN features: Tier 1 (Immediate - 3-6 months): - GNN-Guided HNSW Routing (+25% QPS) - Incremental Graph Learning/ATLAS (10-100x faster updates) - Neuro-Symbolic Query Execution (hybrid neural + logical) Tier 2 (Medium-Term - 6-12 months): - Hyperbolic Embeddings (Poincaré ball model) - Degree-Aware Adaptive Precision (2-4x memory reduction) - Continuous-Time Dynamic GNN (concept drift detection) Tier 3 (Research - 12+ months): - Graph Condensation (10-100x smaller graphs) - Native Sparse Attention (8-15x GPU speedup) - Quantum-Inspired Attention (long-range dependencies) Novel Innovations (10 experimental features): - Gravitational Embedding Fields, Causal Attention Networks - Topology-Aware Gradient Routing, Embedding Crystallization - Semantic Holography, Entangled Subspace Attention - Predictive Prefetch Attention, Morphological Attention - Adversarial Robustness Layer, Consensus Attention Includes comprehensive regression prevention strategy with: - Feature flag system for safe rollout - Performance baseline (186 tests + 6 search_v2 tests) - Automated rollback mechanisms Related to #38 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat(micro-hnsw-wasm): Add neuromorphic HNSW v2.3 with SNN integration ## New Crate: micro-hnsw-wasm v2.3.0 - Published to crates.io: https://crates.io/crates/micro-hnsw-wasm - 11.8KB WASM binary with 58 exported functions - Neuromorphic vector search combining HNSW + Spiking Neural Networks ### Core Features - HNSW graph-based approximate nearest neighbor search - Multi-distance metrics: L2, Cosine, Dot product - GNN extensions: typed nodes, edge weights, neighbor aggregation - Multi-core sharding: 256 cores × 32 vectors = 8K total ### Spiking Neural Network (SNN) - LIF (Leaky Integrate-and-Fire) neurons with membrane dynamics - STDP (Spike-Timing Dependent Plasticity) learning - Spike propagation through graph topology - HNSW→SNN bridge for similarity-driven neural activation ### Novel Neuromorphic Features (v2.3) - Spike-Timing Vector Encoding (rate-to-time conversion) - Homeostatic Plasticity (self-stabilizing thresholds) - Oscillatory Resonance (40Hz gamma synchronization) - Winner-Take-All Circuits (competitive selection) - Dendritic Computation (nonlinear branch integration) - Temporal Pattern Recognition (spike history matching) - Combined Neuromorphic Search pipeline ### Performance Optimizations - 5.5x faster SNN tick (2,726ns → 499ns) - 18% faster STDP learning - Pre-computed reciprocal constants - Division elimination in hot paths ### Documentation & Organization - Reorganized docs into subdirectories (gnn/, implementation/, publishing/, status/) - Added comprehensive README with badges, SEO, citations - Added benchmark.js and test_wasm.js test suites - Added DEEP_REVIEW.md with performance analysis - Added Verilog RTL for ASIC synthesis 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
124 lines
4.8 KiB
Text
124 lines
4.8 KiB
Text
# =============================================================================
|
|
# RuVector Cloud Run GPU Dockerfile
|
|
# Optimized for NVIDIA L4 GPUs on Google Cloud Run
|
|
# =============================================================================
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Stage 1: Build Environment
|
|
# -----------------------------------------------------------------------------
|
|
FROM nvidia/cuda:12.3.1-devel-ubuntu22.04 AS builder
|
|
|
|
# Prevent interactive prompts
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
build-essential \
|
|
pkg-config \
|
|
libssl-dev \
|
|
cmake \
|
|
git \
|
|
clang \
|
|
llvm \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Rust
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
# Set CUDA paths
|
|
ENV CUDA_HOME=/usr/local/cuda
|
|
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
|
ENV PATH=${CUDA_HOME}/bin:${PATH}
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy workspace Cargo files for dependency caching
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
# Copy all crate manifests
|
|
COPY crates/ruvector-core/Cargo.toml crates/ruvector-core/
|
|
COPY crates/ruvector-bench/Cargo.toml crates/ruvector-bench/
|
|
COPY crates/ruvector-gnn/Cargo.toml crates/ruvector-gnn/
|
|
COPY crates/ruvector-attention/Cargo.toml crates/ruvector-attention/
|
|
COPY crates/ruvector-raft/Cargo.toml crates/ruvector-raft/
|
|
COPY crates/ruvector-replication/Cargo.toml crates/ruvector-replication/
|
|
COPY crates/ruvector-cluster/Cargo.toml crates/ruvector-cluster/
|
|
COPY crates/ruvector-server/Cargo.toml crates/ruvector-server/
|
|
COPY crates/ruvector-collections/Cargo.toml crates/ruvector-collections/
|
|
COPY crates/ruvector-filter/Cargo.toml crates/ruvector-filter/
|
|
COPY crates/ruvector-metrics/Cargo.toml crates/ruvector-metrics/
|
|
COPY crates/ruvector-snapshot/Cargo.toml crates/ruvector-snapshot/
|
|
|
|
# Copy example manifest
|
|
COPY examples/google-cloud/Cargo.toml examples/google-cloud/
|
|
|
|
# Create stub files for dependency resolution
|
|
RUN mkdir -p crates/ruvector-core/src && echo "pub fn stub() {}" > crates/ruvector-core/src/lib.rs && \
|
|
mkdir -p crates/ruvector-bench/src && echo "pub fn stub() {}" > crates/ruvector-bench/src/lib.rs && \
|
|
mkdir -p crates/ruvector-gnn/src && echo "pub fn stub() {}" > crates/ruvector-gnn/src/lib.rs && \
|
|
mkdir -p crates/ruvector-attention/src && echo "pub fn stub() {}" > crates/ruvector-attention/src/lib.rs && \
|
|
mkdir -p crates/ruvector-raft/src && echo "pub fn stub() {}" > crates/ruvector-raft/src/lib.rs && \
|
|
mkdir -p crates/ruvector-replication/src && echo "pub fn stub() {}" > crates/ruvector-replication/src/lib.rs && \
|
|
mkdir -p crates/ruvector-cluster/src && echo "pub fn stub() {}" > crates/ruvector-cluster/src/lib.rs && \
|
|
mkdir -p crates/ruvector-server/src && echo "pub fn stub() {}" > crates/ruvector-server/src/lib.rs && \
|
|
mkdir -p crates/ruvector-collections/src && echo "pub fn stub() {}" > crates/ruvector-collections/src/lib.rs && \
|
|
mkdir -p crates/ruvector-filter/src && echo "pub fn stub() {}" > crates/ruvector-filter/src/lib.rs && \
|
|
mkdir -p crates/ruvector-metrics/src && echo "pub fn stub() {}" > crates/ruvector-metrics/src/lib.rs && \
|
|
mkdir -p crates/ruvector-snapshot/src && echo "pub fn stub() {}" > crates/ruvector-snapshot/src/lib.rs && \
|
|
mkdir -p examples/google-cloud/src && echo "fn main() {}" > examples/google-cloud/src/main.rs
|
|
|
|
# Build dependencies (cached layer)
|
|
RUN cargo build --release -p ruvector-cloudrun-gpu 2>/dev/null || true
|
|
|
|
# Copy actual source code
|
|
COPY crates/ crates/
|
|
COPY examples/google-cloud/src/ examples/google-cloud/src/
|
|
|
|
# Build the benchmark binary
|
|
RUN cargo build --release -p ruvector-cloudrun-gpu
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Stage 2: Runtime Environment
|
|
# -----------------------------------------------------------------------------
|
|
FROM nvidia/cuda:12.3.1-runtime-ubuntu22.04
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libssl3 \
|
|
ca-certificates \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create non-root user
|
|
RUN useradd -m -u 1000 -s /bin/bash ruvector
|
|
|
|
# Create app directory
|
|
WORKDIR /app
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /build/target/release/gpu-benchmark ./
|
|
|
|
# Set ownership
|
|
RUN chown -R ruvector:ruvector /app
|
|
|
|
# Switch to non-root user
|
|
USER ruvector
|
|
|
|
# Environment variables
|
|
ENV NVIDIA_VISIBLE_DEVICES=all
|
|
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
|
ENV RUVECTOR_GPU_ENABLED=true
|
|
ENV RUST_LOG=info
|
|
ENV PORT=8080
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:${PORT}/health || exit 1
|
|
|
|
# Expose port
|
|
EXPOSE 8080
|
|
|
|
# Default command: start server
|
|
CMD ["./gpu-benchmark", "serve", "--port", "8080"]
|