Uploaded using `kernel-builder`.
Browse files- build/torch211-cxx11-cu126-x86_64-linux/__init__.py +51 -0
- build/torch211-cxx11-cu126-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so} +2 -2
- build/torch211-cxx11-cu126-x86_64-linux/_ops.py +3 -3
- build/torch211-cxx11-cu126-x86_64-linux/metadata.json +5 -5
- build/torch211-cxx11-cu128-x86_64-linux/__init__.py +51 -0
- build/torch211-cxx11-cu128-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so} +2 -2
- build/torch211-cxx11-cu128-x86_64-linux/_ops.py +3 -3
- build/torch211-cxx11-cu128-x86_64-linux/metadata.json +5 -5
- build/torch211-cxx11-cu130-x86_64-linux/__init__.py +51 -0
- build/torch211-cxx11-cu130-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so} +2 -2
- build/torch211-cxx11-cu130-x86_64-linux/_ops.py +3 -3
- build/torch211-cxx11-cu130-x86_64-linux/metadata.json +5 -5
- build/torch212-cxx11-cu126-x86_64-linux/__init__.py +51 -0
- build/torch212-cxx11-cu126-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so} +2 -2
- build/torch212-cxx11-cu126-x86_64-linux/_ops.py +3 -3
- build/torch212-cxx11-cu126-x86_64-linux/metadata.json +5 -5
- build/torch212-cxx11-cu130-x86_64-linux/__init__.py +51 -0
- build/torch212-cxx11-cu130-x86_64-linux/_mamba3_cuda_95022f8.abi3.so +0 -3
- build/torch212-cxx11-cu130-x86_64-linux/_mamba3_cuda_c549070.abi3.so +3 -0
- build/torch212-cxx11-cu130-x86_64-linux/_ops.py +3 -3
- build/torch212-cxx11-cu130-x86_64-linux/metadata.json +5 -5
- build/torch212-cxx11-cu132-x86_64-linux/__init__.py +51 -0
- build/torch212-cxx11-cu132-x86_64-linux/_mamba3_cuda_95022f8.abi3.so +0 -3
- build/torch212-cxx11-cu132-x86_64-linux/_mamba3_cuda_c549070.abi3.so +3 -0
- build/torch212-cxx11-cu132-x86_64-linux/_ops.py +3 -3
- build/torch212-cxx11-cu132-x86_64-linux/metadata.json +5 -5
- build/torch213-cxx11-cu126-x86_64-linux/__init__.py +51 -0
- build/torch213-cxx11-cu126-x86_64-linux/_mamba3_cuda_95022f8.abi3.so +0 -3
- build/torch213-cxx11-cu126-x86_64-linux/_mamba3_cuda_c549070.abi3.so +3 -0
- build/torch213-cxx11-cu126-x86_64-linux/_ops.py +3 -3
- build/torch213-cxx11-cu126-x86_64-linux/metadata.json +5 -5
- build/torch213-cxx11-cu130-x86_64-linux/__init__.py +51 -0
- build/torch213-cxx11-cu130-x86_64-linux/_mamba3_cuda_95022f8.abi3.so +0 -3
- build/torch213-cxx11-cu130-x86_64-linux/_mamba3_cuda_c549070.abi3.so +3 -0
- build/torch213-cxx11-cu130-x86_64-linux/_ops.py +3 -3
- build/torch213-cxx11-cu130-x86_64-linux/metadata.json +5 -5
- build/torch213-cxx11-cu132-x86_64-linux/__init__.py +51 -0
- build/torch213-cxx11-cu132-x86_64-linux/_mamba3_cuda_95022f8.abi3.so +0 -3
- build/torch213-cxx11-cu132-x86_64-linux/_mamba3_cuda_c549070.abi3.so +3 -0
- build/torch213-cxx11-cu132-x86_64-linux/_ops.py +3 -3
- build/torch213-cxx11-cu132-x86_64-linux/metadata.json +5 -5
build/torch211-cxx11-cu126-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch211-cxx11-cu126-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:141f1ccdf30fd91844b71a08eaa9919be3c2fe6258a60523a3abd23afe944a26
|
| 3 |
+
size 6357160
|
build/torch211-cxx11-cu126-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch211-cxx11-cu126-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -16,9 +16,9 @@
|
|
| 16 |
"digest": {
|
| 17 |
"algorithm": "sha256",
|
| 18 |
"files": {
|
| 19 |
-
"__init__.py": "
|
| 20 |
-
"
|
| 21 |
-
"_ops.py": "
|
| 22 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 23 |
}
|
| 24 |
},
|
|
@@ -29,7 +29,7 @@
|
|
| 29 |
"dirty": false
|
| 30 |
},
|
| 31 |
"kernel": {
|
| 32 |
-
"sha": "
|
| 33 |
"dirty": false
|
| 34 |
}
|
| 35 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 16 |
"digest": {
|
| 17 |
"algorithm": "sha256",
|
| 18 |
"files": {
|
| 19 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 20 |
+
"_mamba3_cuda_c549070.abi3.so": "FB8czfMP2RhEtxoI6qmRm+PC/mJYpgUjo6vSOv6USiY=",
|
| 21 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 22 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 23 |
}
|
| 24 |
},
|
|
|
|
| 29 |
"dirty": false
|
| 30 |
},
|
| 31 |
"kernel": {
|
| 32 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 33 |
"dirty": false
|
| 34 |
}
|
| 35 |
}
|
build/torch211-cxx11-cu128-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch211-cxx11-cu128-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88e544b58ad03bcd92a26f3f2f0be770bd65fb274a79a40f427f55546f8d5990
|
| 3 |
+
size 9969928
|
build/torch211-cxx11-cu128-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch211-cxx11-cu128-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -18,9 +18,9 @@
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
-
"__init__.py": "
|
| 22 |
-
"
|
| 23 |
-
"_ops.py": "
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
-
"sha": "
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 22 |
+
"_mamba3_cuda_c549070.abi3.so": "iOVEtYrQO82Som8/LwvncL1l+ydKeaQPQn9VVG+NWZA=",
|
| 23 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
build/torch211-cxx11-cu130-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch211-cxx11-cu130-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54b23ced497150c6046cc5ac4cbb539aa994c0914e903edbc693840b92a2fed6
|
| 3 |
+
size 9781256
|
build/torch211-cxx11-cu130-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch211-cxx11-cu130-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -18,9 +18,9 @@
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
-
"__init__.py": "
|
| 22 |
-
"
|
| 23 |
-
"_ops.py": "
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
-
"sha": "
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 22 |
+
"_mamba3_cuda_c549070.abi3.so": "VLI87UlxUMYEbMWsTLtTmqmUwJFOkD7bxpOEC5Ki/tY=",
|
| 23 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
build/torch212-cxx11-cu126-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch212-cxx11-cu126-x86_64-linux/{_mamba3_cuda_95022f8.abi3.so → _mamba3_cuda_c549070.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6fa7abbfce2cdaa2019648bfd060b9c89c921cc6d063acce57ba3c36bddba519
|
| 3 |
+
size 6357056
|
build/torch212-cxx11-cu126-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch212-cxx11-cu126-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -16,9 +16,9 @@
|
|
| 16 |
"digest": {
|
| 17 |
"algorithm": "sha256",
|
| 18 |
"files": {
|
| 19 |
-
"__init__.py": "
|
| 20 |
-
"
|
| 21 |
-
"_ops.py": "
|
| 22 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 23 |
}
|
| 24 |
},
|
|
@@ -29,7 +29,7 @@
|
|
| 29 |
"dirty": false
|
| 30 |
},
|
| 31 |
"kernel": {
|
| 32 |
-
"sha": "
|
| 33 |
"dirty": false
|
| 34 |
}
|
| 35 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 16 |
"digest": {
|
| 17 |
"algorithm": "sha256",
|
| 18 |
"files": {
|
| 19 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 20 |
+
"_mamba3_cuda_c549070.abi3.so": "b6erv84s2qIBlki/0GC5yJySHMbQY6zOV7o8Nr3bpRk=",
|
| 21 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 22 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 23 |
}
|
| 24 |
},
|
|
|
|
| 29 |
"dirty": false
|
| 30 |
},
|
| 31 |
"kernel": {
|
| 32 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 33 |
"dirty": false
|
| 34 |
}
|
| 35 |
}
|
build/torch212-cxx11-cu130-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch212-cxx11-cu130-x86_64-linux/_mamba3_cuda_95022f8.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0e7fc866c4a13501771152158b29f29847fcf49591b8a97380d33ea0b514887e
|
| 3 |
-
size 9781160
|
|
|
|
|
|
|
|
|
|
|
|
build/torch212-cxx11-cu130-x86_64-linux/_mamba3_cuda_c549070.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f682d95fc61b6b2b35da76007e0d79be29b21e53ac88c81202b607c5ba03cf34
|
| 3 |
+
size 9781520
|
build/torch212-cxx11-cu130-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch212-cxx11-cu130-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -18,9 +18,9 @@
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
-
"__init__.py": "
|
| 22 |
-
"
|
| 23 |
-
"_ops.py": "
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
-
"sha": "
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 22 |
+
"_mamba3_cuda_c549070.abi3.so": "9oLZX8Ybays12nYAfg15vimyHlOsiMgSArYHxboDzzQ=",
|
| 23 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
build/torch212-cxx11-cu132-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch212-cxx11-cu132-x86_64-linux/_mamba3_cuda_95022f8.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:72d692a106fe0e6827903413f69291a2b7dca0971e936b09db1f57cd16a6c510
|
| 3 |
-
size 9899944
|
|
|
|
|
|
|
|
|
|
|
|
build/torch212-cxx11-cu132-x86_64-linux/_mamba3_cuda_c549070.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d767da8589280130d46c1bde9e5ad6fb81d943b4e6cf6c40bace41c288d416ef
|
| 3 |
+
size 9904400
|
build/torch212-cxx11-cu132-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch212-cxx11-cu132-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -18,9 +18,9 @@
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
-
"__init__.py": "
|
| 22 |
-
"
|
| 23 |
-
"_ops.py": "
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
-
"sha": "
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 22 |
+
"_mamba3_cuda_c549070.abi3.so": "12fahYkoATDUbBvenlrW+4HZQ7Tmz2xAus5BwojUFu8=",
|
| 23 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
build/torch213-cxx11-cu126-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch213-cxx11-cu126-x86_64-linux/_mamba3_cuda_95022f8.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:b2a46b3eb53a3dea7570012ebd536aecf803763a423038d38e8d466b57507c8e
|
| 3 |
-
size 6356984
|
|
|
|
|
|
|
|
|
|
|
|
build/torch213-cxx11-cu126-x86_64-linux/_mamba3_cuda_c549070.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54292496960e8d5e438bf4f60a80e7d4349f4f0d75457be74cb633e2b175ba17
|
| 3 |
+
size 6357344
|
build/torch213-cxx11-cu126-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch213-cxx11-cu126-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -16,9 +16,9 @@
|
|
| 16 |
"digest": {
|
| 17 |
"algorithm": "sha256",
|
| 18 |
"files": {
|
| 19 |
-
"__init__.py": "
|
| 20 |
-
"
|
| 21 |
-
"_ops.py": "
|
| 22 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 23 |
}
|
| 24 |
},
|
|
@@ -29,7 +29,7 @@
|
|
| 29 |
"dirty": false
|
| 30 |
},
|
| 31 |
"kernel": {
|
| 32 |
-
"sha": "
|
| 33 |
"dirty": false
|
| 34 |
}
|
| 35 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 16 |
"digest": {
|
| 17 |
"algorithm": "sha256",
|
| 18 |
"files": {
|
| 19 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 20 |
+
"_mamba3_cuda_c549070.abi3.so": "VCkklpYOjV5Di/T2CoDn1DSfTw11RXvnTLYz4rF1uhc=",
|
| 21 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 22 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 23 |
}
|
| 24 |
},
|
|
|
|
| 29 |
"dirty": false
|
| 30 |
},
|
| 31 |
"kernel": {
|
| 32 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 33 |
"dirty": false
|
| 34 |
}
|
| 35 |
}
|
build/torch213-cxx11-cu130-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch213-cxx11-cu130-x86_64-linux/_mamba3_cuda_95022f8.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:8397f55e5c3b107d74dbfc7dcad82645104fb180b04efc7e17c5986006b5bc53
|
| 3 |
-
size 9781448
|
|
|
|
|
|
|
|
|
|
|
|
build/torch213-cxx11-cu130-x86_64-linux/_mamba3_cuda_c549070.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a081e8b4d7b21bfaa50c82b0163e155916f42d38fed8aa1a035fd29b60e00066
|
| 3 |
+
size 9781808
|
build/torch213-cxx11-cu130-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch213-cxx11-cu130-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -18,9 +18,9 @@
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
-
"__init__.py": "
|
| 22 |
-
"
|
| 23 |
-
"_ops.py": "
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
-
"sha": "
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 22 |
+
"_mamba3_cuda_c549070.abi3.so": "oIHotNeyG/qlDIKwFj4VWRb0LTj+2KoaA1/Sm2DgAGY=",
|
| 23 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
build/torch213-cxx11-cu132-x86_64-linux/__init__.py
CHANGED
|
@@ -13,6 +13,57 @@ from ._ops import ops
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def cumulative_angles(angles, dt):
|
| 17 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 18 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
|
|
|
| 13 |
__all__ = ["forward", "DecodeState", "cumulative_angles", "chunk_decay"]
|
| 14 |
|
| 15 |
|
| 16 |
+
def _register_fakes():
|
| 17 |
+
"""Meta kernels for the three ops, so a compiled graph does not break here.
|
| 18 |
+
|
| 19 |
+
The step op mutates four of its arguments; those carry `Tensor(a!)` in the
|
| 20 |
+
schema, so functionalization handles them and a fake only has to produce the
|
| 21 |
+
return value. The library name is read off a live op because the kernel
|
| 22 |
+
builder and a local JIT build choose different ones.
|
| 23 |
+
"""
|
| 24 |
+
try:
|
| 25 |
+
lib = ops.mamba3_mimo_fwd.default._schema.name.split("::")[0]
|
| 26 |
+
except Exception:
|
| 27 |
+
return ()
|
| 28 |
+
|
| 29 |
+
def like_f32(t):
|
| 30 |
+
return torch.empty_like(t, dtype=torch.float32)
|
| 31 |
+
|
| 32 |
+
def register(name, fn):
|
| 33 |
+
if not hasattr(ops, name):
|
| 34 |
+
return False
|
| 35 |
+
torch.library.register_fake(f"{lib}::{name}", fn)
|
| 36 |
+
return True
|
| 37 |
+
|
| 38 |
+
def _step(q, k, v, z, adt, dt, trap, q_bias, k_bias, angles, mimo_v, mimo_o,
|
| 39 |
+
mimo_z, D, angle_in, angle_out, S_st, kprev_in, vprev_in,
|
| 40 |
+
kprev_out, vprev_out):
|
| 41 |
+
return torch.empty_like(v)
|
| 42 |
+
|
| 43 |
+
def _fwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 44 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps):
|
| 45 |
+
return torch.empty_like(v)
|
| 46 |
+
|
| 47 |
+
def _bwd(q, k, v, z, q_bias, k_bias, mimo_v, mimo_o, mimo_z, D, angles, dt,
|
| 48 |
+
trap, dA_cs, dA_cs_rev, chunk_size, norm_weight, norm_eps, dy):
|
| 49 |
+
H, P = v.shape[-2], v.shape[-1]
|
| 50 |
+
f32 = torch.float32
|
| 51 |
+
return [like_f32(q), like_f32(k), like_f32(v), like_f32(v),
|
| 52 |
+
like_f32(q_bias), like_f32(k_bias), like_f32(mimo_v),
|
| 53 |
+
like_f32(mimo_o), like_f32(mimo_v),
|
| 54 |
+
v.new_empty((H,), dtype=f32), v.new_empty((H, P), dtype=f32),
|
| 55 |
+
like_f32(dA_cs), like_f32(dA_cs_rev), like_f32(dt),
|
| 56 |
+
like_f32(trap), like_f32(angles)]
|
| 57 |
+
|
| 58 |
+
done = [n for n, f in (("mamba3_mimo_step", _step),
|
| 59 |
+
("mamba3_mimo_fwd", _fwd),
|
| 60 |
+
("mamba3_mimo_bwd", _bwd)) if register(n, f)]
|
| 61 |
+
return tuple(done)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
FAKE_OPS = _register_fakes()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
def cumulative_angles(angles, dt):
|
| 68 |
"""Per-step rotation rates (B,S,H,Na) and dt (B,H,S) -> cumulative angles, float32."""
|
| 69 |
base = torch.tanh(angles.float()) * dt.float().permute(0, 2, 1)[..., None] * math.pi
|
build/torch213-cxx11-cu132-x86_64-linux/_mamba3_cuda_95022f8.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:30a1344dae5df07c7eb0a2498cdfe1fa192b135ded4bb438b33f633d32b38982
|
| 3 |
-
size 9900232
|
|
|
|
|
|
|
|
|
|
|
|
build/torch213-cxx11-cu132-x86_64-linux/_mamba3_cuda_c549070.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74b0abe576e73608430da49662a126fd8cca0453a390369a62f3457050517690
|
| 3 |
+
size 9904688
|
build/torch213-cxx11-cu132-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _mamba3_cuda_c549070
|
| 3 |
+
ops = torch.ops._mamba3_cuda_c549070
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_mamba3_cuda_c549070::{op_name}"
|
build/torch213-cxx11-cu132-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
@@ -18,9 +18,9 @@
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
-
"__init__.py": "
|
| 22 |
-
"
|
| 23 |
-
"_ops.py": "
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
-
"sha": "
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "mamba3",
|
| 3 |
+
"id": "_mamba3_cuda_c549070",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"python-depends": [],
|
|
|
|
| 18 |
"digest": {
|
| 19 |
"algorithm": "sha256",
|
| 20 |
"files": {
|
| 21 |
+
"__init__.py": "zKP4l3anEqOcUuw5TEp4mkMhr0OFWQe9cUTq0Wu38aQ=",
|
| 22 |
+
"_mamba3_cuda_c549070.abi3.so": "dLCr5XbnNghDDaSWYqEm/YzKBFOjkDaaYvNFcFBRdpA=",
|
| 23 |
+
"_ops.py": "Hw1EtZGXlC4SXcGIUpbQwVl8+sKMlb72u1JIHgKqHT8=",
|
| 24 |
"mamba3/__init__.py": "DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="
|
| 25 |
}
|
| 26 |
},
|
|
|
|
| 31 |
"dirty": false
|
| 32 |
},
|
| 33 |
"kernel": {
|
| 34 |
+
"sha": "c54907036afbc32fae8bddb75ae7aa2bbaf3dde3",
|
| 35 |
"dirty": false
|
| 36 |
}
|
| 37 |
}
|