提交 fa24cbdb 编写于 作者: B backyes 提交者: Yu Yang

Support empty Param Block in ParameterSever (#244)

* Because in cluster maybe use a lot machine to train a model, and some parameter size could be too small for ParameterServer. Then some of pservers could not have any ParamBlock.
* Also, because ports_num or ports_num_for_sparse is too large, then give a warning in runtime.
上级 fc9ca53a
......@@ -264,6 +264,15 @@ void ParameterServer2::setParameter(const SendParameterRequest& request,
std::vector<int64_t> blockIds;
blockIds.reserve(request.blocks_size());
int bufferIndex = 0;
if (!request.blocks().size()) {
LOG(WARNING)
<< "--ports_num or --ports_num_for_sparse might be too large, "
<< "or total dense parameter size or sparse parameters size "
<< "might be too small, this psever doesn't store any parameter.";
return;
}
for (const auto& block : request.blocks()) {
/// block size for parameter(e.g. 128 for sparse row, 1K for dense)
uint64_t blockSize = getParameterConfig(block).parameter_block_size();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册