Browse Source

calculate used_devices in VirtualDataset

tags/v1.1.0
Xiaoda Zhang 5 years ago
parent
commit
aff9aaee35
2 changed files with 4 additions and 5 deletions
  1. +3
    -0
      mindspore/ccsrc/frontend/parallel/ops_info/virtual_dataset_info.cc
  2. +1
    -5
      mindspore/ccsrc/frontend/parallel/step_auto_parallel.cc

+ 3
- 0
mindspore/ccsrc/frontend/parallel/ops_info/virtual_dataset_info.cc View File

@@ -71,6 +71,9 @@ Status VirtualDatasetInfo::InferDevMatrixShape() {
if (stage_device_size_ > batch_split_num) {
dev_matrix_shape_.push_back(stage_device_size_ / batch_split_num);
}
// Because 'VirtualDataSet' uses 'InitWithManualRepeatCalc' which does not calculates 'used_devices_',
// we calculate it here.
used_devices_ = batch_split_num;

return SUCCESS;
}


+ 1
- 5
mindspore/ccsrc/frontend/parallel/step_auto_parallel.cc View File

@@ -350,8 +350,6 @@ OperatorInfoPtr CreateTheOperatorInfo(const PrimitivePtr &prim, const CNodePtr &
// Using CNode's UniqueIds to construct nodes
Status ConstructCostGraphNodesByUniqueId(const std::vector<AnfNodePtr> &all_nodes, const FuncGraphPtr &root) {
MS_LOG(INFO) << "Constructing nodes for cost graph begins.";
entire_costgraph = std::make_shared<CostGraph>();
entire_costgraph->SetDeviceMemoryAndCostParameter();
// The map from CNode's UniqueId to its operatorInfo
std::map<std::string, OperatorInfoPtr> from_cnode_to_info;
// The operator_infos in a loop
@@ -370,7 +368,7 @@ Status ConstructCostGraphNodesByUniqueId(const std::vector<AnfNodePtr> &all_node
FindLastNodesUniqueId(all_nodes, &last_forward_node_ids);
MS_LOG(INFO) << "there are " << last_forward_node_ids.size() << " output nodes in eval/predict";
}
// Step 1
for (auto &node : all_nodes) {
// NOTE: we only care about splittable Primitive operators
auto cnode = node->cast<CNodePtr>();
@@ -454,8 +452,6 @@ Status ConstructCostGraphNodesByUniqueId(const std::vector<AnfNodePtr> &all_node
// Using CNode's UniqueIdThroughCopys to construct nodes
Status ConstructCostGraphNodesByUniqueIdTC(const std::vector<AnfNodePtr> &all_nodes, const FuncGraphPtr &root) {
MS_LOG(INFO) << "Constructing nodes for cost graph begins.";
entire_costgraph = std::make_shared<CostGraph>();
entire_costgraph->SetDeviceMemoryAndCostParameter();
// The map from CNode's UniqueIdThroughCopy to its operatorInfo
std::map<std::string, OperatorInfoPtr> from_cnode_to_info;
// The operator_infos in a loop


Loading…
Cancel
Save