diff --git a/paddle/fluid/framework/feed_fetch_method.cc b/paddle/fluid/framework/feed_fetch_method.cc index b5587b7f228bc7..46543e7cba9bd8 100644 --- a/paddle/fluid/framework/feed_fetch_method.cc +++ b/paddle/fluid/framework/feed_fetch_method.cc @@ -97,7 +97,7 @@ FetchType& GetFetchVariable(const Scope& scope, const std::string& var_name, size_t index) { // Since we want to fetch FetchType from a variable, the variable must - // be created alreadly. + // be created already. Variable* g_fetch_value = scope.FindVar(var_name); PADDLE_ENFORCE_NOT_NULL(g_fetch_value, platform::errors::NotFound( diff --git a/paddle/fluid/framework/infershape_utils.cc b/paddle/fluid/framework/infershape_utils.cc index 88f0b496a8e4c6..bcf72be80decb1 100644 --- a/paddle/fluid/framework/infershape_utils.cc +++ b/paddle/fluid/framework/infershape_utils.cc @@ -859,7 +859,7 @@ CompatInferMetaContext BuildInferMetaContext(InferShapeContext* ctx, attr_names[i])); } } else { - // do nothing, skip currnet attr + // do nothing, skip current attr } } } diff --git a/paddle/fluid/framework/infershape_utils.h b/paddle/fluid/framework/infershape_utils.h index 6e1170c6ee0fe0..15d70d0ec41e05 100644 --- a/paddle/fluid/framework/infershape_utils.h +++ b/paddle/fluid/framework/infershape_utils.h @@ -85,7 +85,7 @@ class CompatMetaTensor : public phi::MetaTensor { is_runtime_, true, platform::errors::Unavailable( - "Only can get phi::DenseTensor from MetaTensor in rumtime.")); + "Only can get phi::DenseTensor from MetaTensor in runtime.")); auto* var = PADDLE_GET_CONST(Variable*, var_); PADDLE_ENFORCE_EQ( var->IsType(), diff --git a/paddle/fluid/framework/lod_tensor.h b/paddle/fluid/framework/lod_tensor.h index 9df50b69f3421a..95564307871532 100644 --- a/paddle/fluid/framework/lod_tensor.h +++ b/paddle/fluid/framework/lod_tensor.h @@ -166,8 +166,8 @@ std::pair> GetSubLoDAndAbsoluteOffset( const LoD& lod, size_t start_idx, size_t end_idx, size_t start_level); /* - * Serialize/Desiralize phi::DenseTensor to std::ostream - * You can pass ofstream or ostringstream to serilize to file + * Serialize/Deserialize phi::DenseTensor to std::ostream + * You can pass ofstream or ostringstream to serialize to file * or to a in memory string. GPU tensor will be copied to CPU. */ void SerializeToStream(std::ostream& os, diff --git a/paddle/fluid/framework/op_desc.cc b/paddle/fluid/framework/op_desc.cc index 9e6619f5b7b3f5..32c520711d978f 100644 --- a/paddle/fluid/framework/op_desc.cc +++ b/paddle/fluid/framework/op_desc.cc @@ -322,7 +322,7 @@ class CompileTimeInferShapeContext : public InferShapeContext { PADDLE_ENFORCE_EQ(arg_names.size(), 1UL, platform::errors::InvalidArgument( - "The iutput(%s) should hold only one element, but " + "The input(%s) should hold only one element, but " "now it holds %d elements.", name, arg_names.size())); diff --git a/paddle/fluid/framework/op_version_proto.h b/paddle/fluid/framework/op_version_proto.h index 2540862038c80e..0de3bc82a94d2f 100644 --- a/paddle/fluid/framework/op_version_proto.h +++ b/paddle/fluid/framework/op_version_proto.h @@ -55,7 +55,7 @@ class OpVersionMap { }; // get version id for operators with version id in paddle 2.4.2, this is used -// for converting ProgramDesc in 2.4 comtabible format +// for converting ProgramDesc in 2.4 compatible format const std::unordered_map& GetLegacyOpVersions(); } // namespace pb diff --git a/paddle/fluid/framework/op_version_registry.h b/paddle/fluid/framework/op_version_registry.h index 236a0e2b86187e..4e13894f562a38 100644 --- a/paddle/fluid/framework/op_version_registry.h +++ b/paddle/fluid/framework/op_version_registry.h @@ -378,11 +378,12 @@ class PassVersionCheckerRegistrar { static PassVersionCheckerRegistrar& GetInstance(); PassVersionCheckers& Register(const std::string& pass_name) { - PADDLE_ENFORCE_EQ(pass_version_checkers_map_.find(pass_name), - pass_version_checkers_map_.end(), - platform::errors::AlreadyExists( - "PassVersionCheckers(%s) has alredy been registered.", - pass_name.c_str())); + PADDLE_ENFORCE_EQ( + pass_version_checkers_map_.find(pass_name), + pass_version_checkers_map_.end(), + platform::errors::AlreadyExists( + "PassVersionCheckers(%s) has already been registered.", + pass_name.c_str())); return pass_version_checkers_map_[pass_name]; } bool IsPassCompatible(const std::string& fuse_pass_name) const { diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index c9d7af6a44ceab..8bcf3fe34ba528 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -2677,7 +2677,7 @@ Scope* OperatorWithKernel::PrepareData( // target_kernel_type. // Have a discussion with @Superjomn or the inference developers if some // changes on this logic for this macro might not tested on the other - // scenerios. + // scenarios. // If this op is not called by an Executor or ParallelExecutor, it should // called by a NaiveExecutor, the NaiveExecutor will cache the scopes and // variables, that behavior a lot different. @@ -3088,10 +3088,10 @@ static void SetDnnAttrIntoDeviceContext( phi::DeviceContext* dev_ctx, const Attribute& attr, const std::string& attr_name, - const operators::ExtraAttrPropertySet& attr_propertys) { + const operators::ExtraAttrPropertySet& attr_properties) { #ifdef PADDLE_WITH_DNNL if (phi::OneDNNContext::classof(dev_ctx) && - attr_propertys.Support(operators::ExtraAttrProperty::ONEDNN)) { + attr_properties.Support(operators::ExtraAttrProperty::ONEDNN)) { VLOG(4) << "Runtime attr `" << attr_name << "` is passed to OneDNNContext."; phi::OneDNNContext* one_dnn_ctx = static_cast(dev_ctx); switch (AttrTypeID(attr)) { @@ -3124,7 +3124,7 @@ static void SetDnnAttrIntoDeviceContext( #endif #ifdef PADDLE_WITH_CUDA if (phi::GPUContext::classof(dev_ctx) && - attr_propertys.Support(operators::ExtraAttrProperty::GPUDNN)) { + attr_properties.Support(operators::ExtraAttrProperty::GPUDNN)) { VLOG(4) << "Runtime attr `" << attr_name << "` is passed to GPUDNNContext."; phi::GPUContext* gpu_dnn_ctx = static_cast(dev_ctx); switch (AttrTypeID(attr)) { @@ -3585,8 +3585,8 @@ void OperatorWithKernel::BuildPhiKernelContext( for (const auto& attr_iter : runtime_attrs) { auto& attr_name = attr_iter.first; auto& attr = attr_iter.second; - auto attr_propertys = paddle::operators::GetExtraAttrProperties(attr_name); - SetDnnAttrIntoDeviceContext(dev_ctx, attr, attr_name, attr_propertys); + auto attr_properties = paddle::operators::GetExtraAttrProperties(attr_name); + SetDnnAttrIntoDeviceContext(dev_ctx, attr, attr_name, attr_properties); } // TODO(chenweihang): Since the pass will still `SetAttr` in the OpDesc, // we try to add these Attrs to the RuntimeAttrs, but these OpDesc will lose @@ -3600,8 +3600,8 @@ void OperatorWithKernel::BuildPhiKernelContext( for (const auto& attr_iter : attrs) { auto& attr_name = attr_iter.first; auto& attr = attr_iter.second; - auto attr_propertys = paddle::operators::GetExtraAttrProperties(attr_name); - SetDnnAttrIntoDeviceContext(dev_ctx, attr, attr_name, attr_propertys); + auto attr_properties = paddle::operators::GetExtraAttrProperties(attr_name); + SetDnnAttrIntoDeviceContext(dev_ctx, attr, attr_name, attr_properties); } VLOG(4) << "Done runtime attributes"; #endif diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 516c62a70f6889..897e520813809c 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -1314,7 +1314,7 @@ void ParallelExecutor::InitExecutorPrivateMemberInfo( device_name = "XPU"; } else { PADDLE_THROW( - platform::errors::Unavailable("Only CPU/CUDA/XPU is supportted. " + platform::errors::Unavailable("Only CPU/CUDA/XPU is supported. " "please use CPU/CUDA/XPU backend.")); } diff --git a/paddle/fluid/framework/program_utils.cc b/paddle/fluid/framework/program_utils.cc index 1147046c93d29f..04b6adf880fc73 100644 --- a/paddle/fluid/framework/program_utils.cc +++ b/paddle/fluid/framework/program_utils.cc @@ -158,9 +158,9 @@ void ProgramProcessor::AddDepToBlockOp(const BlockDesc &block) { } else if (op_type.compare("conditional_block") == 0) { op_input_var_vec = &((*op_inputs)["kInputs"]); } else { - // Only support while_op and conditinal_block_op now + // Only support while_op and conditional_block_op now LOG(WARNING) - << "Currently, only support while_op and conditinal_block_op.\n"; + << "Currently, only support while_op and conditional_block_op.\n"; continue; } diff --git a/paddle/fluid/framework/proto_desc.h b/paddle/fluid/framework/proto_desc.h index 08c78f6e09f73e..b8118ef805bde6 100644 --- a/paddle/fluid/framework/proto_desc.h +++ b/paddle/fluid/framework/proto_desc.h @@ -26,7 +26,7 @@ constexpr int kNoneBlockIndex = -1; constexpr int kNoneProcessMeshIndex = -1; // If a attribute name has a certain suffix, it means that the -// atrribute is a distributed-related attribute for auto parallel. +// attribute is a distributed-related attribute for auto parallel. // e.g., "mesh_id@AUTO_PARALLEL". constexpr char kAutoParallelSuffix[] = "@AUTO_PARALLEL"; diff --git a/paddle/fluid/framework/prune.cc b/paddle/fluid/framework/prune.cc index 93467b549d6e9a..9a4be9ed1f03ee 100644 --- a/paddle/fluid/framework/prune.cc +++ b/paddle/fluid/framework/prune.cc @@ -168,7 +168,7 @@ int GetOpRole(const proto::OpDesc& op_desc) { } } // If attr op_role is not found, it may be operator created in c++ test, like - // prune_test.cc. In that case, the op_role should be defaut value, which is + // prune_test.cc. In that case, the op_role should be default value, which is // kNotSpecified. return static_cast(OpRole::kNotSpecified); } @@ -261,7 +261,7 @@ void prune_impl(const proto::ProgramDesc& input, for (auto op_iter = ops.rbegin(); op_iter != ops.rend(); ++op_iter) { auto& op_desc = *op_iter; - // TODO(wanghaipeng03) reconstruct the follwing if/else block + // TODO(wanghaipeng03) reconstruct the following if/else block // to extract common code // // bool should_run_flag = false; @@ -281,7 +281,7 @@ void prune_impl(const proto::ProgramDesc& input, // // should_run.push_back(should_run_flag); // if (should_run_flag) { - // for (auto & var: op_desc.iputs()) { + // for (auto & var: op_desc.inputs()) { // for (....) { // if (.....) { // dependent_vars->insert(argu); @@ -304,7 +304,7 @@ void prune_impl(const proto::ProgramDesc& input, add_dependent_var(argu); } } - // NOTE(dev): All attibute with VarDesc type is considered as Input, + // NOTE(dev): All attribute with VarDesc type is considered as Input, // so they shall be added into dependent_vars. for (auto& attr : op_desc.attrs()) { if (attr.type() == proto::AttrType::VAR) { @@ -391,7 +391,7 @@ void prune_impl(const proto::ProgramDesc& input, std::vector sub_indices; GetSubBlocksIndices(*op, &sub_indices); for (auto& sub_index : sub_indices) { - // create a copy of dependent_vars to avoid being overwrited by the + // create a copy of dependent_vars to avoid being overwritten by the // other sub_block std::unordered_set dependent_vars_copy = sub_block_dependent_vars; @@ -438,7 +438,7 @@ void prune_impl(const proto::ProgramDesc& input, add_var_names(arg); } } - // NOTE(dev): All attibute with VarDesc type is considered as Input, + // NOTE(dev): All attribute with VarDesc type is considered as Input, // so they shall be added into dependent_vars. for (auto& attr : op.attrs()) { if (attr.type() == proto::AttrType::VAR) {