KLay is a Python library for evaluating sparse circuits on the GPU.
To get started, install KLay using pip and check out the documentation. You can also refer to this video or the paper for more information.
pip install klaycircuitsKLay features:
- GPU acceleration of circuits using Jax or PyTorch.
 - Loading SDD and d-DNNF circuits compiled by PySDD or D4.
 - Evaluation in various semirings (e.g. real, log, tropical).
 - Propagating constants and merging duplicate nodes.
 
If you use KLay in your research, consider citing our paper.
To replicate the exact results and figures of the paper, use this code.
@inproceedings{
    maene2025klay,
    title={{KL}ay: Accelerating Arithmetic Circuits for Neurosymbolic {AI}},
    author = {Maene, Jaron and Derkinderen, Vincent and Zuidberg Dos Martires, Pedro},
    booktitle={The Thirteenth International Conference on Learning Representations},
    year={2025},
    url={https://openreview.net/forum?id=Zes7Wyif8G}
}