Show HN: Sovereign-Metal – Zero-Dependency Python/Metal GPGPU Advection

Jamie_Nixx_CUI1 pts0 comments

GitHub - getcognition-online/sovereign-metal: A zero-dependency, zero-copy Python-to-Metal GPGPU advection engine & local transformer. Runs FP16 text embeddings and parallel reductions entirely on macOS/iOS integrated GPUs. · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

getcognition-online

sovereign-metal

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>2 Commits<br>2 Commits

examples

examples

sovereign_metal

sovereign_metal

.gitignore

.gitignore

LICENSE

LICENSE

README.md

README.md

setup.py

setup.py

View all files

Repository files navigation

⚜️ Sovereign-Metal

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.

🔱 Core Features

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.

📐 Mathematical Framework

Toroidal Fluid Dynamics (Soliton Advection)

The advection advects a continuous scalar field $S$ through a density field $\rho$ on a conjoined toroidal manifold:

$$\frac{\partial S}{\partial t} = -\nu \nabla^2 S - \alpha (\nabla \rho) \cdot \nabla S + \kappa |S|^2 S$$

Where:

$\nu$ represents the dissipation/damping coefficient.

$\alpha$ is the advection coupling strength.

$\kappa$ is the non-linear soliton crystallization rate.

🚀 Quick Start

1. Installation

Clone the repository and install the dependencies:

cd sovereign-metal<br>pip install -e .

2. Run Semantic Embeddings Demo

Verify the local GPGPU transformer inference:

python examples/local_embeddings.py

3. Run Toroidal Advection Benchmark

Execute the soliton advection simulation and watch the real-time crystallization metrics stream from the GPU:

python examples/benchmark_advection.py

🤝 Acknowledgements & Credits

We stand on the shoulders of giants. A sincere thank you to:

The SentenceTransformers Team: For developing the incredibly efficient all-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.

⚜️ License

MIT License. Crafted for the GPGPU developer community.

About

A zero-dependency, zero-copy Python-to-Metal GPGPU advection engine & local transformer. Runs FP16 text embeddings and parallel reductions entirely on macOS/iOS integrated GPUs.

Resources

Readme

License

MIT license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Python<br>74.1%

Metal<br>25.9%

You can’t perform that action at this time.

metal zero advection gpgpu python reload

Related Articles