Lightweight plugin-based GPU acceleration library for blockchain and ML workloads.
Overview
Lux GPU Core provides a unified C API for GPU acceleration with runtime-switchable backends. The library is designed for high-performance cryptographic operations (ZK proofs, FHE, BLS signatures) and tensor computations.
Key Features
- Plugin Architecture: Backends are dynamically loaded at runtime
- Stable ABI: Plugin interface versioned for compatibility
- Multiple Backends: Metal, CUDA, WebGPU, and CPU fallback
- Cryptographic Operations: BLS12-381, BN254, Poseidon2, KZG commitments
- FHE Support: NTT, TFHE bootstrap, key switching
- Tensor Operations: GEMM, reductions, activations, normalization
Supported Backends
| Backend | Platform | GPU Type | Status |
| Metal | macOS arm64 | Apple Silicon | Production |
| CUDA | Linux/Windows | NVIDIA | Production |
| WebGPU | Cross-platform | Any | Experimental |
| CPU | All | SIMD | Fallback |
Quick Start
int main() {
int64_t shape[] = {1024, 1024};
return 0;
}
void lux_gpu_destroy(LuxGPU *gpu)
struct LuxTensor LuxTensor
LuxGPU * lux_gpu_create(void)
LuxError lux_gpu_sync(LuxGPU *gpu)
LuxTensor * lux_tensor_matmul(LuxGPU *gpu, LuxTensor *a, LuxTensor *b)
void lux_tensor_destroy(LuxTensor *tensor)
LuxTensor * lux_tensor_ones(LuxGPU *gpu, const int64_t *shape, int ndim, LuxDtype dtype)
Architecture
+------------------+
| Application |
+------------------+
|
lux/gpu.h (C API)
|
+------------------+
| Core Library | Plugin Loader + Dispatch
+------------------+
|
backend_plugin.h (ABI)
|
+--------+--------+--------+--------+
| Metal | CUDA | WebGPU | CPU |
+--------+--------+--------+--------+
The core library provides:
Backends are separate shared libraries loaded at runtime.
Documentation
License
BSD-3-Clause-Eco