Skip to content

Commit

Permalink
Revert "fix fused_rope diff (PaddlePaddle#60217) (PaddlePaddle#60593)"
Browse files Browse the repository at this point in the history
This reverts commit 97b65c7.
  • Loading branch information
hanhaowen-mt committed May 13, 2024
1 parent 0288949 commit f1cf884
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions paddle/phi/kernels/fusion/gpu/fused_rope_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,10 @@ __global__ void VectorizedFusedRopeWithRotateEveryTwoKernel(
MPType p0 = static_cast<MPType>(input[pr_index]);
MPType p1 = static_cast<MPType>(input[ls_index]);

if (sign == 1) {
result[pr_index] = cos_value[pr_index] * p0;
result[pr_index] -= sin_value[pr_index] * p1;

result[ls_index] = sin_value[ls_index] * p0;
result[ls_index] += cos_value[ls_index] * p1;
} else if (sign == -1) {
result[pr_index] =
cos_value[pr_index] * p0 + sin_value[ls_index] * p1;
result[ls_index] =
cos_value[ls_index] * p1 - sin_value[pr_index] * p0;
}
result[pr_index] =
cos_value[pr_index] * p0 - sign * sin_value[ls_index] * p1;
result[ls_index] =
cos_value[ls_index] * p1 + sign * sin_value[pr_index] * p0;

store[pr_index] = static_cast<T>(result[pr_index]);
store[ls_index] = static_cast<T>(result[ls_index]);
Expand Down

0 comments on commit f1cf884

Please sign in to comment.