diff --git a/paddle/fluid/operators/collective/c_embedding_op.cc b/paddle/fluid/operators/collective/c_embedding_op.cc index 2c228e5a17775c..182ace60aa7fce 100644 --- a/paddle/fluid/operators/collective/c_embedding_op.cc +++ b/paddle/fluid/operators/collective/c_embedding_op.cc @@ -87,7 +87,7 @@ class CEmbeddingOpMaker : public framework::OpProtoAndCheckerMaker { "and the out-of-bounds will be set to 0 ") .SetDefault(0); AddAttr("vocab_size", - "(int64, default -1), The total vocabulary size to check" + "(int64, default -1), The total vocabulary size to check " "the out-of-bounds ids. If it is -1, no check will be ") .SetDefault(-1); AddComment(R"DOC( diff --git a/paddle/fluid/operators/memcpy_d2h_op.cc b/paddle/fluid/operators/memcpy_d2h_op.cc index 8033cdb6489016..771c0ff19ce2c8 100644 --- a/paddle/fluid/operators/memcpy_d2h_op.cc +++ b/paddle/fluid/operators/memcpy_d2h_op.cc @@ -62,12 +62,13 @@ class MemcpyD2HOpProtoMaker : public framework::OpProtoAndCheckerMaker { AddOutput("Out", "(phi::DenseTensor) The type of output " "is the same as input X."); - AddAttr("dst_place_type", - "Determine the dst place of tensor copy. " - "By Now it ONLY support XPU/CUDAPlace <-> CUDAPinnedPlace/CPU" - "Other place type is Unimplemented and will cause ERROR." - "0: dst is on CPUPlace. " - "1: dst is on CUDAPinnedPlace. "); + AddAttr( + "dst_place_type", + "Determine the dst place of tensor copy. " + "By Now it ONLY support XPU/CUDAPlace <-> CUDAPinnedPlace/CPU. " + "Other place type is Unimplemented and will cause ERROR. " + "0: dst is on CPUPlace. " + "1: dst is on CUDAPinnedPlace. "); AddComment(R"DOC( MemcpyD2H Operator. By now, it ONLY supports the memcopy between CUDAPlace <-> CUDAPinnedPlace/CPU. diff --git a/paddle/fluid/operators/memcpy_h2d_op.cc b/paddle/fluid/operators/memcpy_h2d_op.cc index a65758f5ecf8a8..5a01de461429a2 100644 --- a/paddle/fluid/operators/memcpy_h2d_op.cc +++ b/paddle/fluid/operators/memcpy_h2d_op.cc @@ -64,10 +64,10 @@ class MemcpyH2DOpProtoMaker : public framework::OpProtoAndCheckerMaker { "is the same as input X."); AddAttr("dst_place_type", "Determine the dst place of tensor copy. " - "By Now it support:" - "0. CUDAPinnedPlace/CPU <->CUDAPlace" - "1. CPU <->XPUPlace" - "2. CPU <->IPUPlace" + "By Now it support: " + "0. CUDAPinnedPlace/CPU <->CUDAPlace. " + "1. CPU <->XPUPlace. " + "2. CPU <->IPUPlace. " "Other place type is Unimplemented and will cause ERROR."); AddComment(R"DOC( MemcpyD2H Operator. diff --git a/paddle/fluid/operators/sum_op.cc b/paddle/fluid/operators/sum_op.cc index 79a93bfca9e9e6..8fde85928e4070 100644 --- a/paddle/fluid/operators/sum_op.cc +++ b/paddle/fluid/operators/sum_op.cc @@ -127,8 +127,8 @@ class SumOpMaker : public framework::OpProtoAndCheckerMaker { void Make() override { AddInput( "X", - "A Variable list. The shape and data type of the list elements" - "should be consistent. Variable can be multi-dimensional Tensor" + "A Variable list. The shape and data type of the list elements " + "should be consistent. Variable can be multi-dimensional Tensor " "or phi::DenseTensor, and data types can be: float32, float64, int32, " "int64.") .AsDuplicable(); diff --git a/paddle/fluid/pybind/eager.cc b/paddle/fluid/pybind/eager.cc index d2af764fc392d7..1067c4e6854e3b 100644 --- a/paddle/fluid/pybind/eager.cc +++ b/paddle/fluid/pybind/eager.cc @@ -901,7 +901,7 @@ int TensorInit(PyObject* self, PyObject* args, PyObject* kwargs) { true, common::errors::PreconditionNotMet( "Could not parse args and kwargs successfully, " - "please check your input first and make" + "please check your input first and make " "sure you are on the right way. " "The expected arguments as follow: (" "value, place, persistable, zero_copy, " @@ -1307,7 +1307,7 @@ int StringTensorInit(PyObject* self, PyObject* args, PyObject* kwargs) { true, common::errors::PreconditionNotMet( "Could not parse args and kwargs successfully, " - "please check your input first and make" + "please check your input first and make " "sure you are on the right way. " "The expected arguments as follow: (" "value, zero_copy, name, dims)")); diff --git a/paddle/fluid/pybind/eager_functions.cc b/paddle/fluid/pybind/eager_functions.cc index 15b78262ef8e0b..b5e4bb3e82a6bc 100644 --- a/paddle/fluid/pybind/eager_functions.cc +++ b/paddle/fluid/pybind/eager_functions.cc @@ -1353,8 +1353,8 @@ static PyObject* eager_api_set_master_grads(PyObject* self, PADDLE_ENFORCE_NE( grad, nullptr, - common::errors::Fatal("Detected nullptr grad" - "Please check if you have manually cleared" + common::errors::Fatal("Detected nullptr grad. " + "Please check if you have manually cleared " "the grad inside autograd_meta")); if (((*grad).has_allocation() || (*grad).is_dist_tensor()) && ((*grad).dtype() == phi::DataType::FLOAT16 || diff --git a/paddle/fluid/pybind/eager_generator.cc b/paddle/fluid/pybind/eager_generator.cc index 0ecd4c6263c1bf..e6b8e0ccb86bba 100644 --- a/paddle/fluid/pybind/eager_generator.cc +++ b/paddle/fluid/pybind/eager_generator.cc @@ -502,6 +502,7 @@ static void SlotNameMatching( grad_fwd_slotname_map[grad_slot_name] != fwd_slot_name) { PADDLE_THROW(common::errors::Fatal( "Detected mismatched slot names." + "Detected mismatched slot names: " "grad_slot_name %s matches both %s and %s fwd_slot_name", grad_slot_name, grad_fwd_slotname_map[grad_slot_name], @@ -536,7 +537,7 @@ static void SlotNameMatching( if (grad_fwd_slotname_map.count(grad_slot_name) && grad_fwd_slotname_map[grad_slot_name] != fwd_slot_name) { PADDLE_THROW(common::errors::Fatal( - "Detected mismatched slot names" + "Detected mismatched slot names: " "grad_slot_name %s matches both %s and %s fwd_slot_name", grad_slot_name, grad_fwd_slotname_map[grad_slot_name], diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index 8af90c243833d3..2aa7606619bb4b 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -931,8 +931,8 @@ static PyObject* tensor_clear_gradient(TensorObject* self, grad = egr::EagerUtils::mutable_grad(self->tensor); PADDLE_ENFORCE( grad != nullptr, - common::errors::Fatal("Detected nullptr grad" - "Please check if you have manually cleared" + common::errors::Fatal("Detected nullptr grad. " + "Please check if you have manually cleared " "the grad inside autograd_meta")); } else { auto meta = egr::EagerUtils::unsafe_autograd_meta(self->tensor); @@ -995,8 +995,8 @@ static PyObject* tensor__zero_grads(TensorObject* self, paddle::Tensor* grad = egr::EagerUtils::mutable_grad(self->tensor); PADDLE_ENFORCE( grad != nullptr, - common::errors::Fatal("Detected nullptr grad" - "Please check if you have manually cleared" + common::errors::Fatal("Detected nullptr grad. " + "Please check if you have manually cleared " "the grad inside autograd_meta")); if (grad->initialized()) { if (grad->is_dense_tensor() || grad->is_dist_tensor()) { diff --git a/paddle/fluid/pybind/eager_properties.cc b/paddle/fluid/pybind/eager_properties.cc index cd0d67efcd4439..d89c8eb8418e52 100644 --- a/paddle/fluid/pybind/eager_properties.cc +++ b/paddle/fluid/pybind/eager_properties.cc @@ -311,8 +311,8 @@ int tensor_properties_set_grad(TensorObject* self, paddle::Tensor* grad = egr::EagerUtils::mutable_grad(self->tensor); PADDLE_ENFORCE( grad != nullptr, - common::errors::Fatal("Detected NULL grad" - "Please check if you have manually cleared" + common::errors::Fatal("Detected NULL grad. " + "Please check if you have manually cleared " "the grad inside autograd_meta")); const phi::distributed::ProcessMesh* mesh = nullptr; if (InputsContainDistTensor(&mesh, src, self->tensor, *grad)) { @@ -334,8 +334,8 @@ int tensor_properties_set_grad_(TensorObject* self, paddle::Tensor* grad = egr::EagerUtils::mutable_grad(self->tensor); PADDLE_ENFORCE( grad != nullptr, - common::errors::Fatal("Detected NULL grad" - "Please check if you have manually cleared" + common::errors::Fatal("Detected NULL grad. " + "Please check if you have manually cleared " "the grad inside autograd_meta")); *grad = src; return 0; diff --git a/paddle/fluid/pybind/imperative.cc b/paddle/fluid/pybind/imperative.cc index eefe6bf8e4e0ea..c7869861793036 100644 --- a/paddle/fluid/pybind/imperative.cc +++ b/paddle/fluid/pybind/imperative.cc @@ -737,7 +737,7 @@ void BindImperative(py::module *m_ptr) { } else { PADDLE_THROW(common::errors::InvalidArgument( "Incompatible Place Type: supports XPUPlace, CUDAPlace, " - "CPUPlace, IPUPlace, XPUPinnedPlace" + "CPUPlace, IPUPlace, XPUPinnedPlace " "and CUDAPinnedPlace, " "but got Unknown Type!")); } diff --git a/paddle/fluid/pybind/pir.cc b/paddle/fluid/pybind/pir.cc index 288a5bc95f18dd..cb73b45fa4cb0f 100644 --- a/paddle/fluid/pybind/pir.cc +++ b/paddle/fluid/pybind/pir.cc @@ -337,7 +337,7 @@ void PruneWithInput(const std::vector &input_vars, if (!input_vars_set.empty() && SomeInSet(op_results, input_vars_set)) { PADDLE_THROW(common::errors::InvalidArgument( "The input_var create by: '{%s}' is not involved in the " - "output_vars calculation" + "output_vars calculation. " "Please remove it from input_vars.", op->name())); } diff --git a/paddle/fluid/pybind/place.cc b/paddle/fluid/pybind/place.cc index 1e00d51799fad9..9872001ece2ec6 100644 --- a/paddle/fluid/pybind/place.cc +++ b/paddle/fluid/pybind/place.cc @@ -342,9 +342,9 @@ void BindPlace(pybind11::module &m) { // NOLINT } #else LOG(ERROR) << string::Sprintf( - "Cannot use CustomDevice because you have installed CPU/GPU" + "Cannot use CustomDevice because you have installed CPU/GPU " "version PaddlePaddle.\n" - "If you want to use CustomDevice, please try to install" + "If you want to use CustomDevice, please try to install " "CustomDevice version " "PaddlePaddle by: pip install paddlepaddle\n" "If you only have CPU, please change " diff --git a/paddle/fluid/pybind/pybind.cc b/paddle/fluid/pybind/pybind.cc index c95f73763ca956..07bf166122bbb1 100644 --- a/paddle/fluid/pybind/pybind.cc +++ b/paddle/fluid/pybind/pybind.cc @@ -2596,7 +2596,7 @@ All parameter, weight, gradient are variables in Paddle. VLOG(1) << string::Sprintf( "Cannot use get_all_device_type because you have installed " "CPU/GPU version PaddlePaddle.\n" - "If you want to use get_all_device_type, please try to install" + "If you want to use get_all_device_type, please try to install " "CustomDevice version " "PaddlePaddle by: pip install paddlepaddle\n"); #endif @@ -2624,7 +2624,7 @@ All parameter, weight, gradient are variables in Paddle. VLOG(1) << string::Sprintf( "Cannot use get_available_device because you have installed " "CPU/GPU version PaddlePaddle.\n" - "If you want to use get_available_device, please try to install" + "If you want to use get_available_device, please try to install " "CustomDevice version " "PaddlePaddle by: pip install paddlepaddle\n"); #endif @@ -2639,7 +2639,7 @@ All parameter, weight, gradient are variables in Paddle. "Cannot use get_available_custom_device because you have " "installed CPU/GPU version PaddlePaddle.\n" "If you want to use get_available_custom_device, please try to " - "install" + "install " "CustomDevice version " "PaddlePaddle by: pip install paddlepaddle\n"); #endif @@ -2657,7 +2657,7 @@ All parameter, weight, gradient are variables in Paddle. "Cannot use get_custom_device_count because you have " "installed CPU/GPU version PaddlePaddle.\n" "If you want to use get_custom_device_count, please try to " - "install" + "install " "CustomDevice version " "PaddlePaddle by: pip install paddlepaddle\n"); #endif diff --git a/paddle/fluid/pybind/slice_utils.h b/paddle/fluid/pybind/slice_utils.h index 4be2fe7a31976d..73f62793dd55f3 100644 --- a/paddle/fluid/pybind/slice_utils.h +++ b/paddle/fluid/pybind/slice_utils.h @@ -529,7 +529,7 @@ static void ParseIndex(const paddle::Tensor& tensor, PADDLE_ENFORCE_EQ(slice_tensor.shape()[i], dim_len, common::errors::OutOfRange( - "The shape of boolean index %d did not match" + "The shape of boolean index %d did not match " "indexed tensor %d along axis %d.", slice_tensor.shape()[0], dim_len, diff --git a/paddle/fluid/pybind/tensor_py.h b/paddle/fluid/pybind/tensor_py.h index fe7ce761c9cbff..102316279b0970 100644 --- a/paddle/fluid/pybind/tensor_py.h +++ b/paddle/fluid/pybind/tensor_py.h @@ -512,7 +512,7 @@ void SetTensorFromPyArrayT( } else { PADDLE_THROW(common::errors::InvalidArgument( "Incompatible place type: Tensor.set() supports " - "CPUPlace, CUDAPlace" + "CPUPlace, CUDAPlace " "and CUDAPinnedPlace, but got %s!", place)); } diff --git a/paddle/phi/backends/xpu/xpu_info.cc b/paddle/phi/backends/xpu/xpu_info.cc index 7b37de7fce0d0c..8b3ff923b1d444 100644 --- a/paddle/phi/backends/xpu/xpu_info.cc +++ b/paddle/phi/backends/xpu/xpu_info.cc @@ -40,8 +40,8 @@ PHI_DEFINE_EXPORTED_string( "This option is useful when doing multi process training and " "each process have only one device (XPU). If you want to use " "all visible devices, set this to empty string. NOTE: the " - "reason of doing this is that we want to use P2P communication" - "between XPU devices, use XPU_VISIBLE_DEVICES can only use" + "reason of doing this is that we want to use P2P communication " + "between XPU devices, use XPU_VISIBLE_DEVICES can only use " "share-memory only."); namespace phi { diff --git a/paddle/phi/core/platform/cpu_helper.cc b/paddle/phi/core/platform/cpu_helper.cc index 751c0a3bd0f934..269d8fd8b6d2b1 100644 --- a/paddle/phi/core/platform/cpu_helper.cc +++ b/paddle/phi/core/platform/cpu_helper.cc @@ -51,7 +51,7 @@ void SetNumThreads(int num_threads) { return; #else PADDLE_THROW(common::errors::Unimplemented( - "This library (except OPENBLAS, MKLML) is not supported yet, so the" + "This library (except OPENBLAS, MKLML) is not supported yet, so the " "number of threads cannot be set.")); #endif } diff --git a/paddle/phi/core/platform/profiler.cc b/paddle/phi/core/platform/profiler.cc index 993db57c6d90eb..a03f55a3dcf9e6 100644 --- a/paddle/phi/core/platform/profiler.cc +++ b/paddle/phi/core/platform/profiler.cc @@ -625,7 +625,7 @@ void EnableProfiler(ProfilerState state) { PADDLE_ENFORCE_NE(state, ProfilerState::kDisabled, common::errors::InvalidArgument( - "Can't enable profiling, since the input state is" + "Can't enable profiling, since the input state is " "ProfilerState::kDisabled")); SynchronizeAllDevice(); std::lock_guard l(profiler_mu);