hp-l33's picture
Add Sol-Attn Kernel Builder source
8e9f35a verified
|
Raw
History Blame Contribute Delete
1.29 kB
---
license: apache-2.0
tags:
- kernels
- cuda
- attention
- triton
- cute-dsl
---
# Sol-Attn Kernel Builder Source
This repository contains the Hugging Face Kernel Builder packaging for
[Sol-Attn](https://github.com/NVlabs/Sana/tree/sol-engine/techniques/sparse_backends/sol_attn).
The kernel implementation is pinned to NVIDIA's `NVlabs/Sana` commit
[`8a26fb0`](https://github.com/NVlabs/Sana/commit/8a26fb0ec9e353125ead798cb2e312d5ce48cded).
The packaged Python sources preserve that implementation. The only source
relocation required by Kernel Hub is converting internal `sol_attn.*` imports
to package-relative imports, so the kernel remains loadable under the
version-isolated module name assigned by `kernels.get_kernel(...)`.
Published builds are loaded from
[`Efficient-Large-Model/Sol-Attn`](https://huggingface.co/Efficient-Large-Model/Sol-Attn):
```python
from kernels import get_kernel
kernel = get_kernel("Efficient-Large-Model/Sol-Attn", version=1)
out = kernel.sol_attn(
q, # Contiguous BF16 CUDA tensor [batch, tokens, heads, 128].
k, # Same shape, dtype, layout, and device as q.
v, # Same shape, dtype, layout, and device as q.
tau=1.0,
thresh_type="exact",
)
```
See [SOURCE.md](SOURCE.md) for provenance and the verification command.