diff --git a/paddle/fluid/operators/hierarchical_sigmoid_op.cc b/paddle/fluid/operators/hierarchical_sigmoid_op.cc index e1de4a9a4d312c693f07a264c708197afba4a5ac..e73d2a2b5ce399cea98092db477439be9f3254ff 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 4ba99b1b8131207b220095d6fdd438a0c697005e..4e21865c23b3171791a993b51d9eee90a41e2bac 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 2d0aadcf5362cad50037446fdb62670603cbccf2..217afd146f8442f98ebe39ed534e373a9975f900 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 7364f85e75155b979468d6d75d469a5a9326b4fa..71fe149e7c0c0fa2f5285207e0a6b930b4b1fdaa 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 178910e3620c9ad38fa88d25b91f7100bd2424c2..307e6115cfd5668cd1470127f860384e62dd9bba 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 8c8b40c8d9fd0e0bf2d2fb2d91c93314ddcd6389..f4b35c910183627feb539a4499cf69a9db753154 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 bc741b32b3afc9e2eb013130db6b418118e1f800..9b7a2fd574ea85ff176c50f2b1096acfd36e7644 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 c6ee49ef34786a60cf1c78127f80bde5d968d1eb..2a611a8d541ca429c42a8fc89d7d0c176f3bf411 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 c36b343017fd50ab4d4a8dfc5eda6962b9ee8391..254264b8c276e7309750ace212ff81c2b63be5b9 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 33a90c637e4e436ec0fedadda3372afa780cbf14..f1b659a5ba12958e9948b14598df12c2b8c4b928 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 4bb0352528e4e4a596333b7e28d6e1bcf076392b..9d450f1d5dbed085d5a84b32752d4f7dce188d3a 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 94ac63183fbfb831ec8841b02f4ab74dfeeeb188..50719408acf111a19e8eef7cca2cd0379c5fda84 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 a8db0b33242bd9c6279e7abc12f1d65dd8d09715..9499e0b9fc0dd6f725eac8e435659e363ef2c550 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 9698fe9c54c05a00c4e0385aa54b2a7408969f87..752fbab31d57a8d1abc17e703b6030d6a94c5781 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 4b57c9d936123cadea979590fc0fa57b86073c8e..c2c98361c75e75086d53cd24b11f65f7c0d3edd8 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 = {