Easily call Slang functions and integrate with PyTorch auto diff directly from Python.
Actively maintained. Last release 5 months ago, commits in 26 of the last 26 weeks. A safe choice.
pip install slangpySlangPy
Introduction
SlangPy is a cross-platform library designed to make calling GPU code written in Slang extremely simple and easy. It's core objectives are to:
- Make it quick and simple to call Slang functions on the GPU from Python
- Eradicate the boilerplate and bugs associated with writing compute kernels
- Grant easy access to Slang's auto-diff features
- Provide optional PyTorch support out of the box
Documentation
See the documentation for more detailed information and examples.
More information about Slang in general can be found here.
Installation
SlangPy is available as pre-compiled wheels via PyPi. Installing SlangPy is as simple as running:
pip install slangpy
To enable PyTorch integration, simply pip install pytorch as usual and it will be detected automatically by SlangPy.
You can also compile SlangPy from source:
git clone https://github.com/shader-slang/slangpy.git --recursive
cd slangpy
pip install .
License
SlangPy source code is licensed under the Apache-2.0 License - see the LICENSE.txt file for details.
SlangPy depends on the following third-party libraries, which have their own license:
- argparse (MIT)
- AsmJit (Zlib)
- Dear ImGui (MIT)
- doctest (MIT)