Skip to main content

Spike: Super Neural Network C++ Engine with 0.25-bit AVX2 Quantization

Project description

Spike

Super Neural Network (SNN) Core Engine with 0.25-bit AVX2 Quantization

PyPI Python License


Spike is a high-performance Spiking Neural Network (SNN) core and language modeling framework designed for extreme efficiency. It combines a hardware-accelerated C++ core optimized with AVX2 instruction sets and a biologically-inspired Python layer that models parameters as living, metabolic creatures with lateral inhibition and dynamic rebirth cycles.

Features

Subsystem Description
0.25-bit Quantization Sub-bit Bloom-filter based weight quantization for ultra-low memory footprints.
Metabolic Parameters Parameters behave like living cells with energy consumption, regeneration, and hunger.
Holographic LM Head Bypasses standard projection layers via holographic token mapping.
Associative Scans Lightning-fast parallel recurrent associative state scans for sequence modeling.
IPP Rebirth Protocol Intelligence Per Parameter tracking that recycles dead parameters during training.

Installation

You can install Spike directly from PyPI:

pip install spike

From source (requires a C++ compiler supporting C++11/C++14/C++17):

git clone https://github.com/mathagens-ai/spike.git
cd spike
pip install -e .

Quick Start

import spike
import numpy as np

# Instantiate standard SNN configuration
config = spike.SNNConfig.SNN_Nano()
print(f"Loaded config: vocab_size={config.vocab_size}, d_model={config.d_model}")

# Instantiate model
model = spike.SNNModel(config)

# Compile model weights down to 0.25-bit/0.45-bit Bloom Tensors
dummy_weights = {
    "encoder_attn": np.random.randn(256, 256).astype(np.float32),
    "ffn": np.random.randn(256, 512).astype(np.float32)
}
model.compile_from_dense(dummy_weights)

# Run a forward pass
input_ids = np.random.randint(0, config.vocab_size, (1, 32))
logits, states = model.forward(input_ids)

print("Forward pass successful. Logits shape:", logits.shape)

Running Tests

To verify the installation:

pytest tests/

License

Apache License 2.0 — see LICENSE for details.

Copyright 2026 Mathagens AI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snn_spike-1.0.0.tar.gz (68.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snn_spike-1.0.0-cp314-cp314-win_amd64.whl (281.3 kB view details)

Uploaded CPython 3.14Windows x86-64

File details

Details for the file snn_spike-1.0.0.tar.gz.

File metadata

  • Download URL: snn_spike-1.0.0.tar.gz
  • Upload date:
  • Size: 68.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for snn_spike-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d09ec1bbc8c74011a1deab8b49c5f6b4a300db44a96db5cc7887ecd50bdaa61b
MD5 de70414f6bdc99ebd8cec427d3fbc338
BLAKE2b-256 77844c01b8c8525b99fc48f48f5f29b545389d7d27ac07c5ae23adbf495d139b

See more details on using hashes here.

File details

Details for the file snn_spike-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: snn_spike-1.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 281.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for snn_spike-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 eca74cf5cf733da95bb8f14b7dd03916f0c61a93b7686231dddaa3f36d61d89a
MD5 276a526965be1d3f59d3164346f93643
BLAKE2b-256 3d2ccb51bf757ecf628cf9394a8302b6a6438a77c56c16fa50455e9acabf9a2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page