A zero-dependency, high-throughput Python-to-Metal GPGPU advection engine and local transformer pipeline. Program custom MSL (Metal Shading Language) kernels directly from Python with zero-copy unified memory alignment and zero PCIe bus latency.
Zero-Copy Unified Memory: Directly maps NumPy arrays into shared CPU/GPU buffers (MTLResourceStorageModeShared
), completely bypassing PCIe transfer bottlenecks.Branchless Toroidal Boundary Wrapping: Implements hardware-level bitwise wrapping(x - 1u) & (dim - 1u)
inside MSL shaders, avoiding thread divergence and division stalls on integrated Apple/Intel GPUs.Zero-Latency Reduction Tree: Runs a dedicated Shannon entropy, localization intensity, and energy proxy reduction kernel entirely in threadgroup scratchpad memory.Standalone GPGPU Transformer: Runs FP16 BERT-style embeddings (all-MiniLM-L6-v2
) locally on Metal with strict GPGPU acceleration.
The advection advects a continuous scalar field
Where:
$\nu$ represents the dissipation/damping coefficient. - $\alpha$ is the advection coupling strength. - $\kappa$ is the non-linear soliton crystallization rate.
Clone the repository and install the dependencies:
cd sovereign-metal
pip install -e .
Verify the local GPGPU transformer inference:
python examples/local_embeddings.py
Execute the soliton advection simulation and watch the real-time crystallization metrics stream from the GPU:
python examples/benchmark_advection.py
We stand on the shoulders of giants. A sincere thank you to:
The SentenceTransformers Team: For developing the incredibly efficientall-MiniLM-L6-v2
model weights architecture.Hugging Face / Rust Tokenizers Team: For building the blazingly fast tokenization library that powers our input pipeline.Apple Metal Team: For providing the hardware-native GPGPU framework that makes continuous cognitive advection possible.
MIT License. Crafted for the GPGPU developer community.