diff --git a/README.md b/README.md index 6c2e823d2c11f8bd341796712252d0beceb93bfd..4d0561e803c34dc86855ced8fdaa54ca836ef8e2 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ tags: - kernel --- - -![Status](https://hubwebhook.dholtz.com/shield?repo=kernels-community/activation) - ## Activation Activation kernels from [vLLM](https://github.com/vllm-project/vllm/blob/main/csrc/activation_kernels.cu). \ No newline at end of file diff --git a/build.toml b/build.toml index 0108f3f8b5b4e6a626b926dc4f91df50bf9a707e..7da9d632a70edb0699eb77f097b9b1a5ae573c48 100644 --- a/build.toml +++ b/build.toml @@ -1,18 +1,17 @@ [general] name = "activation" -universal = false [torch] src = [ - "torch-ext/torch_binding.cpp", - "torch-ext/torch_binding.h", + "torch-ext/torch_binding.cpp", + "torch-ext/torch_binding.h" ] [kernel.activation] -backend = "cuda" -depends = ["torch"] +cuda-capabilities = [ "7.0", "7.2", "7.5", "8.0", "8.6", "8.7", "8.9", "9.0" ] src = [ - "activation/activation_kernels.cu", - "activation/cuda_compat.h", - "activation/dispatch_utils.h", + "activation/activation_kernels.cu", + "activation/cuda_compat.h", + "activation/dispatch_utils.h", ] +depends = [ "torch" ] diff --git a/build/torch27-cxx11-cu118-x86_64-linux/activation/__init__.py b/build/torch25-cxx11-cu118-x86_64-linux/activation/__init__.py similarity index 100% rename from build/torch27-cxx11-cu118-x86_64-linux/activation/__init__.py rename to build/torch25-cxx11-cu118-x86_64-linux/activation/__init__.py diff --git a/build/torch25-cxx11-cu118-x86_64-linux/activation/_activation_o63kkyjirmkf4.abi3.so b/build/torch25-cxx11-cu118-x86_64-linux/activation/_activation_o63kkyjirmkf4.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..1442eb73f43c4768d2b8f9b916943743256af106 --- /dev/null +++ b/build/torch25-cxx11-cu118-x86_64-linux/activation/_activation_o63kkyjirmkf4.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d50cdabfbed1df74e921ac34ff00bca0555977b14ef8082ddae7b1f30985a494 +size 2370160 diff --git a/build/torch25-cxx11-cu118-x86_64-linux/activation/_ops.py b/build/torch25-cxx11-cu118-x86_64-linux/activation/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..0ee3c40cd38699ce7744be53b0531fe4fa505996 --- /dev/null +++ b/build/torch25-cxx11-cu118-x86_64-linux/activation/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _activation_o63kkyjirmkf4 +ops = torch.ops._activation_o63kkyjirmkf4 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_activation_o63kkyjirmkf4::{op_name}" \ No newline at end of file diff --git a/build/torch27-cxx11-cu118-x86_64-linux/activation/layers.py b/build/torch25-cxx11-cu118-x86_64-linux/activation/layers.py similarity index 87% rename from build/torch27-cxx11-cu118-x86_64-linux/activation/layers.py rename to build/torch25-cxx11-cu118-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch27-cxx11-cu118-x86_64-linux/activation/layers.py +++ b/build/torch25-cxx11-cu118-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch27-cxx11-cu126-x86_64-linux/activation/__init__.py b/build/torch25-cxx11-cu121-x86_64-linux/activation/__init__.py similarity index 100% rename from build/torch27-cxx11-cu126-x86_64-linux/activation/__init__.py rename to build/torch25-cxx11-cu121-x86_64-linux/activation/__init__.py diff --git a/build/torch25-cxx11-cu121-x86_64-linux/activation/_activation_vrl36m2ejer54.abi3.so b/build/torch25-cxx11-cu121-x86_64-linux/activation/_activation_vrl36m2ejer54.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..e6b6260c4378717d4369cd2577a00350960e317c --- /dev/null +++ b/build/torch25-cxx11-cu121-x86_64-linux/activation/_activation_vrl36m2ejer54.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bd0709ef09c8f0c18d1dc4a36c8096c59459bece61f5f5dbea95d1e73f54d44 +size 2393264 diff --git a/build/torch25-cxx11-cu121-x86_64-linux/activation/_ops.py b/build/torch25-cxx11-cu121-x86_64-linux/activation/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..cd5eee20b4c9a70e4f59e7198a0a28c5dfa06244 --- /dev/null +++ b/build/torch25-cxx11-cu121-x86_64-linux/activation/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _activation_vrl36m2ejer54 +ops = torch.ops._activation_vrl36m2ejer54 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_activation_vrl36m2ejer54::{op_name}" \ No newline at end of file diff --git a/build/torch27-cxx11-cu126-x86_64-linux/activation/layers.py b/build/torch25-cxx11-cu121-x86_64-linux/activation/layers.py similarity index 87% rename from build/torch27-cxx11-cu126-x86_64-linux/activation/layers.py rename to build/torch25-cxx11-cu121-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch27-cxx11-cu126-x86_64-linux/activation/layers.py +++ b/build/torch25-cxx11-cu121-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch27-cxx11-cu128-x86_64-linux/activation/__init__.py b/build/torch25-cxx11-cu124-x86_64-linux/activation/__init__.py similarity index 100% rename from build/torch27-cxx11-cu128-x86_64-linux/activation/__init__.py rename to build/torch25-cxx11-cu124-x86_64-linux/activation/__init__.py diff --git a/build/torch25-cxx11-cu124-x86_64-linux/activation/_activation_va3moa75vw7c2.abi3.so b/build/torch25-cxx11-cu124-x86_64-linux/activation/_activation_va3moa75vw7c2.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..2bfbc3667e483ce8441b310889b63614133f6334 --- /dev/null +++ b/build/torch25-cxx11-cu124-x86_64-linux/activation/_activation_va3moa75vw7c2.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8353447f64e7d2df1a6a341d9c53bced53abef267f079923ae774170d0d57c53 +size 2427936 diff --git a/build/torch25-cxx11-cu124-x86_64-linux/activation/_ops.py b/build/torch25-cxx11-cu124-x86_64-linux/activation/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..05fa036d769ea858865c92b972c68a158899eca1 --- /dev/null +++ b/build/torch25-cxx11-cu124-x86_64-linux/activation/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _activation_va3moa75vw7c2 +ops = torch.ops._activation_va3moa75vw7c2 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_activation_va3moa75vw7c2::{op_name}" \ No newline at end of file diff --git a/build/torch27-cxx11-cu128-x86_64-linux/activation/layers.py b/build/torch25-cxx11-cu124-x86_64-linux/activation/layers.py similarity index 87% rename from build/torch27-cxx11-cu128-x86_64-linux/activation/layers.py rename to build/torch25-cxx11-cu124-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch27-cxx11-cu128-x86_64-linux/activation/layers.py +++ b/build/torch25-cxx11-cu124-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch25-cxx98-cu118-x86_64-linux/activation/__init__.py b/build/torch25-cxx98-cu118-x86_64-linux/activation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ddb37490dad9d8ffcbeb13ed06b33f03fef8ed78 --- /dev/null +++ b/build/torch25-cxx98-cu118-x86_64-linux/activation/__init__.py @@ -0,0 +1,52 @@ +import torch + +from ._ops import ops + +from . import layers + + +def silu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.silu_and_mul(out, x) + return out + + +def gelu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_and_mul(out, x) + return out + + +def gelu_tanh_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_tanh_and_mul(out, x) + return out + + +def fatrelu_and_mul(out: torch.Tensor, x: torch.Tensor, threshold: float = 0.0) -> None: + ops.fatrelu_and_mul(out, x, threshold) + return out + + +def gelu_fast(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_fast(out, x) + return out + + +def gelu_new(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_new(out, x) + return out + + +def gelu_quick(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_quick(out, x) + return out + + +__all__ = [ + "silu_and_mul", + "gelu_and_mul", + "gelu_tanh_and_mul", + "fatrelu_and_mul", + "gelu_fast", + "gelu_new", + "gelu_quick", + "layers", +] diff --git a/build/torch25-cxx98-cu118-x86_64-linux/activation/_activation_qr3gs3eckeig4.abi3.so b/build/torch25-cxx98-cu118-x86_64-linux/activation/_activation_qr3gs3eckeig4.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..fc35d5f1bdad2b294897ace78c80c2913e8bd793 --- /dev/null +++ b/build/torch25-cxx98-cu118-x86_64-linux/activation/_activation_qr3gs3eckeig4.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df184a6315118d787a1bd6b435cb45f1ca7828445a1f1c0e55c57645cfbba43a +size 2362600 diff --git a/build/torch25-cxx98-cu118-x86_64-linux/activation/_ops.py b/build/torch25-cxx98-cu118-x86_64-linux/activation/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..11bf3a1e13ad4f53348d55ce0b8e727307534d67 --- /dev/null +++ b/build/torch25-cxx98-cu118-x86_64-linux/activation/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _activation_qr3gs3eckeig4 +ops = torch.ops._activation_qr3gs3eckeig4 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_activation_qr3gs3eckeig4::{op_name}" \ No newline at end of file diff --git a/build/torch25-cxx98-cu118-x86_64-linux/activation/layers.py b/build/torch25-cxx98-cu118-x86_64-linux/activation/layers.py new file mode 100644 index 0000000000000000000000000000000000000000..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f --- /dev/null +++ b/build/torch25-cxx98-cu118-x86_64-linux/activation/layers.py @@ -0,0 +1,65 @@ +import torch +import torch.nn as nn + +from ._ops import ops + + +class SiluAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.silu_and_mul(out, x) + return out + + +class GeluAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.gelu_and_mul(out, x) + return out + + +class GeluTanhAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.gelu_tanh_and_mul(out, x) + return out + + +class FatreluAndMul(nn.Module): + def __init__(self, threshold: float = 0.0): + super().__init__() + self.threshold = threshold + + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.fatrelu_and_mul(out, x, self.threshold) + return out + + +class FastGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_fast(out, x) + return out + + +class NewGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_new(out, x) + return out + + +class QuickGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_quick(out, x) + return out diff --git a/build/torch25-cxx98-cu121-x86_64-linux/activation/__init__.py b/build/torch25-cxx98-cu121-x86_64-linux/activation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ddb37490dad9d8ffcbeb13ed06b33f03fef8ed78 --- /dev/null +++ b/build/torch25-cxx98-cu121-x86_64-linux/activation/__init__.py @@ -0,0 +1,52 @@ +import torch + +from ._ops import ops + +from . import layers + + +def silu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.silu_and_mul(out, x) + return out + + +def gelu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_and_mul(out, x) + return out + + +def gelu_tanh_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_tanh_and_mul(out, x) + return out + + +def fatrelu_and_mul(out: torch.Tensor, x: torch.Tensor, threshold: float = 0.0) -> None: + ops.fatrelu_and_mul(out, x, threshold) + return out + + +def gelu_fast(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_fast(out, x) + return out + + +def gelu_new(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_new(out, x) + return out + + +def gelu_quick(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_quick(out, x) + return out + + +__all__ = [ + "silu_and_mul", + "gelu_and_mul", + "gelu_tanh_and_mul", + "fatrelu_and_mul", + "gelu_fast", + "gelu_new", + "gelu_quick", + "layers", +] diff --git a/build/torch25-cxx98-cu121-x86_64-linux/activation/_activation_p7gbzt25w3zg2.abi3.so b/build/torch25-cxx98-cu121-x86_64-linux/activation/_activation_p7gbzt25w3zg2.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..e24099a45ad0e0ab481769c24c749947c164b07c --- /dev/null +++ b/build/torch25-cxx98-cu121-x86_64-linux/activation/_activation_p7gbzt25w3zg2.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccb13cfc2e45cf483e8b9f77f1760f28b48bcf185508d51b32d45bc759c4e8bb +size 2385440 diff --git a/build/torch25-cxx98-cu121-x86_64-linux/activation/_ops.py b/build/torch25-cxx98-cu121-x86_64-linux/activation/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..fbe888c4ec71536f08f7de2d823b75d9bbac0173 --- /dev/null +++ b/build/torch25-cxx98-cu121-x86_64-linux/activation/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _activation_p7gbzt25w3zg2 +ops = torch.ops._activation_p7gbzt25w3zg2 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_activation_p7gbzt25w3zg2::{op_name}" \ No newline at end of file diff --git a/build/torch25-cxx98-cu121-x86_64-linux/activation/layers.py b/build/torch25-cxx98-cu121-x86_64-linux/activation/layers.py new file mode 100644 index 0000000000000000000000000000000000000000..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f --- /dev/null +++ b/build/torch25-cxx98-cu121-x86_64-linux/activation/layers.py @@ -0,0 +1,65 @@ +import torch +import torch.nn as nn + +from ._ops import ops + + +class SiluAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.silu_and_mul(out, x) + return out + + +class GeluAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.gelu_and_mul(out, x) + return out + + +class GeluTanhAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.gelu_tanh_and_mul(out, x) + return out + + +class FatreluAndMul(nn.Module): + def __init__(self, threshold: float = 0.0): + super().__init__() + self.threshold = threshold + + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.fatrelu_and_mul(out, x, self.threshold) + return out + + +class FastGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_fast(out, x) + return out + + +class NewGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_new(out, x) + return out + + +class QuickGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_quick(out, x) + return out diff --git a/build/torch25-cxx98-cu124-x86_64-linux/activation/__init__.py b/build/torch25-cxx98-cu124-x86_64-linux/activation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ddb37490dad9d8ffcbeb13ed06b33f03fef8ed78 --- /dev/null +++ b/build/torch25-cxx98-cu124-x86_64-linux/activation/__init__.py @@ -0,0 +1,52 @@ +import torch + +from ._ops import ops + +from . import layers + + +def silu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.silu_and_mul(out, x) + return out + + +def gelu_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_and_mul(out, x) + return out + + +def gelu_tanh_and_mul(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_tanh_and_mul(out, x) + return out + + +def fatrelu_and_mul(out: torch.Tensor, x: torch.Tensor, threshold: float = 0.0) -> None: + ops.fatrelu_and_mul(out, x, threshold) + return out + + +def gelu_fast(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_fast(out, x) + return out + + +def gelu_new(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_new(out, x) + return out + + +def gelu_quick(out: torch.Tensor, x: torch.Tensor) -> None: + ops.gelu_quick(out, x) + return out + + +__all__ = [ + "silu_and_mul", + "gelu_and_mul", + "gelu_tanh_and_mul", + "fatrelu_and_mul", + "gelu_fast", + "gelu_new", + "gelu_quick", + "layers", +] diff --git a/build/torch25-cxx98-cu124-x86_64-linux/activation/_activation_jg7yaigtn7wco.abi3.so b/build/torch25-cxx98-cu124-x86_64-linux/activation/_activation_jg7yaigtn7wco.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..dc1fd3cc2e28051b8a263a5baf287b794d741f41 --- /dev/null +++ b/build/torch25-cxx98-cu124-x86_64-linux/activation/_activation_jg7yaigtn7wco.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f8048853e8cb06e8574a9a9497800d2be438f7989d79f44dcf2e0ced38a75a9 +size 2420192 diff --git a/build/torch25-cxx98-cu124-x86_64-linux/activation/_ops.py b/build/torch25-cxx98-cu124-x86_64-linux/activation/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..0c022ad4f749236320938c6ae13079a445e860ba --- /dev/null +++ b/build/torch25-cxx98-cu124-x86_64-linux/activation/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _activation_jg7yaigtn7wco +ops = torch.ops._activation_jg7yaigtn7wco + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_activation_jg7yaigtn7wco::{op_name}" \ No newline at end of file diff --git a/build/torch25-cxx98-cu124-x86_64-linux/activation/layers.py b/build/torch25-cxx98-cu124-x86_64-linux/activation/layers.py new file mode 100644 index 0000000000000000000000000000000000000000..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f --- /dev/null +++ b/build/torch25-cxx98-cu124-x86_64-linux/activation/layers.py @@ -0,0 +1,65 @@ +import torch +import torch.nn as nn + +from ._ops import ops + + +class SiluAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.silu_and_mul(out, x) + return out + + +class GeluAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.gelu_and_mul(out, x) + return out + + +class GeluTanhAndMul(nn.Module): + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.gelu_tanh_and_mul(out, x) + return out + + +class FatreluAndMul(nn.Module): + def __init__(self, threshold: float = 0.0): + super().__init__() + self.threshold = threshold + + def forward(self, x: torch.Tensor): + d = x.shape[-1] // 2 + output_shape = x.shape[:-1] + (d,) + out = torch.empty(output_shape, dtype=x.dtype, device=x.device) + ops.fatrelu_and_mul(out, x, self.threshold) + return out + + +class FastGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_fast(out, x) + return out + + +class NewGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_new(out, x) + return out + + +class QuickGELU(nn.Module): + def forward(self, x: torch.Tensor) -> torch.Tensor: + out = torch.empty_like(x) + ops.gelu_quick(out, x) + return out diff --git a/build/torch26-cxx11-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch26-cxx11-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 0603eccc9144bee8f9704c4236947e42c905096d..0000000000000000000000000000000000000000 --- a/build/torch26-cxx11-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b925dc27b6a9afd5b6d11e454275222c531a92f7ca27958ac81a78c580665e4d -size 2448088 diff --git a/build/torch26-cxx11-cu118-x86_64-linux/activation/_activation_ncisyrun7guwk.abi3.so b/build/torch26-cxx11-cu118-x86_64-linux/activation/_activation_ncisyrun7guwk.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..951cd024fc65dcaf31f0ce123d7c56538db90255 --- /dev/null +++ b/build/torch26-cxx11-cu118-x86_64-linux/activation/_activation_ncisyrun7guwk.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cde5439e78ba0e1aaa1937d798b214b46d38cbab8e4384b93a22239fed1a4dd4 +size 2370264 diff --git a/build/torch26-cxx11-cu118-x86_64-linux/activation/_ops.py b/build/torch26-cxx11-cu118-x86_64-linux/activation/_ops.py index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..f4538ecbd1302013d2026d413f07fefa1e3ed1ba 100644 --- a/build/torch26-cxx11-cu118-x86_64-linux/activation/_ops.py +++ b/build/torch26-cxx11-cu118-x86_64-linux/activation/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty +from . import _activation_ncisyrun7guwk +ops = torch.ops._activation_ncisyrun7guwk def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file + return f"_activation_ncisyrun7guwk::{op_name}" \ No newline at end of file diff --git a/build/torch26-cxx11-cu118-x86_64-linux/activation/layers.py b/build/torch26-cxx11-cu118-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch26-cxx11-cu118-x86_64-linux/activation/layers.py +++ b/build/torch26-cxx11-cu118-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch26-cxx11-cu124-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch26-cxx11-cu124-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 494cce9f6166100fdb10f021911228b1cbfa2bdd..0000000000000000000000000000000000000000 --- a/build/torch26-cxx11-cu124-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cfdbe510752b57a8dc4671f744bb0a2da5b1646e0b9a19fec02f1505ba044c8c -size 2509960 diff --git a/build/torch26-cxx11-cu124-x86_64-linux/activation/_activation_ochhfvlnc3vyc.abi3.so b/build/torch26-cxx11-cu124-x86_64-linux/activation/_activation_ochhfvlnc3vyc.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..7cc13c8b18b95f7a24b708e41f20daa15cf8e5ba --- /dev/null +++ b/build/torch26-cxx11-cu124-x86_64-linux/activation/_activation_ochhfvlnc3vyc.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6bd20d411c51fc8729b15cab6a60c5c9185222474aa035489e1bff299d76682 +size 2428040 diff --git a/build/torch26-cxx11-cu124-x86_64-linux/activation/_ops.py b/build/torch26-cxx11-cu124-x86_64-linux/activation/_ops.py index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..fc135b9b87ed568acd3b7ae002760780202297ab 100644 --- a/build/torch26-cxx11-cu124-x86_64-linux/activation/_ops.py +++ b/build/torch26-cxx11-cu124-x86_64-linux/activation/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty +from . import _activation_ochhfvlnc3vyc +ops = torch.ops._activation_ochhfvlnc3vyc def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file + return f"_activation_ochhfvlnc3vyc::{op_name}" \ No newline at end of file diff --git a/build/torch26-cxx11-cu124-x86_64-linux/activation/layers.py b/build/torch26-cxx11-cu124-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch26-cxx11-cu124-x86_64-linux/activation/layers.py +++ b/build/torch26-cxx11-cu124-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch26-cxx11-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch26-cxx11-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index d18a35d3e459fa1ecfc1ca166e55cb6ac118a6bb..0000000000000000000000000000000000000000 --- a/build/torch26-cxx11-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70e544ad6448a5576d26147f48403f3e9e593f4a2e24167dc8acb81ce3b7932e -size 2518600 diff --git a/build/torch26-cxx11-cu126-x86_64-linux/activation/_activation_u6vnqubnicksq.abi3.so b/build/torch26-cxx11-cu126-x86_64-linux/activation/_activation_u6vnqubnicksq.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..ed72afe1b709df6b64ae4daf96dfacf5397334e1 --- /dev/null +++ b/build/torch26-cxx11-cu126-x86_64-linux/activation/_activation_u6vnqubnicksq.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41c18b20c2bf8c49d2d3088a9bc1aad4293df0b57eafc9b141a9e8e595fe551a +size 2436672 diff --git a/build/torch26-cxx11-cu126-x86_64-linux/activation/_ops.py b/build/torch26-cxx11-cu126-x86_64-linux/activation/_ops.py index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..03feb54a67ee96a3181145a654e9c1d3432d3c83 100644 --- a/build/torch26-cxx11-cu126-x86_64-linux/activation/_ops.py +++ b/build/torch26-cxx11-cu126-x86_64-linux/activation/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty +from . import _activation_u6vnqubnicksq +ops = torch.ops._activation_u6vnqubnicksq def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file + return f"_activation_u6vnqubnicksq::{op_name}" \ No newline at end of file diff --git a/build/torch26-cxx11-cu126-x86_64-linux/activation/layers.py b/build/torch26-cxx11-cu126-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch26-cxx11-cu126-x86_64-linux/activation/layers.py +++ b/build/torch26-cxx11-cu126-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch26-cxx98-cu118-x86_64-linux/activation/_activation_2vn6ty3gfqfb6.abi3.so b/build/torch26-cxx98-cu118-x86_64-linux/activation/_activation_2vn6ty3gfqfb6.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..d9c4fba021babdd0966b329da77216730a212c19 --- /dev/null +++ b/build/torch26-cxx98-cu118-x86_64-linux/activation/_activation_2vn6ty3gfqfb6.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfbcd5da358cd5cb7982d19c8880cf4db6f08b46622a7a953f755ad59e4e1492 +size 2362752 diff --git a/build/torch26-cxx98-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch26-cxx98-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 13989de7ff0a055c8e40e1e1f4d0a9ed9197c1fa..0000000000000000000000000000000000000000 --- a/build/torch26-cxx98-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:60fd224c33657558f03be5be57cc8d35ade23225b1abd71557b170c8a7010cd1 -size 2440576 diff --git a/build/torch26-cxx98-cu118-x86_64-linux/activation/_ops.py b/build/torch26-cxx98-cu118-x86_64-linux/activation/_ops.py index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..8ec67ec6be213233dc83cb83dcd9e3d8cade5a98 100644 --- a/build/torch26-cxx98-cu118-x86_64-linux/activation/_ops.py +++ b/build/torch26-cxx98-cu118-x86_64-linux/activation/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty +from . import _activation_2vn6ty3gfqfb6 +ops = torch.ops._activation_2vn6ty3gfqfb6 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file + return f"_activation_2vn6ty3gfqfb6::{op_name}" \ No newline at end of file diff --git a/build/torch26-cxx98-cu118-x86_64-linux/activation/layers.py b/build/torch26-cxx98-cu118-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch26-cxx98-cu118-x86_64-linux/activation/layers.py +++ b/build/torch26-cxx98-cu118-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch26-cxx98-cu124-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch26-cxx98-cu124-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 76e8710b2a6d75f17d1c40c2ba116c096791c815..0000000000000000000000000000000000000000 --- a/build/torch26-cxx98-cu124-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e364773259dc1b91f3c0d3b076da83c5a9c6ee18ffdace30315c602dffd1dabe -size 2502264 diff --git a/build/torch26-cxx98-cu124-x86_64-linux/activation/_activation_myvteedxdpqc6.abi3.so b/build/torch26-cxx98-cu124-x86_64-linux/activation/_activation_myvteedxdpqc6.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..486879e6269e0c7d0763ac11d82a100dec1b1b91 --- /dev/null +++ b/build/torch26-cxx98-cu124-x86_64-linux/activation/_activation_myvteedxdpqc6.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1bc928823117c800904bcd3492bf1a0c65a32f6d8a842dc039f55e29831ab49 +size 2420344 diff --git a/build/torch26-cxx98-cu124-x86_64-linux/activation/_ops.py b/build/torch26-cxx98-cu124-x86_64-linux/activation/_ops.py index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..0f4e8d31b42ed7be77b8eaef9aa29251327009bf 100644 --- a/build/torch26-cxx98-cu124-x86_64-linux/activation/_ops.py +++ b/build/torch26-cxx98-cu124-x86_64-linux/activation/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty +from . import _activation_myvteedxdpqc6 +ops = torch.ops._activation_myvteedxdpqc6 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file + return f"_activation_myvteedxdpqc6::{op_name}" \ No newline at end of file diff --git a/build/torch26-cxx98-cu124-x86_64-linux/activation/layers.py b/build/torch26-cxx98-cu124-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch26-cxx98-cu124-x86_64-linux/activation/layers.py +++ b/build/torch26-cxx98-cu124-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch26-cxx98-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch26-cxx98-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 92433b08d2ef878a9d6fc7dfd5281051412ea0b3..0000000000000000000000000000000000000000 --- a/build/torch26-cxx98-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ac88cc0d3c65ab283d20608f3a097be29ee572e7856f10f8d7919536efd95b4 -size 2506808 diff --git a/build/torch26-cxx98-cu126-x86_64-linux/activation/_activation_rbswus6emrhm2.abi3.so b/build/torch26-cxx98-cu126-x86_64-linux/activation/_activation_rbswus6emrhm2.abi3.so new file mode 100755 index 0000000000000000000000000000000000000000..42ad3291140b013999afb683ec84c23804759e46 --- /dev/null +++ b/build/torch26-cxx98-cu126-x86_64-linux/activation/_activation_rbswus6emrhm2.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:474727e434a9cd4ec984a6da7124992ead4ca0fefce9581d0fd503e36c065aed +size 2424888 diff --git a/build/torch26-cxx98-cu126-x86_64-linux/activation/_ops.py b/build/torch26-cxx98-cu126-x86_64-linux/activation/_ops.py index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..c6d4e4c91a867d657f287510c40366bccef86c94 100644 --- a/build/torch26-cxx98-cu126-x86_64-linux/activation/_ops.py +++ b/build/torch26-cxx98-cu126-x86_64-linux/activation/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty +from . import _activation_rbswus6emrhm2 +ops = torch.ops._activation_rbswus6emrhm2 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file + return f"_activation_rbswus6emrhm2::{op_name}" \ No newline at end of file diff --git a/build/torch26-cxx98-cu126-x86_64-linux/activation/layers.py b/build/torch26-cxx98-cu126-x86_64-linux/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/build/torch26-cxx98-cu126-x86_64-linux/activation/layers.py +++ b/build/torch26-cxx98-cu126-x86_64-linux/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x) diff --git a/build/torch27-cxx11-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch27-cxx11-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 16e9df58edb8b6fe6885a0ed783306390db853b1..0000000000000000000000000000000000000000 --- a/build/torch27-cxx11-cu118-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4f9e647eea40d3d3801d5ee57d4917e4c2e8dbfd87cdfebdc40b1b0a1c571fe -size 2448184 diff --git a/build/torch27-cxx11-cu118-x86_64-linux/activation/_ops.py b/build/torch27-cxx11-cu118-x86_64-linux/activation/_ops.py deleted file mode 100644 index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..0000000000000000000000000000000000000000 --- a/build/torch27-cxx11-cu118-x86_64-linux/activation/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file diff --git a/build/torch27-cxx11-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch27-cxx11-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index 085ef09ae9488945275424ee7a507f0289143ed8..0000000000000000000000000000000000000000 --- a/build/torch27-cxx11-cu126-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a2b72ff2a0f2253e4dfe028842b5f15cabf2647d7812bf4662a2de510ca0c489 -size 2518632 diff --git a/build/torch27-cxx11-cu126-x86_64-linux/activation/_ops.py b/build/torch27-cxx11-cu126-x86_64-linux/activation/_ops.py deleted file mode 100644 index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..0000000000000000000000000000000000000000 --- a/build/torch27-cxx11-cu126-x86_64-linux/activation/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file diff --git a/build/torch27-cxx11-cu128-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so b/build/torch27-cxx11-cu128-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so deleted file mode 100755 index ea1a9f1b610a4e3ca23afc5e13c26c3e0ef7758b..0000000000000000000000000000000000000000 --- a/build/torch27-cxx11-cu128-x86_64-linux/activation/_activation_e99cc09_dirty.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f4590c852899e4c11ddb74cfad61e26b07490a91f3c09e0fb0874a3fcc1f533e -size 3331456 diff --git a/build/torch27-cxx11-cu128-x86_64-linux/activation/_ops.py b/build/torch27-cxx11-cu128-x86_64-linux/activation/_ops.py deleted file mode 100644 index 6cfb9cfa80b63852c1a9a8641b25616ce4caffd8..0000000000000000000000000000000000000000 --- a/build/torch27-cxx11-cu128-x86_64-linux/activation/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _activation_e99cc09_dirty -ops = torch.ops._activation_e99cc09_dirty - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_activation_e99cc09_dirty::{op_name}" \ No newline at end of file diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 4fa3e9a2e465daa852b90bc10e0c14b442b53b12..0000000000000000000000000000000000000000 --- a/flake.lock +++ /dev/null @@ -1,168 +0,0 @@ -{ - "nodes": { - "flake-compat": { - "locked": { - "lastModified": 1747046372, - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "hf-nix": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1747919133, - "narHash": "sha256-VvF1naQOvv7yulQ5/cDiaxkNxlh1Y84QMZnderv1szk=", - "owner": "huggingface", - "repo": "hf-nix", - "rev": "9c71e026d6c7c8588ef85a5f7c77f57d598e038c", - "type": "github" - }, - "original": { - "owner": "huggingface", - "repo": "hf-nix", - "type": "github" - } - }, - "kernel-builder": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "hf-nix": "hf-nix", - "nixpkgs": [ - "kernel-builder", - "hf-nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1748620233, - "narHash": "sha256-VULm9HgGXvo3pyfsPy3SOhoqgkuqbGSaSemvzNUbdIU=", - "owner": "huggingface", - "repo": "kernel-builder", - "rev": "da3340e5b3cbb6086600420f4814b033395788d1", - "type": "github" - }, - "original": { - "owner": "huggingface", - "repo": "kernel-builder", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1747820358, - "narHash": "sha256-fTqsZsUX6M3yeEvgyQvXcbGmT2CaRVyVwsi8eK29Oj4=", - "owner": "danieldk", - "repo": "nixpkgs", - "rev": "d3c1681180717528068082103bf323147de6ab0b", - "type": "github" - }, - "original": { - "owner": "danieldk", - "ref": "cudatoolkit-12.9-kernel-builder", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "kernel-builder": "kernel-builder" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/torch-ext/activation/layers.py b/torch-ext/activation/layers.py index dea45935f51421e8ee87b05430c2e95840cb4ef8..99c129e3b1c9ed4c18166d5b5d67eb08f137a27f 100644 --- a/torch-ext/activation/layers.py +++ b/torch-ext/activation/layers.py @@ -5,8 +5,6 @@ from ._ops import ops class SiluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -16,8 +14,6 @@ class SiluAndMul(nn.Module): class GeluAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -27,8 +23,6 @@ class GeluAndMul(nn.Module): class GeluTanhAndMul(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor): d = x.shape[-1] // 2 output_shape = x.shape[:-1] + (d,) @@ -38,8 +32,6 @@ class GeluTanhAndMul(nn.Module): class FatreluAndMul(nn.Module): - can_torch_compile: bool = True - def __init__(self, threshold: float = 0.0): super().__init__() self.threshold = threshold @@ -53,8 +45,6 @@ class FatreluAndMul(nn.Module): class FastGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_fast(out, x) @@ -62,8 +52,6 @@ class FastGELU(nn.Module): class NewGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_new(out, x) @@ -71,8 +59,6 @@ class NewGELU(nn.Module): class QuickGELU(nn.Module): - can_torch_compile: bool = True - def forward(self, x: torch.Tensor) -> torch.Tensor: out = torch.empty_like(x) ops.gelu_quick(out, x)