fix typo word (#22784)

revert-22710-feature/integrated_ps_api
tianshuo78520a 5 years ago committed by GitHub
parent ebc7ffc300
commit 433cef03e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,7 +48,7 @@ if(WIN32)
SET(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@")
SET(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
# set defination for the dll export
# set definition for the dll export
if (NOT MSVC)
message(FATAL "Windows build only support msvc. Which was binded by the nvcc compiler of NVIDIA.")
endif(NOT MSVC)

@ -174,7 +174,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.5.2")
set(SHALLOW_CLONE "GIT_SHALLOW TRUE") # adds --depth=1 arg to git clone of External_Projects
endif()
########################### include third_party accoring to flags ###############################
########################### include third_party according to flags ###############################
include(external/zlib) # download, build, install zlib
include(external/gflags) # download, build, install gflags
include(external/glog) # download, build, install glog

@ -857,7 +857,7 @@ int DistSSAGraphBuilder::CreateRPCOp(ir::Graph *result, ir::Node *node) const {
op_dev_id = GetVarDeviceID(node->inputs[0]->Name());
PADDLE_ENFORCE(!ir::IsControlDepVar(*node->inputs[0]),
"This hack no longer holds, please fix.");
// the variable name which contains .block means it was splited by
// the variable name which contains .block means it was split by
// split_byref op
if (strategy_.reduce_ ==
details::BuildStrategy::ReduceStrategy::kAllReduce &&

@ -990,7 +990,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope,
}
if (!transfered_inplace_vars.empty()) {
// there is inplace variable has been transfered.
// there is inplace variable has been transferred.
TransferInplaceVarsBack(scope, transfered_inplace_vars, *transfer_scope);
}
if (FLAGS_enable_unused_var_check) {

@ -517,7 +517,8 @@ class OperatorWithKernel : public OperatorBase {
RuntimeContext* runtime_ctx) const;
/**
* Transfer data from scope to a transfered scope. If there is no data need to
* Transfer data from scope to a transferred scope. If there is no data need
* to
* be tranfered, it returns nullptr.
*
* * transfered_inplace_vars is a output vector.

@ -87,18 +87,18 @@ class ParallelExecutorPrivate {
inline bool HasGarbageCollectors() const { return !gcs_.empty(); }
/**
* NOTE(zengjinle): the feeded variables of users should not be reused,
* because users may feed them into another network. Changing the feeded
* NOTE(zengjinle): the fed variables of users should not be reused,
* because users may feed them into another network. Changing the fed
* variables that users can visit may cause calculation wrong, which is
* a very subtle bug when traning networks. However, these variables
* can be garbage collected.
*
* ParallelExecutor provides 2 methods to feed variables:
*
* - FeedTensorsIntoLocalScopes: this method would share memory of feeded
* - FeedTensorsIntoLocalScopes: this method would share memory of fed
* variables, so we have to skip these.
*
* - FeedAndSplitTensorIntoLocalScopes: this method would copy data of feeded
* - FeedAndSplitTensorIntoLocalScopes: this method would copy data of fed
* variables, so we do not need to skip
* them.
*/

@ -53,10 +53,10 @@ class ReaderBase {
// they are readers just before read op.
std::unordered_set<ReaderBase*> GetEndPoints();
// Returns the shapes of the feeded variables
// Returns the shapes of the fed variables
const std::vector<DDim>& Shapes() const { return shapes_; }
// Returns the dtypes of the feeded variables
// Returns the dtypes of the fed variables
const std::vector<proto::VarType::Type>& VarTypes() const {
return var_types_;
}
@ -80,13 +80,13 @@ class ReaderBase {
mutable std::mutex mu_;
// The shapes of the feeded variables.
// The shapes of the fed variables.
std::vector<DDim> shapes_;
// The dtypes of the feeded variables.
// The dtypes of the fed variables.
std::vector<proto::VarType::Type> var_types_;
// Whether to check the shape and dtype of feeded variables.
// Whether to check the shape and dtype of fed variables.
// For Backward compatibility, variables created by old API fluid.layers.data
// doesn't check shape but fluid.data checks.
std::vector<bool> need_check_feed_;

@ -210,7 +210,7 @@ TEST(test_prepare_op, test_prepare_data_same_place) {
attr_map);
framework::RuntimeContext ctx = PrepareRuntimeContext(ins, outs);
// test if it never transfered on GPU place
// test if it never transferred on GPU place
PreparedOp prepared_op = PreparedOp::Prepare(
ins, outs, dynamic_cast<framework::OperatorWithKernel&>(*op), cpu_place,
&attr_map);

@ -14,7 +14,7 @@
#
if(WITH_TESTING)
include(tests/test.cmake) # some generic cmake funtion for inference
include(tests/test.cmake) # some generic cmake function for inference
endif()
# TODO(panyx0718): Should this be called paddle_fluid_inference_api_internal?

@ -12,7 +12,7 @@ There are several demos:
- Each line contains a single record
- Each record's format is
```
<space splitted floats as data>\t<space splitted ints as shape>
<space split floats as data>\t<space split ints as shape>
```
To build and execute the demos, simply run

@ -23,10 +23,9 @@ limitations under the License. */
DECLARE_double(fraction_of_gpu_memory_to_use);
DEFINE_string(modeldir, "", "Directory of the inference model.");
DEFINE_string(refer, "", "path to reference result for comparison.");
DEFINE_string(
data, "",
"path of data; each line is a record, format is "
"'<space splitted floats as data>\t<space splitted ints as shape'");
DEFINE_string(data, "",
"path of data; each line is a record, format is "
"'<space split floats as data>\t<space split ints as shape'");
namespace paddle {
namespace demo {

@ -25,10 +25,9 @@ DECLARE_double(fraction_of_gpu_memory_to_use);
#endif
DEFINE_string(modeldir, "", "Directory of the inference model.");
DEFINE_string(refer, "", "path to reference result for comparison.");
DEFINE_string(
data, "",
"path of data; each line is a record, format is "
"'<space splitted floats as data>\t<space splitted ints as shape'");
DEFINE_string(data, "",
"path of data; each line is a record, format is "
"'<space split floats as data>\t<space split ints as shape'");
DEFINE_bool(use_gpu, false, "Whether use gpu.");
#ifdef PADDLE_WITH_SHARED_LIB
DECLARE_bool(profile);

@ -52,7 +52,7 @@ class BeamSearchOpMaker : public framework::OpProtoAndCheckerMaker {
"A LoDTensor containing the accumulated scores corresponding to "
"Output(selected_ids).");
AddOutput("parent_idx",
"A Tensor preserving the selected_ids' parent indice in pre_ids.")
"A Tensor preserving the selected_ids' parent index in pre_ids.")
.AsDispensable();
// Attributes stored in AttributeMap

@ -119,7 +119,7 @@ class CudnnLSTMOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault(0.0);
AddAttr<bool>("is_bidirec",
"is_bidirec"
"if it is bidirection rnn"
"if it is bidirectional rnn"
"The will affect the shape of the Out, last_h, and last_c")
.SetDefault(false);
AddAttr<int>("input_size", "input size ot the Input Tensor").SetDefault(10);

@ -35,7 +35,7 @@ class DensityPriorBoxOp : public framework::OperatorWithKernel {
platform::errors::InvalidArgument(
"The input tensor Input's height"
"of DensityPriorBoxOp should be smaller than input tensor Image's"
"hight. But received Input's height = %d, Image's height = %d",
"height. But received Input's height = %d, Image's height = %d",
input_dims[2], image_dims[2]));
PADDLE_ENFORCE_LT(

@ -543,7 +543,7 @@ std::unordered_set<int64_t> GeoSgdCommunicator::SparseIdsMerge(
const std::string &splited_var_name) {
// every batch has some sparse id, merge them into one unoredered_set
VLOG(4) << "Sparse Ids merge var: " << var_name
<< " splited var: " << splited_var_name;
<< " split var: " << splited_var_name;
auto before_run_ids_merge_ = GetCurrentUS();
auto origin_var_name = DeltaVarToVar(var_name);
auto splited_var_index = GetSplitedVarIndex(var_name, splited_var_name);
@ -567,9 +567,8 @@ void GeoSgdCommunicator::SendUpdateDenseVars(
// var_name: param.delta
auto origin_var_name = DeltaVarToVar(var_name);
auto splited_var_index = GetSplitedVarIndex(var_name, splited_var_name);
VLOG(4) << "Dense var: " << var_name
<< " 's splited var: " << splited_var_name
<< " splited var index: " << splited_var_index;
VLOG(4) << "Dense var: " << var_name << " 's split var: " << splited_var_name
<< " split var index: " << splited_var_index;
auto before_run_send_dense = GetCurrentUS();
auto cpu_ctx = paddle::platform::CPUDeviceContext();
@ -592,7 +591,7 @@ void GeoSgdCommunicator::SendUpdateDenseVars(
begin_loc = absolute_section_[origin_var_name][splited_var_index];
dimension = total_element / vars_first_dimension_[origin_var_name];
total_element = section * dimension;
VLOG(4) << "Dense splited var: " << splited_var_name
VLOG(4) << "Dense split var: " << splited_var_name
<< " section: " << section << " dimension: " << dimension
<< " begin loc: " << begin_loc << " total_element "
<< total_element;
@ -600,12 +599,12 @@ void GeoSgdCommunicator::SendUpdateDenseVars(
auto *var_x_data = var_x_tensor.mutable_data<float>(var_x_tensor.place()) +
begin_loc * dimension;
VLOG(4) << "Dense splited var: " << splited_var_name << " var_x_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_x_data[0] "
<< var_x_data[0] << " var_x_data[end] "
<< var_x_data[total_element - 1];
auto *var_y_data = var_y_tensor.mutable_data<float>(var_y_tensor.place()) +
begin_loc * dimension;
VLOG(4) << "Dense splited var: " << splited_var_name << " var_y_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_y_data[0] "
<< var_y_data[0] << " var_y_data[end] "
<< var_y_data[total_element - 1];
@ -616,14 +615,14 @@ void GeoSgdCommunicator::SendUpdateDenseVars(
var_z_tensor->mutable_data<float>(dims, cpu_ctx.GetPlace());
auto *var_z_data = var_z_tensor->mutable_data<float>(cpu_ctx.GetPlace());
VLOG(4) << "Dense splited var: " << splited_var_name << "var_z_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << "var_z_data[0] "
<< var_z_data[0] << " var_z_data[end] "
<< var_z_data[total_element - 1];
// calc sub = var_training - var_old
auto blas = math::GetBlas<paddle::platform::CPUDeviceContext, float>(cpu_ctx);
blas.VSUB(total_element, var_x_data, var_y_data, var_z_data);
VLOG(4) << "Dense splited var: " << splited_var_name << " var_z_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_z_data[0] "
<< var_z_data[0] << " var_z_data[end] "
<< var_z_data[total_element - 1];
@ -633,7 +632,7 @@ void GeoSgdCommunicator::SendUpdateDenseVars(
// calc var_old += var_delta
blas.VADD(total_element, var_y_data, var_z_data, var_y_data);
VLOG(4) << "Dense splited var: " << splited_var_name << " var_y_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_y_data[0] "
<< var_y_data[0] << " var_y_data[end] "
<< var_y_data[total_element - 1];
@ -763,7 +762,7 @@ void GeoSgdCommunicator::RecvUpdateDenseVars(
section = dims[0];
begin_loc = absolute_section_[origin_var_name][splited_var_index];
dimension = total_element / section;
VLOG(4) << "Dense splited var: " << splited_var_name
VLOG(4) << "Dense split var: " << splited_var_name
<< " section: " << section << " dimension: " << dimension
<< " begin loc: " << begin_loc << " total_element "
<< total_element;
@ -771,18 +770,18 @@ void GeoSgdCommunicator::RecvUpdateDenseVars(
auto *var_x_data = var_x_tensor.mutable_data<float>(var_x_tensor.place()) +
begin_loc * dimension;
VLOG(4) << "Dense splited var: " << splited_var_name << " var_x_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_x_data[0] "
<< var_x_data[0] << " var_x_data[end] "
<< var_x_data[total_element - 1];
auto *var_y_data = var_y_tensor.mutable_data<float>(var_y_tensor.place()) +
begin_loc * dimension;
VLOG(4) << "Dense splited var: " << splited_var_name << " var_y_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_y_data[0] "
<< var_y_data[0] << " var_y_data[end] "
<< var_y_data[total_element - 1];
auto *var_z_data = var_z_tensor.mutable_data<float>(cpu_ctx.GetPlace());
VLOG(4) << "Dense splited var: " << splited_var_name << " var_z_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_z_data[0] "
<< var_z_data[0] << " var_z_data[end] "
<< var_z_data[total_element - 1];
@ -793,7 +792,7 @@ void GeoSgdCommunicator::RecvUpdateDenseVars(
auto *var_y_sub_data =
var_y_sub_tensor->mutable_data<float>(cpu_ctx.GetPlace());
VLOG(4) << "Dense splited var: " << splited_var_name << " var_y_sub_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_y_sub_data[0] "
<< var_y_sub_data[0] << " var_y_sub_data[end] "
<< var_y_sub_data[total_element - 1];
@ -801,19 +800,19 @@ void GeoSgdCommunicator::RecvUpdateDenseVars(
// calc sub = pserver - old
blas.VSUB(total_element, var_z_data, var_y_data, var_y_sub_data);
VLOG(4) << "Dense splited var: " << splited_var_name << " var_y_sub_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_y_sub_data[0] "
<< var_y_sub_data[0] << " var_y_sub_data[end] "
<< var_y_sub_data[total_element - 1];
// calc train += sub
blas.VADD(total_element, var_x_data, var_y_sub_data, var_x_data);
VLOG(4) << "Dense splited var: " << splited_var_name << " var_x_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_x_data[0] "
<< var_x_data[0] << " var_x_data[end] "
<< var_x_data[total_element - 1];
// calc old = pserver
blas.VCOPY(total_element, var_z_data, var_y_data);
VLOG(4) << "Dense splited var: " << splited_var_name << " var_y_data[0] "
VLOG(4) << "Dense split var: " << splited_var_name << " var_y_data[0] "
<< var_y_data[0] << " var_y_data[end] "
<< var_y_data[total_element - 1];
@ -824,7 +823,7 @@ void GeoSgdCommunicator::RecvUpdateDenseVars(
void GeoSgdCommunicator::RecvUpdateSparseVars(
const std::string &var_name, const std::string &splited_var_name) {
// step 1: recv splited var from pserver
// step 1: recv split var from pserver
auto splited_var_index = GetSplitedVarIndex(var_name, splited_var_name);
auto origin_var_name = DeltaVarToVar(var_name);
auto origin_splited_var_name = DeltaVarToVar(splited_var_name);

@ -122,7 +122,7 @@ This operator can get variables from server side.
AddAttr<std::vector<std::string>>(
"recv_varnames",
"(vector<string>) "
"the splited parameter varnames to be recved from pserver")
"the split parameter varnames to be recved from pserver")
.SetDefault(std::vector<std::string>{});
AddAttr<int>("do_not_run", "if recv need to really run").SetDefault(0);
}

@ -116,7 +116,7 @@ This operator will send variables to listen_and_serve op at the parameter server
AddAttr<std::vector<std::string>>(
"send_varnames",
"(vector<string>) "
"the splited output varnames to send to pserver")
"the split output varnames to send to pserver")
.SetDefault(std::vector<std::string>{});
AddAttr<int>("num",
"(int, default 0)"

@ -28,7 +28,7 @@ namespace operators {
// x is Input,
// z is ResidualData,
// bias is Bias
// When `split_channels` is set, y will be splitted into multiple outputs,
// When `split_channels` is set, y will be split into multiple outputs,
// each output has split_channels[i] number of channels.
class Conv2DFusionOpMaker : public Conv2DOpMaker {
protected:

@ -162,7 +162,7 @@ class HierarchicalSigmoidOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault({});
AddAttr<std::vector<std::string>>(
"table_names",
"(string vector, the splited table names that will be fetched from "
"(string vector, the split table names that will be fetched from "
"parameter server)"
"in the order of input variables for mapping")
.SetDefault({});

@ -113,7 +113,7 @@ class LookupTableOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault({});
AddAttr<std::vector<std::string>>(
"table_names",
"(string vector, the splited table names that will be fetched from "
"(string vector, the split table names that will be fetched from "
"parameter server)"
"in the order of input variables for mapping")
.SetDefault({});

@ -100,7 +100,7 @@ class LookupTableV2OpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault({});
AddAttr<std::vector<std::string>>(
"table_names",
"(string vector, the splited table names that will be fetched from "
"(string vector, the split table names that will be fetched from "
"parameter server)"
"in the order of input variables for mapping")
.SetDefault({});

@ -777,11 +777,11 @@ void Blas<DeviceContext>::MatMul(const framework::Tensor &mat_a,
* When user calls this API, the multiplication of two big matrixes is split
* into multiplication of several (head_number_) small matrixes. e.g. if Mat A
* is [3, 24] and Mat B is [24, 4], when multiple A and B with head_number as
* 4, Mat A will be splitted as 4 matrix of [3, 6] and Mat B will be
* (horizontally) splitted as 4 matrix of [6, 4]. The result of final matrix
* 4, Mat A will be split as 4 matrix of [3, 6] and Mat B will be
* (horizontally) split as 4 matrix of [6, 4]. The result of final matrix
* will be 4 matrix of [3, 4], i.e. [3, 16].
* Another example is A is [3, 8], B is [2, 16], head_number is 4. In this
* case, A will be splitted as [3, 2], B will be (vertically) splitted as
* case, A will be split as [3, 2], B will be (vertically) split as
* [2, 4]. The final result will be 4 matrix of 4 matrix of [3,4], i.e. [3, 16]
*/
template <typename DeviceContext>

@ -106,7 +106,7 @@ class SimpleCode {
: c_(static_cast<size_t>(ids[code]) + num_classes) {}
/**
* Here the id of root should be 1 rather than 0, thus the encoding of class c
* is `c + num_classes` and all siblings can get the same weight indice using
* is `c + num_classes` and all siblings can get the same weight index using
* prefixes.
* Weight index is the prefixes of encoding, thus leave out the right most
* bit in calc_index.
@ -133,7 +133,7 @@ class CustomCode {
}
/**
* Here the id of root should be 1 rather than 0, thus the encoding of class c
* is `c + num_classes` and all siblings can get the same weight indice using
* is `c + num_classes` and all siblings can get the same weight index using
* prefixes.
* Weight index is the prefixes of encoding, thus leave out the right most
* bit in calc_index.

@ -55,11 +55,12 @@ class FCPrimitiveFactory {
} // Otherwise, create a new one.
auto in_col_dims = ctx.Attr<int>("in_num_col_dims");
PADDLE_ENFORCE_LE(in_col_dims, 2,
platform::errors::Unimplemented(
"DNNL FC doesn't support in_num_col_dims paramter to "
"be higher than "
"2."));
PADDLE_ENFORCE_LE(
in_col_dims, 2,
platform::errors::Unimplemented(
"DNNL FC doesn't support in_num_col_dims parameter to "
"be higher than "
"2."));
if (in_col_dims == 2) {
PADDLE_ENFORCE_EQ(
input->dims().size(), 3,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save