Skip to content
Snippets Groups Projects
Commit 96dd134b authored by jackalcooper's avatar jackalcooper Committed by Li Xinqi
Browse files

Fix keep header only (#2001)

* speedup compile time

* fix keep header only
parent 1b13f7e4
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ void AddKeepHeaderOnlyOp(const OpGraph& op_graph, Job* job) {
}
}
if (header_only_ibns.empty()) { return; }
CHECK(node->op().op_conf().has_tick_conf() == false);
auto OpEdge4Lbi = [node](const LogicalBlobId& lbi) -> OpEdge* {
for (OpEdge* edge : node->in_edges()) {
for (const LogicalBlobId& edge_lbi : edge->lbis()) {
......
......@@ -116,6 +116,7 @@ OperatorConf AppendTick(const std::list<const OpNode*>& op_nodes, JobBuilder* jo
std::vector<std::string> op_names;
std::vector<LogicalBlobId> lbis;
for (const auto* op_node : op_nodes) {
CHECK(op_node->op().op_conf().has_keep_header_only_conf() == false);
if (op_node->op().output_bns().empty()) {
op_names.push_back(op_node->op().op_name());
} else {
......@@ -206,15 +207,13 @@ void ForEachInputCriticalSectionOpNodes(
Handler) {
HashMap<OperatorConf::OpTypeCase, HashSet<const OpNode*>> op_type_case2op_nodes;
InitOpTypeCase2OpNodes(op_graph, &op_type_case2op_nodes);
for (OperatorConf::OpTypeCase op_type_case :
{OperatorConf::kVariableConf, OperatorConf::kInputConf}) {
if (op_type_case2op_nodes[op_type_case].empty()) { continue; }
HashSet<const OpNode*> op_nodes = op_type_case2op_nodes[op_type_case];
for (const OpNode* op_node : op_type_case2op_nodes[op_type_case]) {
op_node->ForEachNodeOnOutEdge([&](OpNode* out_node) { op_nodes.insert(out_node); });
}
Handler(op_nodes, GetOpNames(op_type_case2op_nodes[op_type_case]));
OperatorConf::OpTypeCase op_type_case = OperatorConf::kInputConf;
if (op_type_case2op_nodes[op_type_case].empty()) { return; }
HashSet<const OpNode*> op_nodes = op_type_case2op_nodes[op_type_case];
for (const OpNode* op_node : op_type_case2op_nodes[op_type_case]) {
op_node->ForEachNodeOnOutEdge([&](OpNode* out_node) { op_nodes.insert(out_node); });
}
Handler(op_nodes, GetOpNames(op_type_case2op_nodes[op_type_case]));
}
void ForEachOutputCriticalSectionOpNodes(
......
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