[XPU] Dispatch nn.LayerNorm to fused SYCL kernel via CustomOp (#57172)
Signed-off-by: Michal Ganczarenko <michal.ganczarenko@intel.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
Harry Mellor
parent
a4c4bb418e
commit
df5668e5c9
@@ -84,7 +84,7 @@ class DeepseekV32Indexer(nn.Module):
|
||||
disable_tp=True,
|
||||
prefix=f"{prefix}.wk_weights_proj",
|
||||
)
|
||||
self.k_norm = LayerNorm(self.head_dim, eps=1e-6)
|
||||
self.k_norm = LayerNorm(self.head_dim, eps=1e-6, dtype=torch.float32)
|
||||
self.softmax_scale = self.head_dim**-0.5
|
||||
|
||||
self.scale_fmt = "ue8m0"
|
||||
|
||||
@@ -276,7 +276,7 @@ class Indexer(nn.Module):
|
||||
disable_tp=True,
|
||||
prefix=f"{prefix}.wk_weights_proj",
|
||||
)
|
||||
self.k_norm = LayerNorm(self.head_dim, eps=1e-6)
|
||||
self.k_norm = LayerNorm(self.head_dim, eps=1e-6, dtype=torch.float32)
|
||||
self.softmax_scale = self.head_dim**-0.5
|
||||
|
||||
# Hadamard-128 rotation of the indexer query is fused with the FP8
|
||||
|
||||
@@ -166,7 +166,7 @@ class Indexer(nn.Module):
|
||||
disable_tp=True,
|
||||
prefix=f"{prefix}.wk_weights_proj",
|
||||
)
|
||||
self.k_norm = LayerNorm(self.head_dim, eps=1e-6)
|
||||
self.k_norm = LayerNorm(self.head_dim, eps=1e-6, dtype=torch.float32)
|
||||
self.softmax_scale = self.head_dim**-0.5
|
||||
|
||||
self.scale_fmt = "ue8m0"
|
||||
|
||||
Reference in New Issue
Block a user