Add torch211-cxx11-cu130-aarch64-linux SM110 artifact
Browse files- build/torch211-cxx11-cu130-aarch64-linux/__init__.py +54 -0
- build/torch211-cxx11-cu130-aarch64-linux/_linear_attention_seq_state_cuda_dc145d0.abi3.so +3 -0
- build/torch211-cxx11-cu130-aarch64-linux/_ops.py +6 -0
- build/torch211-cxx11-cu130-aarch64-linux/linear_attention_seq_state/__init__.py +14 -0
- build/torch211-cxx11-cu130-aarch64-linux/metadata.json +22 -0
build/torch211-cxx11-cu130-aarch64-linux/__init__.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FlashRT sequential state-scan kernels for linear attention."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Optional
|
| 6 |
+
|
| 7 |
+
import torch
|
| 8 |
+
|
| 9 |
+
from ._ops import add_op_namespace_prefix, ops
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
@torch.library.register_fake(add_op_namespace_prefix("gated_delta_recurrent_seq_bf16"))
|
| 13 |
+
def _gated_delta_recurrent_seq_fake(
|
| 14 |
+
q: torch.Tensor,
|
| 15 |
+
k: torch.Tensor,
|
| 16 |
+
v: torch.Tensor,
|
| 17 |
+
g: torch.Tensor,
|
| 18 |
+
beta: torch.Tensor,
|
| 19 |
+
state: torch.Tensor,
|
| 20 |
+
out: torch.Tensor,
|
| 21 |
+
use_qk_l2norm: bool = False,
|
| 22 |
+
) -> None:
|
| 23 |
+
if q.dim() != 3 or k.shape != q.shape or v.shape != q.shape:
|
| 24 |
+
raise RuntimeError("q/k/v must have shape (S,H,D)")
|
| 25 |
+
if g.shape != (q.shape[0], q.shape[1]) or beta.shape != g.shape:
|
| 26 |
+
raise RuntimeError("g/beta must have shape (S,H)")
|
| 27 |
+
if state.shape != (q.shape[1], q.shape[2], q.shape[2]) or out.shape != q.shape:
|
| 28 |
+
raise RuntimeError("state/out shape mismatch")
|
| 29 |
+
return None
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def gated_delta_recurrent_seq_bf16(
|
| 33 |
+
q: torch.Tensor,
|
| 34 |
+
k: torch.Tensor,
|
| 35 |
+
v: torch.Tensor,
|
| 36 |
+
g: torch.Tensor,
|
| 37 |
+
beta: torch.Tensor,
|
| 38 |
+
state: torch.Tensor,
|
| 39 |
+
*,
|
| 40 |
+
out: Optional[torch.Tensor] = None,
|
| 41 |
+
use_qk_l2norm: bool = False,
|
| 42 |
+
) -> tuple[torch.Tensor, torch.Tensor]:
|
| 43 |
+
"""Scan a full `(S,H,128)` Gated DeltaNet sequence in one launch.
|
| 44 |
+
|
| 45 |
+
`state` is updated in place with the final `(H,128,128)` state.
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
if out is None:
|
| 49 |
+
out = torch.empty_like(q)
|
| 50 |
+
ops.gated_delta_recurrent_seq_bf16(q, k, v, g, beta, state, out, bool(use_qk_l2norm))
|
| 51 |
+
return out, state
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
__all__ = ["gated_delta_recurrent_seq_bf16"]
|
build/torch211-cxx11-cu130-aarch64-linux/_linear_attention_seq_state_cuda_dc145d0.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac13a6f635e2967fc5701036ecfa302e104d9a52a1398c11b8eaa18ea9a62ed6
|
| 3 |
+
size 167416
|
build/torch211-cxx11-cu130-aarch64-linux/_ops.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _linear_attention_seq_state_cuda_dc145d0
|
| 3 |
+
ops = torch.ops._linear_attention_seq_state_cuda_dc145d0
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
return f"_linear_attention_seq_state_cuda_dc145d0::{op_name}"
|
build/torch211-cxx11-cu130-aarch64-linux/linear_attention_seq_state/__init__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ctypes
|
| 2 |
+
import importlib.util
|
| 3 |
+
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
def _import_from_path(file_path: Path):
|
| 7 |
+
path_hash = '{:x}'.format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 8 |
+
spec = importlib.util.spec_from_file_location(path_hash, file_path)
|
| 9 |
+
module = importlib.util.module_from_spec(spec)
|
| 10 |
+
sys.modules[path_hash] = module
|
| 11 |
+
spec.loader.exec_module(module)
|
| 12 |
+
return module
|
| 13 |
+
|
| 14 |
+
globals().update(vars(_import_from_path(Path(__file__).parent.parent / '__init__.py')))
|
build/torch211-cxx11-cu130-aarch64-linux/metadata.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "linear-attention-seq-state",
|
| 3 |
+
"id": "_linear_attention_seq_state_cuda_dc145d0",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "Apache-2.0",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"11.0"
|
| 11 |
+
]
|
| 12 |
+
},
|
| 13 |
+
"digest": {
|
| 14 |
+
"algorithm": "sha256",
|
| 15 |
+
"files": {
|
| 16 |
+
"__init__.py": "9W8cTFmAvUgLTK+W/HLlT0PwI+m0f9qPIlTy1BWXY6I=",
|
| 17 |
+
"_linear_attention_seq_state_cuda_dc145d0.abi3.so": "rBOm9jXiln/FcBA27PowLhBNmlKhOYwRuOqhjqmmLtY=",
|
| 18 |
+
"_ops.py": "3+JO2vsxGgiCx4F5Z531QX0rxVRMWnyuqSZsCxZPSbM=",
|
| 19 |
+
"linear_attention_seq_state/__init__.py": "v6p5XMfQzddhi1fLSAw4HX9CyS0rQsidvu9VsT01xi4="
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|