Initialize legacy kernels compatibility mirror
Browse files
README.md
CHANGED
|
@@ -1,35 +1,9 @@
|
|
| 1 |
-
# masked-mha-runtime
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
keeps caller-owned logits/output buffers stable across graph replay.
|
| 6 |
|
| 7 |
-
|
| 8 |
-
from kernels import get_kernel
|
| 9 |
-
import torch
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
out = torch.empty_like(q, memory_format=torch.contiguous_format)
|
| 14 |
-
ops.attention_mha_fp16_masked(q, k, v, logits=logits, out=out)
|
| 15 |
-
```
|
| 16 |
-
|
| 17 |
-
Public functions are `allocate_workspace`, `attention_mha_fp16_masked`,
|
| 18 |
-
`attention_mha_bf16_masked`, `forward_static`, `forward`, and
|
| 19 |
-
`forward_seqused_static`. The explicit masked names are additive; the legacy
|
| 20 |
-
`forward_static` entry dispatches the same kernels.
|
| 21 |
-
Inputs use `(sequence, heads, head_dim)`. The production GROOT gate covers
|
| 22 |
-
DiT `(41, 32, 48)`, ViT/LLM sequence lengths `277/1024`, padded boundaries
|
| 23 |
-
`1025/2048`, FP16 and BF16, fused strides, and bitwise CUDA Graph replay.
|
| 24 |
-
`forward_seqused_static` is the FP16 shared-KV path used by static VLA
|
| 25 |
-
decoders: Q is `(Sq,H,D)`, K/V are `(Sk_max,D)`, and a CUDA int32 `valid_k`
|
| 26 |
-
limits softmax without a standalone `-inf` fill. It supports `Sk_max <= 1024`.
|
| 27 |
-
|
| 28 |
-
The BF16 masked entry accepts `qkv_token_stride=` and validates it against the
|
| 29 |
-
actual Tensor token stride. This permits direct views into fused QKV GEMM
|
| 30 |
-
output while rejecting a mismatched layout before launch. Both masked entries
|
| 31 |
-
only read and write the valid `S_kv` columns, so padded workspace bytes never
|
| 32 |
-
participate in softmax or CUDA Graph replay.
|
| 33 |
-
|
| 34 |
-
See [CARD.md](CARD.md) for the complete contract. Source provenance is FlashRT
|
| 35 |
-
commit `24df793f4fa2d50780aea03b644208c6e0cb4162`.
|
|
|
|
| 1 |
+
# flashrt/masked-mha-runtime
|
| 2 |
|
| 3 |
+
This repository is a compatibility mirror for older `kernels` clients
|
| 4 |
+
that resolve repositories through the default Hugging Face model repo API.
|
|
|
|
| 5 |
|
| 6 |
+
Canonical Kernel Hub repo: https://huggingface.co/kernels/flashrt/masked-mha-runtime
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
Do not edit this mirror by hand. It is generated from the Kernel Hub
|
| 9 |
+
`vN` branches and contains the same `build/**` artifacts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|