Skip to content

Commit

Permalink
[NPU] Update layernorm node on MTL/ARL (#12738)
Browse files Browse the repository at this point in the history
* Update layernorm node on MTL/ARL

* Fix on style
  • Loading branch information
Oscilloscope98 authored Jan 23, 2025
1 parent d11f257 commit 69f13c7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ def layer_norm(self, hidden_states, layernorm_weight):
)
eps = self.constant(self.rms_norm_eps)
hidden_states = self.eltwise_div(hidden_states, self.sqrt(self.eltwise_add(variance, eps)))
if os.environ.get("IPEX_LLM_NPU_DRIVER_VERSION", None) in ["5716", "5733"]:
if os.environ.get("IPEX_LLM_NPU_DRIVER_VERSION", None) in ["5716", "5733"] or \
os.environ.get("IPEX_LLM_NPU_MTL", "0") == "1" or \
os.environ.get("IPEX_LLM_NPU_ARL", "0") == "1":
# to support special drivers
hidden_states = self.convert_to_fp16(hidden_states)
else:
Expand Down

0 comments on commit 69f13c7

Please sign in to comment.