From a58c1e6e46b931d15e0eef8f0b459c87d2a6c16f Mon Sep 17 00:00:00 2001 From: Difers <707065510@qq.com> Date: Wed, 7 Feb 2024 11:07:13 +0800 Subject: [PATCH] try to remove out --- paddle/fluid/pir/dialect/operator/ir/ops.yaml | 1 - paddle/phi/api/yaml/op_compat.yaml | 2 -- paddle/phi/infermeta/unary.cc | 5 +---- paddle/phi/infermeta/unary.h | 3 +-- test/ir/pir/translator/test_partial_send_translator.py | 2 -- 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/paddle/fluid/pir/dialect/operator/ir/ops.yaml b/paddle/fluid/pir/dialect/operator/ir/ops.yaml index 14c9fbcbe1897c..e084e6efd55790 100644 --- a/paddle/fluid/pir/dialect/operator/ir/ops.yaml +++ b/paddle/fluid/pir/dialect/operator/ir/ops.yaml @@ -1655,7 +1655,6 @@ param: [x, ring_id, peer, use_calc_stream, num, id] kernel: func: partial_send - optional : out - op: sparse_momentum args: (Tensor param, Tensor grad, Tensor velocity, Tensor index, Tensor learning_rate, Tensor master_param,float mu, Scalar axis=0, bool use_nesterov=false,str regularization_method="", float regularization_coeff=0.0f, bool multi_precision=false, float rescale_grad=1.0f) diff --git a/paddle/phi/api/yaml/op_compat.yaml b/paddle/phi/api/yaml/op_compat.yaml index bc722a743b344c..24d9be6ebdee33 100755 --- a/paddle/phi/api/yaml/op_compat.yaml +++ b/paddle/phi/api/yaml/op_compat.yaml @@ -3642,8 +3642,6 @@ - op: partial_send inputs : x : X - outputs : - out : Out - op: read_from_array inputs: diff --git a/paddle/phi/infermeta/unary.cc b/paddle/phi/infermeta/unary.cc index 7d927c60fff977..6fd85f50e89d8b 100644 --- a/paddle/phi/infermeta/unary.cc +++ b/paddle/phi/infermeta/unary.cc @@ -2890,8 +2890,7 @@ void PartialSendInferMeta(const MetaTensor& x, int peer, bool use_calc_stream, int num, - int id, - MetaTensor* out) { + int id) { PADDLE_ENFORCE_GE( peer, 0, @@ -2912,8 +2911,6 @@ void PartialSendInferMeta(const MetaTensor& x, true, phi::errors::InvalidArgument( "The id (%d) for partial_send op must >=0 and set_dtype(x.dtype()); - out->set_dims(x.dims()); } void PixelShuffleInferMeta(const MetaTensor& x, diff --git a/paddle/phi/infermeta/unary.h b/paddle/phi/infermeta/unary.h index 24a05ea3a24ac3..a9f5f2eb1a13ce 100644 --- a/paddle/phi/infermeta/unary.h +++ b/paddle/phi/infermeta/unary.h @@ -439,8 +439,7 @@ void PartialSendInferMeta(const MetaTensor& x, int peer, bool use_calc_stream, int num, - int id, - MetaTensor* out); + int id); void PixelShuffleInferMeta(const MetaTensor& x, int upscale_factor, diff --git a/test/ir/pir/translator/test_partial_send_translator.py b/test/ir/pir/translator/test_partial_send_translator.py index b1e490c793249d..9f133f5274969a 100644 --- a/test/ir/pir/translator/test_partial_send_translator.py +++ b/test/ir/pir/translator/test_partial_send_translator.py @@ -24,13 +24,11 @@ class TestPartialSendTranslator(test_op_translator.TestOpTranslator): def append_op(self): self.op_type = "partial_send" x = paddle.ones(shape=(100, 2, 3), dtype='float32') - y = x attrs = {'ring_id': 0, 'root_id': 0, 'use_calc_stream': False} helper = LayerHelper(self.op_type) helper.append_op( type=self.op_type, inputs={"X": x}, - outputs={"Out": y}, attrs=attrs, )