Skip to content
EnntityPublic

About

Minimal C++20/CUDA multi-model inference runtime with dynamic model plugins (Sparkles) for NVIDIA DGX Spark (SM121)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Glitter: minimal C++20/CUDA SM121 multi-model inference runtime with dynamic Sparkle plugins for NVIDIA DGX Spark. 1 shared CUDA stream, 1.4 s cold boot, 0 baked-in models.

Glitter

Minimal C++20/CUDA multi-model inference runtime with dynamic model plugins (Sparkles), built for NVIDIA DGX Spark (GB10 / SM121).

Glitter runs any combination of models that fit in unified memory inside one process, one CUDA context, and one shared stream — dynamically dlopen()-ing support only for the model architectures you actually install and load.

  • Tiny, model-agnostic core (libglitter_runtime.so + glitter): Zero model code, zero TensorRT, and zero CUTLASS in the core runtime. Model families compile independently into libglitter_sparkle_<arch>.so plugins against the versioned GlitterSparkleV1 C ABI (include/glitter/sparkle.hpp).
  • Out-of-tree Sparkle SDK (find_package(Glitter)): Install Glitter core once (cmake --install), then build any model plugin in its own repository without pulling unrelated model code, weights, or dependencies.
  • 256-byte-aligned .glit v1 packs: Standardizes weights (NVFP4_E2M1, FP8_E4M3, BF16, F32) in mmap-friendly .glit binaries wrapped by sparkle.json manifests for sub-2-second cold starts.
  • Three-tier shared memory layout:
    1. Shared WeightArena: Per-ModelId coalescing allocator (alloc_for / free_owner) for N co-resident models and live unload/hot-swap.
    2. Global KvPagePool: Fixed-size physical byte pages shared across stateful models with prefix pinning, LRU eviction, and per-model purge.
    3. Shared Scratchpad + zero-copy TensorBus: Single transient activation arena and direct in-process tensor handoff.
  • Deadline-aware QuantumScheduler & cooperative GPU preemption: PriorityGpuLock + GpuYieldHook let Hard-RT audio/video workloads share one GB10 stream cleanly alongside background LLMs and scorers.

Ecosystem

  • SparkScore — First public out-of-tree Glitter Sparkle (sparkle/libglitter_sparkle_sparkscore.so): typed, calibrated System One decisions from d3-ultra 27B NVFP4 + native 27-layer ViT vision + UMA/NVMe FP8 pack store (107 ms JevBench p50, 1.4 s boot, 58+ photos/s re-sort on one DGX Spark).

Build & Install

# Host-only CPU build + unit tests (~2 s on macOS/Linux)
make test

# NVIDIA Blackwell SM120/SM121 (DGX Spark GB10) build & install SDK
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
  -DGLITTER_CUDA=ON -DGLITTER_CUDA_ARCH=sm_121a
cmake --build build --parallel
./build/glitter_tests
cmake --install build --prefix /usr/local

Build options

Option Default Description
GLITTER_CUDA AUTO Enable CUDA backend (AUTO, ON, OFF)
GLITTER_CUDA_ARCH 120f Blackwell target suffix (120f, sm_121a, etc.)
GLITTER_SPARKLES qwen In-tree reference Sparkles to compile (qwen, or NONE for core-only)
GLITTER_TRT OFF Build optional libglitter_trt.so TensorRT helper (AUTO, ON, OFF)
GLITTER_BUILD_TESTS ON Build glitter_tests

Writing an Out-of-Tree Sparkle

Install Glitter core (cmake --install), then link Glitter::runtime in your plugin repo:

cmake_minimum_required(VERSION 3.22)
project(my_sparkle LANGUAGES CXX CUDA)

find_package(Glitter REQUIRED)
glitter_add_external_sparkle(my_model IEEE_CUDA
  my_model.cpp
  kernels.cu
)
install(TARGETS glitter_sparkle_my_model
  LIBRARY DESTINATION lib/glitter/sparkles
)

Export extern "C" const glitter::GlitterSparkleV1* glitter_sparkle_v1() (and optionally extern "C" int glitter_sparkle_serve_main(int argc, char** argv) for glitter serve <arch> / glitter serve-<arch>). Glitter discovers plugins automatically from $GLITTER_SPARKLE_PATH, <exe_dir>/sparkles, <prefix>/lib/glitter/sparkles, and ~/.local/lib/glitter/sparkles.

CLI

glitter info                       # GPU / SM121 capabilities
glitter bench                      # GB10 memory bandwidth + NVFP4 GEMV rooflines
glitter sparkles                   # List discovered Sparkle plugins
glitter inspect <pack|file.glit>   # Inspect pack manifest, .glit tensors & memory probe
glitter plan <pack1> [pack2 ...]   # Dry-run unified memory admission control
glitter run <pack1> [pack2 ...]    # Load N Sparkles into one shared process
glitter serve <arch> [args...]     # Run a Sparkle's native server (or `glitter serve-<arch>`)

License

Apache License 2.0 (LICENSE). Copyright 2026 Enntity Labs.

About

Minimal C++20/CUDA multi-model inference runtime with dynamic model plugins (Sparkles) for NVIDIA DGX Spark (SM121)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages