MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / CheckRegstLbiValid

Method CheckRegstLbiValid

oneflow/core/graph/task_node.cpp:442–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442void TaskEdge::CheckRegstLbiValid() const {
443 HashMap<LogicalBlobId, std::shared_ptr<RegstDesc>> lbi2data_regst;
444 for (auto& pair : name_in_producer2regst_) {
445 std::shared_ptr<RegstDesc> regst = pair.second;
446 if (regst->regst_desc_type().has_data_regst_desc()) {
447 // NOTE(chengcheng): regst_desc_type is Set, BUT regst_desc_type.data_regst_desc is UNSET!
448 // So you can ONLY use NumOfLbi and ForEachLbi interface.
449 CHECK_EQ(regst->NumOfLbi(), 1);
450 regst->ForEachLbi(
451 [&](const LogicalBlobId& lbi) { CHECK(lbi2data_regst.emplace(lbi, regst).second); });
452 }
453 }
454
455 CHECK_EQ(lbi2data_regst.size(), lbis_.size())
456 << " \n\n TaskEdge lbi and regst NOT match."
457 << " TaskEdge: edge_id = " << edge_id() << " From: [" << src_node()->VisualStr() << "] To: ["
458 << dst_node()->VisualStr() << "]\n";
459 for (auto& lbi : lbis_) {
460 CHECK(lbi2data_regst.find(lbi) != lbi2data_regst.end())
461 << " \n\n Cannot find lbi: " << lbi.DebugString() << " in TaskEdge From: ["
462 << src_node()->VisualStr() << "] To: [" << dst_node()->VisualStr() << "]\n\n";
463 }
464}
465
466RegstDescProto* FindOrCreateProducedCtrlRegstDesc(TaskProto* task_proto,
467 const std::string& regst_desc_name) {

Callers 2

CompileMethod · 0.80
CompileMethod · 0.80

Calls 7

NumOfLbiMethod · 0.80
ForEachLbiMethod · 0.80
findMethod · 0.80
sizeMethod · 0.45
VisualStrMethod · 0.45
endMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected