From 3951c40d911554966726ec575ac303ea89899e0b Mon Sep 17 00:00:00 2001 From: zhangyuqin1998 <75946871+zhangyuqin1998@users.noreply.github.com> Date: Tue, 11 Apr 2023 15:12:12 +0800 Subject: [PATCH] delete remote_prefetch (#52748) --- paddle/fluid/operators/hierarchical_sigmoid_op.cc | 1 - paddle/phi/api/yaml/legacy_backward.yaml | 4 ++-- paddle/phi/api/yaml/legacy_ops.yaml | 2 +- paddle/phi/infermeta/multiary.cc | 1 - paddle/phi/infermeta/multiary.h | 1 - paddle/phi/kernels/cpu/hsigmoid_loss_grad.h | 1 - paddle/phi/kernels/cpu/hsigmoid_loss_grad_kernel.cc | 2 -- paddle/phi/kernels/cpu/hsigmoid_loss_kernel.cc | 1 - paddle/phi/kernels/hsigmoid_loss_grad_kernel.h | 1 - paddle/phi/kernels/hsigmoid_loss_kernel.h | 1 - .../phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.cc | 2 -- .../phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.h | 1 - paddle/phi/ops/compat/hierarchical_sigmoid_sig.cc | 6 +++--- python/paddle/fluid/tests/unittests/test_hsigmoid_op.py | 1 - python/paddle/nn/functional/loss.py | 1 - 15 files changed, 6 insertions(+), 20 deletions(-) diff --git a/paddle/fluid/operators/hierarchical_sigmoid_op.cc b/paddle/fluid/operators/hierarchical_sigmoid_op.cc index e1de4a9a4d3..e73d2a2b5ce 100644 --- a/paddle/fluid/operators/hierarchical_sigmoid_op.cc +++ b/paddle/fluid/operators/hierarchical_sigmoid_op.cc @@ -124,7 +124,6 @@ class HierarchicalSigmoidOpMaker : public framework::OpProtoAndCheckerMaker { AddAttr("num_classes", "(int, optional), The number of classes") .SetDefault(2); // for parameter prefetch - AddAttr("remote_prefetch", "").SetDefault(false); AddAttr("trainer_id", "trainer id from 0 ~ worker_num.").SetDefault(0); AddAttr>("height_sections", "Height for each output SelectedRows.") diff --git a/paddle/phi/api/yaml/legacy_backward.yaml b/paddle/phi/api/yaml/legacy_backward.yaml index 4ba99b1b813..4e21865c23b 100755 --- a/paddle/phi/api/yaml/legacy_backward.yaml +++ b/paddle/phi/api/yaml/legacy_backward.yaml @@ -475,8 +475,8 @@ func : heaviside_grad - backward_op : hsigmoid_loss_grad - forward : hsigmoid_loss (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool remote_prefetch, bool is_sparse) -> Tensor(out), Tensor(pre_out), Tensor(w_out) - args : (Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, Tensor pre_out, Tensor out_grad, int num_classes, bool remote_prefetch, bool is_sparse) + forward : hsigmoid_loss (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool is_sparse) -> Tensor(out), Tensor(pre_out), Tensor(w_out) + args : (Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, Tensor pre_out, Tensor out_grad, int num_classes, bool is_sparse) output : Tensor(x_grad), Tensor(w_grad), Tensor(bias_grad) infer_meta : func : GeneralTernaryGradInferMeta diff --git a/paddle/phi/api/yaml/legacy_ops.yaml b/paddle/phi/api/yaml/legacy_ops.yaml index 2d0aadcf536..217afd146f8 100755 --- a/paddle/phi/api/yaml/legacy_ops.yaml +++ b/paddle/phi/api/yaml/legacy_ops.yaml @@ -684,7 +684,7 @@ backward : heaviside_grad - op : hsigmoid_loss - args : (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool remote_prefetch, bool is_sparse) + args : (Tensor x, Tensor label, Tensor w, Tensor bias, Tensor path, Tensor code, int num_classes, bool is_sparse) output : Tensor(out), Tensor(pre_out), Tensor(w_out) infer_meta : func : HSigmoidLossInferMeta diff --git a/paddle/phi/infermeta/multiary.cc b/paddle/phi/infermeta/multiary.cc index 7364f85e751..71fe149e7c0 100644 --- a/paddle/phi/infermeta/multiary.cc +++ b/paddle/phi/infermeta/multiary.cc @@ -1432,7 +1432,6 @@ void HSigmoidLossInferMeta(const MetaTensor& x, const MetaTensor& path, const MetaTensor& code, int num_classes, - bool remote_prefetch, bool is_sparse, MetaTensor* out, MetaTensor* pre_out, diff --git a/paddle/phi/infermeta/multiary.h b/paddle/phi/infermeta/multiary.h index 178910e3620..307e6115cfd 100644 --- a/paddle/phi/infermeta/multiary.h +++ b/paddle/phi/infermeta/multiary.h @@ -312,7 +312,6 @@ void HSigmoidLossInferMeta(const MetaTensor& x, const MetaTensor& path, const MetaTensor& code, int num_classes, - bool remote_prefetch, bool is_sparse, MetaTensor* out, MetaTensor* pre_out, diff --git a/paddle/phi/kernels/cpu/hsigmoid_loss_grad.h b/paddle/phi/kernels/cpu/hsigmoid_loss_grad.h index 8c8b40c8d9f..f4b35c91018 100644 --- a/paddle/phi/kernels/cpu/hsigmoid_loss_grad.h +++ b/paddle/phi/kernels/cpu/hsigmoid_loss_grad.h @@ -35,7 +35,6 @@ void HSigmoidLossGradKernelImpl(const Context& ctx, const DenseTensor& pre_out, const DenseTensor& out_grad, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* x_grad, DenseTensor* w_grad, diff --git a/paddle/phi/kernels/cpu/hsigmoid_loss_grad_kernel.cc b/paddle/phi/kernels/cpu/hsigmoid_loss_grad_kernel.cc index bc741b32b3a..9b7a2fd574e 100644 --- a/paddle/phi/kernels/cpu/hsigmoid_loss_grad_kernel.cc +++ b/paddle/phi/kernels/cpu/hsigmoid_loss_grad_kernel.cc @@ -31,7 +31,6 @@ void HSigmoidLossGradKernel(const Context& ctx, const DenseTensor& pre_out, const DenseTensor& out_grad, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* x_grad, DenseTensor* w_grad, @@ -46,7 +45,6 @@ void HSigmoidLossGradKernel(const Context& ctx, pre_out, out_grad, num_classes, - remote_prefetch, is_sparse, x_grad, w_grad, diff --git a/paddle/phi/kernels/cpu/hsigmoid_loss_kernel.cc b/paddle/phi/kernels/cpu/hsigmoid_loss_kernel.cc index c6ee49ef347..2a611a8d541 100644 --- a/paddle/phi/kernels/cpu/hsigmoid_loss_kernel.cc +++ b/paddle/phi/kernels/cpu/hsigmoid_loss_kernel.cc @@ -34,7 +34,6 @@ void HSigmoidLossKernel(const Context& ctx, const paddle::optional& path, const paddle::optional& code, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* out, DenseTensor* pre_out, diff --git a/paddle/phi/kernels/hsigmoid_loss_grad_kernel.h b/paddle/phi/kernels/hsigmoid_loss_grad_kernel.h index c36b343017f..254264b8c27 100644 --- a/paddle/phi/kernels/hsigmoid_loss_grad_kernel.h +++ b/paddle/phi/kernels/hsigmoid_loss_grad_kernel.h @@ -29,7 +29,6 @@ void HSigmoidLossGradKernel(const Context& ctx, const DenseTensor& pre_out, const DenseTensor& out_grad, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* x_grad, DenseTensor* w_grad, diff --git a/paddle/phi/kernels/hsigmoid_loss_kernel.h b/paddle/phi/kernels/hsigmoid_loss_kernel.h index 33a90c637e4..f1b659a5ba1 100644 --- a/paddle/phi/kernels/hsigmoid_loss_kernel.h +++ b/paddle/phi/kernels/hsigmoid_loss_kernel.h @@ -27,7 +27,6 @@ void HSigmoidLossKernel(const Context& ctx, const paddle::optional& path, const paddle::optional& code, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* out, DenseTensor* pre_out, diff --git a/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.cc b/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.cc index 4bb0352528e..9d450f1d5db 100644 --- a/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.cc +++ b/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.cc @@ -48,7 +48,6 @@ void HSigmoidLossGradKernel(const Context& ctx, const DenseTensor& pre_out, const DenseTensor& out_grad, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* x_grad, SelectedRows* w_grad, @@ -74,7 +73,6 @@ void HSigmoidLossGradKernel(const Context& ctx, pre_out, out_grad, num_classes, - remote_prefetch, is_sparse, x_grad, w_grad_value, diff --git a/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.h b/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.h index 94ac63183fb..50719408acf 100644 --- a/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.h +++ b/paddle/phi/kernels/selected_rows/hsigmoid_loss_grad_kernel.h @@ -31,7 +31,6 @@ void HSigmoidLossGradKernel(const Context& ctx, const DenseTensor& pre_out, const DenseTensor& out_grad, int num_classes, - bool remote_prefetch, bool is_sparse, DenseTensor* x_grad, SelectedRows* w_grad, diff --git a/paddle/phi/ops/compat/hierarchical_sigmoid_sig.cc b/paddle/phi/ops/compat/hierarchical_sigmoid_sig.cc index a8db0b33242..9499e0b9fc0 100644 --- a/paddle/phi/ops/compat/hierarchical_sigmoid_sig.cc +++ b/paddle/phi/ops/compat/hierarchical_sigmoid_sig.cc @@ -20,7 +20,7 @@ KernelSignature HierarchicalSigmoidOpArgumentMapping( const ArgumentMappingContext& ctx) { return KernelSignature("hsigmoid_loss", {"X", "Label", "W", "Bias", "PathTable", "PathCode"}, - {"num_classes", "remote_prefetch", "is_sparse"}, + {"num_classes", "is_sparse"}, {"Out", "PreOut", "W_Out"}); } @@ -36,7 +36,7 @@ KernelSignature HierarchicalSigmoidGradOpArgumentMapping( "Bias", "PreOut", "Out@GRAD"}, - {"num_classes", "remote_prefetch", "is_sparse"}, + {"num_classes", "is_sparse"}, {"X@GRAD", "W@GRAD", "Bias@GRAD"}); } else if (ctx.IsSelectedRowsOutput("W@GRAD")) { return KernelSignature("hsigmoid_loss_grad_sr", @@ -48,7 +48,7 @@ KernelSignature HierarchicalSigmoidGradOpArgumentMapping( "Bias", "PreOut", "Out@GRAD"}, - {"num_classes", "remote_prefetch", "is_sparse"}, + {"num_classes", "is_sparse"}, {"X@GRAD", "W@GRAD", "Bias@GRAD"}); } else { return KernelSignature("unregistered", {}, {}, {}); diff --git a/python/paddle/fluid/tests/unittests/test_hsigmoid_op.py b/python/paddle/fluid/tests/unittests/test_hsigmoid_op.py index 9698fe9c54c..752fbab31d5 100644 --- a/python/paddle/fluid/tests/unittests/test_hsigmoid_op.py +++ b/python/paddle/fluid/tests/unittests/test_hsigmoid_op.py @@ -177,7 +177,6 @@ def python_api( path_code=None, num_classes=-1, is_sparse=False, - remote_prefetch=False, ): return paddle.nn.functional.hsigmoid_loss( input, diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index 4b57c9d9361..c2c98361c75 100644 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -1016,7 +1016,6 @@ def hsigmoid_loss( attrs = { "num_classes": num_classes, "is_sparse": is_sparse, - "remote_prefetch": is_sparse, } inputs = { -- GitLab