diff --git a/activation/flake.lock b/activation/flake.lock index 1413b98e..5603c235 100644 --- a/activation/flake.lock +++ b/activation/flake.lock @@ -41,16 +41,15 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1777901020, - "narHash": "sha256-m54hEdh1kK+pDcRfJDwN0P861X5VWpC/yZ1TjTwshtA=", + "lastModified": 1779099126, + "narHash": "sha256-pjHUA4mQ+Opm04nBTetc6+rEFSwtkL49e1nAy1APLcM=", "owner": "huggingface", "repo": "kernels", - "rev": "614c6bb2ee922a832852cb5562d5571cd9600a9c", + "rev": "f4cc83f0301c59f3647663d45357b76e3468244a", "type": "github" }, "original": { "owner": "huggingface", - "ref": "torch-2.12", "repo": "kernels", "type": "github" } diff --git a/activation/flake.nix b/activation/flake.nix index 5186161b..f8ee7ca9 100644 --- a/activation/flake.nix +++ b/activation/flake.nix @@ -2,7 +2,7 @@ description = "Flake for activation kernels"; inputs = { - kernel-builder.url = "github:huggingface/kernels/torch-2.12"; + kernel-builder.url = "github:huggingface/kernels"; }; outputs = diff --git a/activation/torch-ext/activation/__init__.py b/activation/torch-ext/activation/__init__.py index 1a9cd15a..cfce59ba 100644 --- a/activation/torch-ext/activation/__init__.py +++ b/activation/torch-ext/activation/__init__.py @@ -5,56 +5,56 @@ from . import layers -def silu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: +def silu_and_mul(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.silu_and_mul(out, x) return out -def mul_and_silu(out: torch.Tensor, x: torch.Tensor) -> None: +def mul_and_silu(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.mul_and_silu(out, x) return out -def gelu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu_and_mul(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu_and_mul(out, x) return out -def gelu_tanh_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu_tanh_and_mul(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu_tanh_and_mul(out, x) return out -def fatrelu_and_mul(out: torch.Tensor, x: torch.Tensor, threshold: float = 0.0) -> None: +def fatrelu_and_mul(out: torch.Tensor, x: torch.Tensor, threshold: float = 0.0) -> torch.Tensor: ops.fatrelu_and_mul(out, x, threshold) return out -def gelu(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu(out, x) return out -def silu(out: torch.Tensor, x: torch.Tensor) -> None: +def silu(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.silu(out, x) return out -def gelu_tanh(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu_tanh(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu_tanh(out, x) return out -def gelu_fast(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu_fast(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu_fast(out, x) return out -def gelu_new(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu_new(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu_new(out, x) return out -def gelu_quick(out: torch.Tensor, x: torch.Tensor) -> None: +def gelu_quick(out: torch.Tensor, x: torch.Tensor) -> torch.Tensor: ops.gelu_quick(out, x) return out