!47424 fix issues of auto parallel

Merge pull request !47424 from bichaoyang/master
This commit is contained in:
i-robot 2023-01-04 03:44:04 +00:00 committed by Gitee
commit 543dc8d1a0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 4 deletions

View File

@ -1865,9 +1865,9 @@ Status OperatorInfo::CorrectMemoryCost(size_t input_index) {
static_cast<double>(operator_cost()->inputs_type_lengths()[input_index]);
swc->cost_list[0]->memory_with_reuse_ -= parameter_mem_cost;
if (swc->cost_list[0]->memory_with_reuse_ < 0) {
MS_LOG(ERROR) << name_ << ": The memory cost after correction is: " << swc->cost_list[0]->memory_with_reuse_
<< ", the parameter memory cost is: " << parameter_mem_cost;
return FAILED;
MS_LOG(WARNING) << name_ << ": The memory cost after correction is: " << swc->cost_list[0]->memory_with_reuse_
<< ", the parameter memory cost is: " << parameter_mem_cost;
swc->cost_list[0]->memory_with_reuse_ = 0;
}
}
return SUCCESS;

View File

@ -758,7 +758,8 @@ bool IsAutoParallelCareNode(const CNodePtr &cnode) {
}
bool bool_result = IsParallelCareNode(cnode) && !IsSplittableOperator(prim->name());
if (bool_result && (prim->name() != MAKE_TUPLE) && (prim->name() != MAKE_LIST)) {
MS_LOG(EXCEPTION) << "Should implementing OperatorInfo for: " << prim->name();
MS_LOG(EXCEPTION) << "For 'auto_parallel', missing the implementation of OperatorInfo for: " << prim->name()
<< ", please use 'semi_auto_parallel' mode.";
} else if (prim->name() == CAST) {
if (cnode->fullname_with_scope().find(OPTIMIZER_SUB_STRING) != std::string::npos) {
// Do not care CASTs from optimizer