# SpawnDev.ILGPU.ML

A C# library that implements neural network inference and training as GPU compute kernels for .NET, running the same code on WebGPU, CUDA, OpenCL, WebGL, WebAssembly, and CPU, including inside a browser via Blazor WebAssembly.

SpawnDev.ILGPU.ML implements neural network inference and training natively in C#, compiled via SpawnDev.ILGPU to run as compute shaders on WebGPU, CUDA, OpenCL, WebGL, WebAssembly, or CPU, without depending on ONNX Runtime, JavaScript, or native binaries. The same code runs in a browser through Blazor WebAssembly and on desktop.

It loads models in ONNX, TFLite, GGUF, and other formats across any of the supported backends, and includes demos for classification, style transfer, depth estimation, object detection, pose estimation, background removal, text generation, and an on-device LLM chat interface. Training can also run directly on the browser's GPU without a server or Python.

The project publishes a status document distinguishing verified, end-to-end-tested demos from work-in-progress ones, and is under active development with an API still stabilizing.

Website: https://lostbeard.github.io/SpawnDev.ILGPU.ML/
