How tagman45/oga-xdna works
OGA XDNA is a Windows inference daemon and integration layer for running ONNX Runtime GenAI models on AMD XDNA2 NPU hardware. The documented main workflow sends JSON commands from a llama.cpp integration through a named pipe to ogad.py, which loads a model and generates text. The repository also provides stdio-based daemon variants and C++ clients, a GGUF-to-OGA conversion utility, included model wrappers, and guidance/configuration for hybrid NPU+GPU use. The excerpts show cache and generation behavior; converter/export relationships and the hybrid capability are documented, but their full runtime integrations are not shown.
Main entry points: ogad_v3.py Model and KV cache · ogad_client.cpp Named-pipe caller · gguf_to_oga.py GGUF metadata converter · ogad.py Named-pipe daemon
Components 17
Daemon inference
- Named-pipe daemon
ogad.py - Stdio daemon v2
ogad_v2.py - Stdio daemon v3
ogad_v3.py - Model and KV cache
ogad_v3.py - ONNX Runtime GenAI
Client interfaces
- Named-pipe caller
ogad_client.cpp - Subprocess client
ogad_client_v3.cpp - Client API and JSON
ogad_client.h
Models and conversion
- GGUF metadata converter
gguf_to_oga.py - OGA model wrappers
qwen2_oga/genai_config.json - TinyLlama wrapper
tinyllama_oga/genai_config.json
Hybrid guidance
- Hybrid NPU/GPU guide
GUIDE_OGA_TURBOQUANT.md - Hybrid model config
qwen35_9b_balanced_ogad.json
Other components
- llama.cpp integration
- RyzenAI XDNA2 NPU
- GGUF input model
- Hugging Face model
Connections 14
- llama.cpp integration → Named-pipe caller: invokes
README.md - Named-pipe caller → Named-pipe daemon: sends JSON commands
README.md - Named-pipe caller → Stdio daemon v2: launches process
ogad_client.cpp - Subprocess client → Stdio daemon v3: launches process
ogad_client_v3.cpp - Client API and JSON → Subprocess client: provides client API
ogad_client_v3.cpp - Named-pipe daemon → Model and KV cache: dispatches commands
ogad.py - Stdio daemon v2 → Model and KV cache: loads and generates
ogad_v2.py - Stdio daemon v3 → Model and KV cache: loads and generates
ogad_v3.py - Model and KV cache → ONNX Runtime GenAI: loads and runs
ogad_v3.py - ONNX Runtime GenAI → RyzenAI XDNA2 NPU: runs inference on
README.md - GGUF input model → GGUF metadata converter: provides metadata
gguf_to_oga.py - GGUF metadata converter → OGA model wrappers: creates model config
gguf_to_oga.py - Hugging Face model → GGUF metadata converter: exports via builder
gguf_to_oga.py - Hybrid NPU/GPU guide → Hybrid model config: describes configuration