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

Method LoadLbi2SbpEdge

oneflow/core/auto_parallel/sbp_constructor.cpp:358–381  ·  view source on GitHub ↗

Load logical blob ids onto sbp edges

Source from the content-addressed store, hash-verified

356
357// Load logical blob ids onto sbp edges
358void SbpConstructor::LoadLbi2SbpEdge(const OpGraph& op_graph) {
359 // Load logical blobs onto sbp edges
360
361 for (auto* sbp_node_consumer : sbp_graph_.node_list_) {
362 auto* op_node = sbp_node_consumer->op_node_;
363
364 // Loading logical blobs between two nodes
365 // look through input blobs
366 for (const std::string& ibn : op_node->op().input_bns()) {
367 // Each input blob has one source op node.
368 OpNode* producer = op_node->MutSrcNode4Ibn(ibn);
369 // producer sbp node
370 const auto* sbp_node_producer = op_name2sbp_node_[producer->op().op_name()];
371 // TODO: recode this
372 auto* edge_found = sbp_node_consumer->FindEdgeWithNode(sbp_node_producer);
373
374 CHECK(edge_found != NULL) << "SbpEdge not found while loading!" << std::endl;
375
376 // Add copy cost for each blob
377 const LogicalBlobId& lbi = op_node->op().BnInOp2Lbi(ibn);
378 edge_found->LoadLbi(lbi);
379 }
380 };
381}
382
383Maybe<void> SbpConstructor::CheckSbpAgreement(const Job& job) {
384 Job new_job;

Callers

nothing calls this directly

Calls 4

MutSrcNode4IbnMethod · 0.80
FindEdgeWithNodeMethod · 0.80
LoadLbiMethod · 0.80
opMethod · 0.45

Tested by

no test coverage detected