Downloads · 30 days
44.6K
10% of all-time downloads
kernels-community/triton-layer-norm
triton-layer-norm is a machine learning model from kernels-community. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for kernels. The card lists the license as bsd-3-clause.
[!CAUTION] Starting from September 13, 2026, we will be removing the "model" type repositories of kernels (e.g., kernels-community/flash-attn3). Make sure you're using a latest version of kernels. If you face any disr…
Downloads · 30 days
44.6K
10% of all-time downloads
All-time downloads
442K
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py118 KB · 93%
From the Hugging Face model README
[!CAUTION] Starting from September 13, 2026, we will be removing the "model" type repositories of kernels (e.g., kernels-community/flash-attn3). Make sure you're using a latest version of kernels. If you face any disruption, please report them here: https://github.com/huggingface/kernels/issues/new.
This kernel implements layers normalization using Triton. This kernel is from the flash-attention project.
layer_norm(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, residual: Optional[torch.Tensor] = None, x1: Optional[torch.Tensor] = None, weight1: Optional[torch.Tensor] = None, bias1: Optional[torch.Tensor] = None, eps: float = 1e-06, dropout_p: float = 0.0, rowscale=None, prenorm: bool = False, residual_in_fp32: bool = False, is_rms_norm: bool = False, return_dropout_mask: bool = False, out: Optional[torch.Tensor] = None, residual_out: Optional[torch.Tensor] = None)
Apply layer normalization to the input tensor with Triton acceleration.
Type: torch.Tensor or tuple of torch.Tensor
LlamaRMSNormNo documentation available.
forward(self, hidden_states: torch.Tensor) -> torch.Tensor
No documentation available.