Drop-in, not a rewrite
Point it at an existing CPU HoloFormer; it trains and serves against the same serialized weights.
AlgFormer.Gpu adds ILGPU/CUDA-backed training and inference for the HoloFormer (holographic attention) engine from the core AlgFormer package. It builds GPU kernels straight from a CPU HoloFormer's serialized weights — no separate model format, no retraining to switch devices. Backward passes, a fused on-device Adam optimizer step, and batched forward inference all run on the GPU when one is present, with the CPU engine automatically taking over when it isn't.
dotnet add package EvaluatedApplications.AlgFormer.Gpudrop-in, not a rewrite
Point it at an existing CPU HoloFormer; it trains and serves against the same serialized weights.
Runtime device detection means the same build works on a machine with a CUDA GPU and one without — no separate code paths for callers to maintain.
Every GPU kernel is gradient-checked against the CPU HoloFormer (which does the math in double precision) as the reference oracle. GPU runs in float32 for speed, so results are float-close to the CPU reference, not bit-identical.
The optimizer step runs on the GPU too, alongside the forward/backward kernels, avoiding a round trip to the CPU on every training batch.
what you get
Forward and backward for HoloFormer, including per-layer weight-tied iterative refinement ("StackIter") and all-positions loss.
Fused on-device Adam optimizer state can be checkpointed and resumed alongside the GPU-resident training loop.
GpuDevice.HasGpu with silent, safe CPU fallback when no supported CUDA device is present.
Utilities to confirm a given GPU matches the CPU reference before trusting it in production.
honest limits
Without an ILGPU-supported CUDA device at runtime, the package falls back to the CPU HoloFormer engine automatically — the same build works either way.
The core AlgFormer package has no GPU dependency at all and stays dependency-free and AOT/trim-safe. Add this package only if you want GPU-accelerated training or inference.
The package also includes GPU support for AlgFormer's earlier (non-HoloFormer) softmax-attention model. That path still builds and runs, but all current development — including the fused Adam step — targets HoloFormer only. New projects should use the HoloFormer path.
Install from NuGet: EvaluatedApplications.AlgFormer.Gpu. Requires the core EvaluatedApplications.AlgFormer package alongside it. License: proprietary; every capability here is free to use today.