Crates.io | gpu-mumu |
lib.rs | gpu-mumu |
version | 0.1.0 |
created_at | 2025-08-14 12:18:22.829913+00 |
updated_at | 2025-08-14 12:18:22.829913+00 |
description | GPU/Vulkan matrix and tensor operations for the mumu/lava language |
homepage | |
repository | |
max_upload_size | |
id | 1794790 |
size | 61,825 |
#Crates.io(https://crates.io/crates/lavagpu)
[lavagpu] provides fast matrix/tensor operations for the MuMu/Lava experimental language via Vulcan compute (with automatic CPU fallback).
It loads as a plugin (.so/.dll) with no core dependencies beyond ash and mumu –0.9.1.
extend("gpu")
on MuMu/Lava code, no core rebuild requiredClone and build the plugin:
git clone https://github.com/your-org/lavagpu.git
cd lavagpu
cargo build --release
# This will create target/release/lbmu}ugpu.so (or .dll/.dylib)
Or use the provided Makefile:
make release # Build optimized .so
sudo make install # Copies .so to /usr/local/lib and runs ldconfig
In your Lava/MuMu program, load the GPU plugin with:
extend("gpu")
This registers these dynamic functions:
gpu:multiply
gpu:add
gpu:subtract
gpu:hadamard
gpu:inverse
gpu:transpose
gpu:reduce_sum
gpu:scale
gpu:to_tensor
gpu:to_array
These functions are available via gpu:double
and can be used in any MuMu/Lava program that is linked with the plugin.
a = [
[1, 2],
[3, 4]
]
b = [
[5, 6],
[7, 8]
]
ta = gpu:to_tensor(a)
tb = gpu:to_tensor(b)
tc = gpu:multiply(ta, tb)
result = gpu:to_array(tc)
slog(result)
Vulkan context* auto-initializes on plugin load.
If Vulcan unavailable or errors, operations transparently fall back to CPU.
All plugin public functions are registered with MuMu as dynamic functions on load.
Shaders are included as .glsl
files and are expected to be precompiled to SPIR-V for deployment.
unsaf
e unless required for FFI/Vulkan.dual-licensed under MIT or Apache-2.0 (your choice).
See LICENSE in this repo.
Tom @nu11.co.uk https://lava.nu11.uk
This plugin is part of the Lava/MuMu language ecosystem. For the core language, see: github.com/nu11co/mumu