mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-05 19:13:01 +00:00
[Inference/opt]Optimize the mid tensor of RMS Norm (#5350)
* opt rms_norm * fix bugs in rms_layernorm
This commit is contained in:
@@ -29,8 +29,8 @@ except:
|
||||
def get_triton_rmsnorm_forward():
|
||||
if HAS_TRITON_RMSNORM:
|
||||
|
||||
def _triton_rmsnorm_forward(self: LlamaRMSNorm, hidden_states: torch.Tensor):
|
||||
return rms_layernorm(hidden_states, self.weight.data, self.variance_epsilon)
|
||||
def _triton_rmsnorm_forward(self: LlamaRMSNorm, hidden_states: torch.Tensor, norm_output: torch.Tensor):
|
||||
return rms_layernorm(hidden_states, self.weight.data, self.variance_epsilon, norm_output)
|
||||
|
||||
return _triton_rmsnorm_forward
|
||||
else:
|
||||
|
Reference in New Issue
Block a user