Commit 4b13bf66 by Yida Wang Committed by Tianqi Chen

[Fix]use a more intuitive way to limit the #ops in a group (#4018)

* use a more intuitive way to limit the #ops in a group

* format
parent 2ded2d8c
......@@ -623,8 +623,9 @@ class GraphPartitioner {
* \param parent The parent group.
*/
void MergeFromTo(Group* child, Group* parent) {
// refuse the fusion if too many ops are fused together
if (parent->num_nodes > kMaxFusedOps) return;
// refuse the fusion if too many ops are going to be fused together
if (child->num_nodes + parent->num_nodes > kMaxFusedOps)
return;
parent->num_nodes += child->num_nodes;
child = child->FindRoot();
parent = parent->FindRoot();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment