Kernels:
Trusted publisher
Uploaded using `kernel-builder`.
Browse files- .gitattributes +9 -0
- build/torch210-cxx11-cu126-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so} +1 -1
- build/torch210-cxx11-cu126-aarch64-linux/_ops.py +3 -3
- build/torch210-cxx11-cu126-aarch64-linux/metadata.json +1 -1
- build/torch210-cxx11-cu128-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so} +1 -1
- build/torch210-cxx11-cu128-aarch64-linux/_ops.py +3 -3
- build/torch210-cxx11-cu128-aarch64-linux/metadata.json +1 -1
- build/torch210-cxx11-cu130-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so} +1 -1
- build/torch210-cxx11-cu130-aarch64-linux/_ops.py +3 -3
- build/torch210-cxx11-cu130-aarch64-linux/metadata.json +1 -1
- build/torch211-cxx11-cu126-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so} +1 -1
- build/torch211-cxx11-cu126-aarch64-linux/_ops.py +3 -3
- build/torch211-cxx11-cu126-aarch64-linux/metadata.json +1 -1
- build/torch211-cxx11-cu128-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so} +1 -1
- build/torch211-cxx11-cu128-aarch64-linux/_ops.py +3 -3
- build/torch211-cxx11-cu128-aarch64-linux/metadata.json +1 -1
- build/torch211-cxx11-cu130-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so} +1 -1
- build/torch211-cxx11-cu130-aarch64-linux/_ops.py +3 -3
- build/torch211-cxx11-cu130-aarch64-linux/metadata.json +1 -1
- build/torch212-cxx11-cu126-aarch64-linux/__init__.py +26 -0
- build/torch212-cxx11-cu126-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so +3 -0
- build/torch212-cxx11-cu126-aarch64-linux/_ops.py +9 -0
- build/torch212-cxx11-cu126-aarch64-linux/layer_norm/__init__.py +26 -0
- build/torch212-cxx11-cu126-aarch64-linux/layers.py +51 -0
- build/torch212-cxx11-cu126-aarch64-linux/metadata.json +15 -0
- build/torch212-cxx11-cu130-aarch64-linux/__init__.py +26 -0
- build/torch212-cxx11-cu130-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so +3 -0
- build/torch212-cxx11-cu130-aarch64-linux/_ops.py +9 -0
- build/torch212-cxx11-cu130-aarch64-linux/layer_norm/__init__.py +26 -0
- build/torch212-cxx11-cu130-aarch64-linux/layers.py +51 -0
- build/torch212-cxx11-cu130-aarch64-linux/metadata.json +17 -0
- build/torch212-cxx11-cu132-aarch64-linux/__init__.py +26 -0
- build/torch212-cxx11-cu132-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so +3 -0
- build/torch212-cxx11-cu132-aarch64-linux/_ops.py +9 -0
- build/torch212-cxx11-cu132-aarch64-linux/layer_norm/__init__.py +26 -0
- build/torch212-cxx11-cu132-aarch64-linux/layers.py +51 -0
- build/torch212-cxx11-cu132-aarch64-linux/metadata.json +17 -0
.gitattributes
CHANGED
|
@@ -87,3 +87,12 @@ build/torch210-cxx11-cu130-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter
|
|
| 87 |
build/torch211-cxx11-cu126-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 88 |
build/torch211-cxx11-cu128-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 89 |
build/torch211-cxx11-cu130-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
build/torch211-cxx11-cu126-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 88 |
build/torch211-cxx11-cu128-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 89 |
build/torch211-cxx11-cu130-aarch64-linux/_layer_norm_cuda_86f75d9.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 90 |
+
build/torch210-cxx11-cu126-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 91 |
+
build/torch210-cxx11-cu128-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 92 |
+
build/torch210-cxx11-cu130-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 93 |
+
build/torch211-cxx11-cu126-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 94 |
+
build/torch211-cxx11-cu128-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 95 |
+
build/torch211-cxx11-cu130-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 96 |
+
build/torch212-cxx11-cu126-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 97 |
+
build/torch212-cxx11-cu130-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 98 |
+
build/torch212-cxx11-cu132-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so filter=lfs diff=lfs merge=lfs -text
|
build/torch210-cxx11-cu126-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 711710472
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc6cbb986c0ac1160fd75d6db0033b133350ede8d51c815cd6c821d7e2c512a1
|
| 3 |
size 711710472
|
build/torch210-cxx11-cu126-aarch64-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 _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch210-cxx11-cu126-aarch64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
build/torch210-cxx11-cu128-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1231083200
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b32a3daff6960337d42eb4b5484b2fc628e773616e3361bcce21d656d477096d
|
| 3 |
size 1231083200
|
build/torch210-cxx11-cu128-aarch64-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 _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch210-cxx11-cu128-aarch64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
build/torch210-cxx11-cu130-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1235994200
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1be4d1ef49363641003ad084d112971753c08b1c8ce6755ce073d7e6fce171c
|
| 3 |
size 1235994200
|
build/torch210-cxx11-cu130-aarch64-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 _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch210-cxx11-cu130-aarch64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
build/torch211-cxx11-cu126-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 711706784
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ebbc069d60e09aea141d01bef3f1a14b81d315d2e944f78b99ee794a370f199
|
| 3 |
size 711706784
|
build/torch211-cxx11-cu126-aarch64-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 _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch211-cxx11-cu126-aarch64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
build/torch211-cxx11-cu128-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1231079512
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2ca8ce06883b52cc6fc635f080a8a1e025a2cf87a9ad151df8525d2d1842c87
|
| 3 |
size 1231079512
|
build/torch211-cxx11-cu128-aarch64-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 _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch211-cxx11-cu128-aarch64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
build/torch211-cxx11-cu130-aarch64-linux/{_layer_norm_cuda_86f75d9.abi3.so → _layer_norm_cuda_73ccd0c.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1235990520
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d526240fb5ecde4f704be1bd671e339a0da2f7861af43d1b87535c920d841d81
|
| 3 |
size 1235990520
|
build/torch211-cxx11-cu130-aarch64-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 _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch211-cxx11-cu130-aarch64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
"version": 1,
|
| 5 |
"license": "BSD-3-Clause",
|
| 6 |
"python-depends": [],
|
build/torch212-cxx11-cu126-aarch64-linux/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from ._ops import ops
|
| 5 |
+
|
| 6 |
+
from . import layers
|
| 7 |
+
|
| 8 |
+
def dropout_add_ln_fwd(input, gamma, beta, rowscale, colscale, x0_subset, z_subset, dropout_p, epsilon, rowscale_const, z_numrows, gen, residual_in_fp32, is_rms_norm):
|
| 9 |
+
return ops.dropout_add_ln_fwd(input, gamma, beta, rowscale, colscale, x0_subset, z_subset, dropout_p, epsilon, rowscale_const, z_numrows, gen, residual_in_fp32, is_rms_norm)
|
| 10 |
+
|
| 11 |
+
def dropout_add_ln_bwd(dz, dx, x, mu, rsigma, gamma, rowscale, colscale, x0_subset, z_subset, dropout_p, rowscale_const, x0_numrows, has_residual, is_rms_norm):
|
| 12 |
+
return ops.dropout_add_ln_bwd(dz, dx, x, mu, rsigma, gamma, rowscale, colscale, x0_subset, z_subset, dropout_p, rowscale_const, x0_numrows, has_residual, is_rms_norm)
|
| 13 |
+
|
| 14 |
+
def dropout_add_ln_parallel_residual_fwd(input, gamma0, beta0, gamma1, beta1, dropout_p, epsilon, gen, residual_in_fp32, is_rms_norm):
|
| 15 |
+
return ops.dropout_add_ln_parallel_residual_fwd(input, gamma0, beta0, gamma1, beta1, dropout_p, epsilon, gen, residual_in_fp32, is_rms_norm)
|
| 16 |
+
|
| 17 |
+
def dropout_add_ln_parallel_residual_bwd(dz0, dz1, dx, x, mu, rsigma, gamma0, gamma1, dropout_p, has_x1, has_residual, is_rms_norm):
|
| 18 |
+
return ops.dropout_add_ln_parallel_residual_bwd(dz0, dz1, dx, x, mu, rsigma, gamma0, gamma1, dropout_p, has_x1, has_residual, is_rms_norm)
|
| 19 |
+
|
| 20 |
+
__all__ = [
|
| 21 |
+
"layers",
|
| 22 |
+
"dropout_add_ln_fwd",
|
| 23 |
+
"dropout_add_ln_bwd",
|
| 24 |
+
"dropout_add_ln_parallel_residual_fwd",
|
| 25 |
+
"dropout_add_ln_parallel_residual_bwd",
|
| 26 |
+
]
|
build/torch212-cxx11-cu126-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4053b1e60f9aa2d0c36871fb49638a2644dee850719716382159abf3749e997e
|
| 3 |
+
size 711709952
|
build/torch212-cxx11-cu126-aarch64-linux/_ops.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
"""
|
| 7 |
+
Prefix op by namespace.
|
| 8 |
+
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch212-cxx11-cu126-aarch64-linux/layer_norm/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ctypes
|
| 2 |
+
import importlib.util
|
| 3 |
+
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from types import ModuleType
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
+
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
+
# it would also be used for other imports. So, we make a module name that
|
| 11 |
+
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
+
# the path.
|
| 13 |
+
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
+
module_name = path_hash
|
| 15 |
+
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
+
if spec is None:
|
| 17 |
+
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
+
module = importlib.util.module_from_spec(spec)
|
| 19 |
+
if module is None:
|
| 20 |
+
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
+
sys.modules[module_name] = module
|
| 22 |
+
spec.loader.exec_module(module) # type: ignore
|
| 23 |
+
return module
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
build/torch212-cxx11-cu126-aarch64-linux/layers.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from ._ops import ops
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class LayerNorm(nn.Module):
|
| 8 |
+
weight: torch.Tensor
|
| 9 |
+
variance_epsilon: float
|
| 10 |
+
|
| 11 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 12 |
+
output = ops.dropout_add_ln_fwd(
|
| 13 |
+
hidden_states.view(-1, hidden_states.shape[-1]),
|
| 14 |
+
gamma = self.weight,
|
| 15 |
+
beta = None,
|
| 16 |
+
rowscale = None,
|
| 17 |
+
colscale = None,
|
| 18 |
+
x0_subset = None,
|
| 19 |
+
z_subset = None,
|
| 20 |
+
dropout_p = 0,
|
| 21 |
+
epsilon = self.variance_epsilon,
|
| 22 |
+
rowscale_const = 1.0,
|
| 23 |
+
z_numrows = hidden_states.shape[1],
|
| 24 |
+
gen = None,
|
| 25 |
+
residual_in_fp32 = False,
|
| 26 |
+
is_rms_norm = False,
|
| 27 |
+
)
|
| 28 |
+
return output[0].view(hidden_states.shape)
|
| 29 |
+
|
| 30 |
+
class LlamaRMSNorm(nn.Module):
|
| 31 |
+
weight: torch.Tensor
|
| 32 |
+
variance_epsilon: float
|
| 33 |
+
|
| 34 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 35 |
+
output = ops.dropout_add_ln_fwd(
|
| 36 |
+
hidden_states.view(-1, hidden_states.shape[-1]),
|
| 37 |
+
gamma = self.weight,
|
| 38 |
+
beta = None,
|
| 39 |
+
rowscale = None,
|
| 40 |
+
colscale = None,
|
| 41 |
+
x0_subset = None,
|
| 42 |
+
z_subset = None,
|
| 43 |
+
dropout_p = 0,
|
| 44 |
+
epsilon = self.variance_epsilon,
|
| 45 |
+
rowscale_const = 1.0,
|
| 46 |
+
z_numrows = hidden_states.shape[1],
|
| 47 |
+
gen = None,
|
| 48 |
+
residual_in_fp32 = False,
|
| 49 |
+
is_rms_norm = True,
|
| 50 |
+
)
|
| 51 |
+
return output[0].view(hidden_states.shape)
|
build/torch212-cxx11-cu126-aarch64-linux/metadata.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "BSD-3-Clause",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"8.0",
|
| 11 |
+
"8.9",
|
| 12 |
+
"9.0"
|
| 13 |
+
]
|
| 14 |
+
}
|
| 15 |
+
}
|
build/torch212-cxx11-cu130-aarch64-linux/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from ._ops import ops
|
| 5 |
+
|
| 6 |
+
from . import layers
|
| 7 |
+
|
| 8 |
+
def dropout_add_ln_fwd(input, gamma, beta, rowscale, colscale, x0_subset, z_subset, dropout_p, epsilon, rowscale_const, z_numrows, gen, residual_in_fp32, is_rms_norm):
|
| 9 |
+
return ops.dropout_add_ln_fwd(input, gamma, beta, rowscale, colscale, x0_subset, z_subset, dropout_p, epsilon, rowscale_const, z_numrows, gen, residual_in_fp32, is_rms_norm)
|
| 10 |
+
|
| 11 |
+
def dropout_add_ln_bwd(dz, dx, x, mu, rsigma, gamma, rowscale, colscale, x0_subset, z_subset, dropout_p, rowscale_const, x0_numrows, has_residual, is_rms_norm):
|
| 12 |
+
return ops.dropout_add_ln_bwd(dz, dx, x, mu, rsigma, gamma, rowscale, colscale, x0_subset, z_subset, dropout_p, rowscale_const, x0_numrows, has_residual, is_rms_norm)
|
| 13 |
+
|
| 14 |
+
def dropout_add_ln_parallel_residual_fwd(input, gamma0, beta0, gamma1, beta1, dropout_p, epsilon, gen, residual_in_fp32, is_rms_norm):
|
| 15 |
+
return ops.dropout_add_ln_parallel_residual_fwd(input, gamma0, beta0, gamma1, beta1, dropout_p, epsilon, gen, residual_in_fp32, is_rms_norm)
|
| 16 |
+
|
| 17 |
+
def dropout_add_ln_parallel_residual_bwd(dz0, dz1, dx, x, mu, rsigma, gamma0, gamma1, dropout_p, has_x1, has_residual, is_rms_norm):
|
| 18 |
+
return ops.dropout_add_ln_parallel_residual_bwd(dz0, dz1, dx, x, mu, rsigma, gamma0, gamma1, dropout_p, has_x1, has_residual, is_rms_norm)
|
| 19 |
+
|
| 20 |
+
__all__ = [
|
| 21 |
+
"layers",
|
| 22 |
+
"dropout_add_ln_fwd",
|
| 23 |
+
"dropout_add_ln_bwd",
|
| 24 |
+
"dropout_add_ln_parallel_residual_fwd",
|
| 25 |
+
"dropout_add_ln_parallel_residual_bwd",
|
| 26 |
+
]
|
build/torch212-cxx11-cu130-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:df4db4bae71fab28e0e88250091baaad4b1359ce1cf5f74afb4eaaaf1b8feb03
|
| 3 |
+
size 1235993656
|
build/torch212-cxx11-cu130-aarch64-linux/_ops.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
"""
|
| 7 |
+
Prefix op by namespace.
|
| 8 |
+
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch212-cxx11-cu130-aarch64-linux/layer_norm/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ctypes
|
| 2 |
+
import importlib.util
|
| 3 |
+
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from types import ModuleType
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
+
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
+
# it would also be used for other imports. So, we make a module name that
|
| 11 |
+
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
+
# the path.
|
| 13 |
+
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
+
module_name = path_hash
|
| 15 |
+
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
+
if spec is None:
|
| 17 |
+
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
+
module = importlib.util.module_from_spec(spec)
|
| 19 |
+
if module is None:
|
| 20 |
+
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
+
sys.modules[module_name] = module
|
| 22 |
+
spec.loader.exec_module(module) # type: ignore
|
| 23 |
+
return module
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
build/torch212-cxx11-cu130-aarch64-linux/layers.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from ._ops import ops
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class LayerNorm(nn.Module):
|
| 8 |
+
weight: torch.Tensor
|
| 9 |
+
variance_epsilon: float
|
| 10 |
+
|
| 11 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 12 |
+
output = ops.dropout_add_ln_fwd(
|
| 13 |
+
hidden_states.view(-1, hidden_states.shape[-1]),
|
| 14 |
+
gamma = self.weight,
|
| 15 |
+
beta = None,
|
| 16 |
+
rowscale = None,
|
| 17 |
+
colscale = None,
|
| 18 |
+
x0_subset = None,
|
| 19 |
+
z_subset = None,
|
| 20 |
+
dropout_p = 0,
|
| 21 |
+
epsilon = self.variance_epsilon,
|
| 22 |
+
rowscale_const = 1.0,
|
| 23 |
+
z_numrows = hidden_states.shape[1],
|
| 24 |
+
gen = None,
|
| 25 |
+
residual_in_fp32 = False,
|
| 26 |
+
is_rms_norm = False,
|
| 27 |
+
)
|
| 28 |
+
return output[0].view(hidden_states.shape)
|
| 29 |
+
|
| 30 |
+
class LlamaRMSNorm(nn.Module):
|
| 31 |
+
weight: torch.Tensor
|
| 32 |
+
variance_epsilon: float
|
| 33 |
+
|
| 34 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 35 |
+
output = ops.dropout_add_ln_fwd(
|
| 36 |
+
hidden_states.view(-1, hidden_states.shape[-1]),
|
| 37 |
+
gamma = self.weight,
|
| 38 |
+
beta = None,
|
| 39 |
+
rowscale = None,
|
| 40 |
+
colscale = None,
|
| 41 |
+
x0_subset = None,
|
| 42 |
+
z_subset = None,
|
| 43 |
+
dropout_p = 0,
|
| 44 |
+
epsilon = self.variance_epsilon,
|
| 45 |
+
rowscale_const = 1.0,
|
| 46 |
+
z_numrows = hidden_states.shape[1],
|
| 47 |
+
gen = None,
|
| 48 |
+
residual_in_fp32 = False,
|
| 49 |
+
is_rms_norm = True,
|
| 50 |
+
)
|
| 51 |
+
return output[0].view(hidden_states.shape)
|
build/torch212-cxx11-cu130-aarch64-linux/metadata.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "BSD-3-Clause",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"10.0",
|
| 11 |
+
"12.0",
|
| 12 |
+
"8.0",
|
| 13 |
+
"8.9",
|
| 14 |
+
"9.0"
|
| 15 |
+
]
|
| 16 |
+
}
|
| 17 |
+
}
|
build/torch212-cxx11-cu132-aarch64-linux/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from ._ops import ops
|
| 5 |
+
|
| 6 |
+
from . import layers
|
| 7 |
+
|
| 8 |
+
def dropout_add_ln_fwd(input, gamma, beta, rowscale, colscale, x0_subset, z_subset, dropout_p, epsilon, rowscale_const, z_numrows, gen, residual_in_fp32, is_rms_norm):
|
| 9 |
+
return ops.dropout_add_ln_fwd(input, gamma, beta, rowscale, colscale, x0_subset, z_subset, dropout_p, epsilon, rowscale_const, z_numrows, gen, residual_in_fp32, is_rms_norm)
|
| 10 |
+
|
| 11 |
+
def dropout_add_ln_bwd(dz, dx, x, mu, rsigma, gamma, rowscale, colscale, x0_subset, z_subset, dropout_p, rowscale_const, x0_numrows, has_residual, is_rms_norm):
|
| 12 |
+
return ops.dropout_add_ln_bwd(dz, dx, x, mu, rsigma, gamma, rowscale, colscale, x0_subset, z_subset, dropout_p, rowscale_const, x0_numrows, has_residual, is_rms_norm)
|
| 13 |
+
|
| 14 |
+
def dropout_add_ln_parallel_residual_fwd(input, gamma0, beta0, gamma1, beta1, dropout_p, epsilon, gen, residual_in_fp32, is_rms_norm):
|
| 15 |
+
return ops.dropout_add_ln_parallel_residual_fwd(input, gamma0, beta0, gamma1, beta1, dropout_p, epsilon, gen, residual_in_fp32, is_rms_norm)
|
| 16 |
+
|
| 17 |
+
def dropout_add_ln_parallel_residual_bwd(dz0, dz1, dx, x, mu, rsigma, gamma0, gamma1, dropout_p, has_x1, has_residual, is_rms_norm):
|
| 18 |
+
return ops.dropout_add_ln_parallel_residual_bwd(dz0, dz1, dx, x, mu, rsigma, gamma0, gamma1, dropout_p, has_x1, has_residual, is_rms_norm)
|
| 19 |
+
|
| 20 |
+
__all__ = [
|
| 21 |
+
"layers",
|
| 22 |
+
"dropout_add_ln_fwd",
|
| 23 |
+
"dropout_add_ln_bwd",
|
| 24 |
+
"dropout_add_ln_parallel_residual_fwd",
|
| 25 |
+
"dropout_add_ln_parallel_residual_bwd",
|
| 26 |
+
]
|
build/torch212-cxx11-cu132-aarch64-linux/_layer_norm_cuda_73ccd0c.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e3e2f8cb06b921f94b179521d5f773a41fc5817c5667d3a405cf111f04feaf2
|
| 3 |
+
size 1219551712
|
build/torch212-cxx11-cu132-aarch64-linux/_ops.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _layer_norm_cuda_73ccd0c
|
| 3 |
+
ops = torch.ops._layer_norm_cuda_73ccd0c
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
"""
|
| 7 |
+
Prefix op by namespace.
|
| 8 |
+
"""
|
| 9 |
+
return f"_layer_norm_cuda_73ccd0c::{op_name}"
|
build/torch212-cxx11-cu132-aarch64-linux/layer_norm/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ctypes
|
| 2 |
+
import importlib.util
|
| 3 |
+
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from types import ModuleType
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
+
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
+
# it would also be used for other imports. So, we make a module name that
|
| 11 |
+
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
+
# the path.
|
| 13 |
+
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
+
module_name = path_hash
|
| 15 |
+
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
+
if spec is None:
|
| 17 |
+
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
+
module = importlib.util.module_from_spec(spec)
|
| 19 |
+
if module is None:
|
| 20 |
+
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
+
sys.modules[module_name] = module
|
| 22 |
+
spec.loader.exec_module(module) # type: ignore
|
| 23 |
+
return module
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
build/torch212-cxx11-cu132-aarch64-linux/layers.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from ._ops import ops
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class LayerNorm(nn.Module):
|
| 8 |
+
weight: torch.Tensor
|
| 9 |
+
variance_epsilon: float
|
| 10 |
+
|
| 11 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 12 |
+
output = ops.dropout_add_ln_fwd(
|
| 13 |
+
hidden_states.view(-1, hidden_states.shape[-1]),
|
| 14 |
+
gamma = self.weight,
|
| 15 |
+
beta = None,
|
| 16 |
+
rowscale = None,
|
| 17 |
+
colscale = None,
|
| 18 |
+
x0_subset = None,
|
| 19 |
+
z_subset = None,
|
| 20 |
+
dropout_p = 0,
|
| 21 |
+
epsilon = self.variance_epsilon,
|
| 22 |
+
rowscale_const = 1.0,
|
| 23 |
+
z_numrows = hidden_states.shape[1],
|
| 24 |
+
gen = None,
|
| 25 |
+
residual_in_fp32 = False,
|
| 26 |
+
is_rms_norm = False,
|
| 27 |
+
)
|
| 28 |
+
return output[0].view(hidden_states.shape)
|
| 29 |
+
|
| 30 |
+
class LlamaRMSNorm(nn.Module):
|
| 31 |
+
weight: torch.Tensor
|
| 32 |
+
variance_epsilon: float
|
| 33 |
+
|
| 34 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 35 |
+
output = ops.dropout_add_ln_fwd(
|
| 36 |
+
hidden_states.view(-1, hidden_states.shape[-1]),
|
| 37 |
+
gamma = self.weight,
|
| 38 |
+
beta = None,
|
| 39 |
+
rowscale = None,
|
| 40 |
+
colscale = None,
|
| 41 |
+
x0_subset = None,
|
| 42 |
+
z_subset = None,
|
| 43 |
+
dropout_p = 0,
|
| 44 |
+
epsilon = self.variance_epsilon,
|
| 45 |
+
rowscale_const = 1.0,
|
| 46 |
+
z_numrows = hidden_states.shape[1],
|
| 47 |
+
gen = None,
|
| 48 |
+
residual_in_fp32 = False,
|
| 49 |
+
is_rms_norm = True,
|
| 50 |
+
)
|
| 51 |
+
return output[0].view(hidden_states.shape)
|
build/torch212-cxx11-cu132-aarch64-linux/metadata.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "layer-norm",
|
| 3 |
+
"id": "_layer_norm_cuda_73ccd0c",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "BSD-3-Clause",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"10.0",
|
| 11 |
+
"12.0",
|
| 12 |
+
"8.0",
|
| 13 |
+
"8.9",
|
| 14 |
+
"9.0"
|
| 15 |
+
]
|
| 16 |
+
}
|
| 17 |
+
}
|