[Perf] RMSNorm uncontiguous support, 1.2~3.1x kernel performance improvement (#49750)
Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
This commit is contained in:
@@ -1481,8 +1481,6 @@ class DeepseekV2Model(nn.Module):
|
||||
hidden_states, residual = combined_states.split(
|
||||
[self.hidden_size, self.hidden_size], dim=-1
|
||||
)
|
||||
# fused_add_rms_norm requires a contiguous residual
|
||||
residual = residual.contiguous()
|
||||
if idx in self.aux_hidden_state_layers:
|
||||
aux_hidden_state = hidden_states + residual
|
||||
if aux_hidden_state.shape[0] != positions.shape[0]:
|
||||
@@ -1507,8 +1505,6 @@ class DeepseekV2Model(nn.Module):
|
||||
hidden_states, residual = combined_states.split(
|
||||
[self.hidden_size, self.hidden_size], dim=-1
|
||||
)
|
||||
# fused_add_rms_norm requires a contiguous residual
|
||||
residual = residual.contiguous()
|
||||
|
||||
if self.end_layer in self.aux_hidden_state_layers:
|
||||
aux_hidden_states.append(hidden_states + residual)
|
||||
|
||||
Reference in New Issue
Block a user