From 6febe5fe6e03a2f27a3cf18e9099d9e813c68e65 Mon Sep 17 00:00:00 2001 From: Yuang Liu Date: Wed, 14 Jul 2021 10:51:22 +0800 Subject: [PATCH] rename the fuse op, test=allcase (#34120) --- ...e_op.cc => fused_softmax_mask_upper_triangle_op.cc} | 10 +++++----- ...e_op.cu => fused_softmax_mask_upper_triangle_op.cu} | 6 +++--- ...gle_op.h => fused_softmax_mask_upper_triangle_op.h} | 0 .../test_softmax_mask_fuse_upper_triangle_op.py | 4 ++-- .../operators/softmax_mask_fuse_upper_triangle.py | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) rename paddle/fluid/operators/{softmax_mask_fuse_upper_triangle_op.cc => fused_softmax_mask_upper_triangle_op.cc} (92%) rename paddle/fluid/operators/{softmax_mask_fuse_upper_triangle_op.cu => fused_softmax_mask_upper_triangle_op.cu} (99%) rename paddle/fluid/operators/{softmax_mask_fuse_upper_triangle_op.h => fused_softmax_mask_upper_triangle_op.h} (100%) diff --git a/paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.cc b/paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.cc similarity index 92% rename from paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.cc rename to paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.cc index fa5f996f5c1..c737ba361e0 100644 --- a/paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.cc +++ b/paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.cc @@ -10,7 +10,7 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.h" +#include "paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.h" #include "paddle/fluid/framework/generator.h" #include "paddle/fluid/framework/op_registry.h" namespace paddle { @@ -82,7 +82,7 @@ class SoftmaxMaskFuseUpperTriangleGradOpMaker protected: void Apply(GradOpPtr op) const override { - op->SetType("softmax_mask_fuse_upper_triangle_grad"); + op->SetType("fused_softmax_mask_upper_triangle_grad"); op->SetInput("Softmax", this->Output("Out")); op->SetInput(framework::GradVarName("Out"), this->OutputGrad("Out")); op->SetOutput(framework::GradVarName("X"), this->InputGrad("X")); @@ -94,13 +94,13 @@ class SoftmaxMaskFuseUpperTriangleGradOpMaker namespace ops = paddle::operators; REGISTER_OPERATOR( - softmax_mask_fuse_upper_triangle, ops::SoftmaxMaskFuseUpperTriangleOp, + fused_softmax_mask_upper_triangle, ops::SoftmaxMaskFuseUpperTriangleOp, ops::SoftmaxMaskFuseUpperTriangleOpMaker, ops::SoftmaxMaskFuseUpperTriangleGradOpMaker, ops::SoftmaxMaskFuseUpperTriangleGradOpMaker); -REGISTER_OPERATOR(softmax_mask_fuse_upper_triangle_grad, +REGISTER_OPERATOR(fused_softmax_mask_upper_triangle_grad, ops::SoftmaxMaskFuseUpperTriangleOpGrad); -REGISTER_OP_CPU_KERNEL(softmax_mask_fuse_upper_triangle, +REGISTER_OP_CPU_KERNEL(fused_softmax_mask_upper_triangle, ops::SoftmaxMaskFuseUpperTriangleCPUKernel< paddle::platform::CPUDeviceContext, float>, ops::SoftmaxMaskFuseUpperTriangleCPUKernel< diff --git a/paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.cu b/paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.cu similarity index 99% rename from paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.cu rename to paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.cu index 9a1b4332e8b..3bebbee1fb7 100644 --- a/paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.cu +++ b/paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.cu @@ -31,7 +31,7 @@ limitations under the License. */ #include "paddle/fluid/framework/generator.h" #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/memory/memcpy.h" -#include "paddle/fluid/operators/softmax_mask_fuse_upper_triangle_op.h" +#include "paddle/fluid/operators/fused_softmax_mask_upper_triangle_op.h" #include "paddle/fluid/platform/float16.h" namespace paddle { @@ -534,12 +534,12 @@ class SoftmaxMaskFuseUpperTriangleGradKernel : public framework::OpKernel { namespace ops = paddle::operators; namespace plat = paddle::platform; REGISTER_OP_CUDA_KERNEL( - softmax_mask_fuse_upper_triangle, + fused_softmax_mask_upper_triangle, ops::SoftmaxMaskFuseUpperTriangleKernel, ops::SoftmaxMaskFuseUpperTriangleKernel); REGISTER_OP_CUDA_KERNEL( - softmax_mask_fuse_upper_triangle_grad, + fused_softmax_mask_upper_triangle_grad, ops::SoftmaxMaskFuseUpperTriangleGradKernel, ops::SoftmaxMaskFuseUpperTriangleGradKernel