diff --git a/optimum/habana/transformers/models/llama/modeling_llama.py b/optimum/habana/transformers/models/llama/modeling_llama.py index c24084e5b4..d0e217c38d 100755 --- a/optimum/habana/transformers/models/llama/modeling_llama.py +++ b/optimum/habana/transformers/models/llama/modeling_llama.py @@ -60,9 +60,8 @@ def gaudi_llama_rmsnorm_forward(self, hidden_states): - override RMSNorm with Habana fused RMSNorm """ if hidden_states.device.type == "hpu" and FusedRMSNorm: - orig_dtype = hidden_states.dtype - hidden_states = FusedRMSNorm.apply(hidden_states.float(), self.weight.float(), self.variance_epsilon) - return hidden_states.to(orig_dtype) + hidden_states = FusedRMSNorm.apply(hidden_states, self.weight, self.variance_epsilon) + return hidden_states else: input_dtype = hidden_states.dtype hidden_states = hidden_states.to(torch.float32)