Browse Source

!1107 rectify auto mix precision

Merge pull request !1107 from gengdongjie/master
tags/v0.3.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
53c2a281fb
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      mindspore/ccsrc/utils/context/ms_context.cc

+ 5
- 1
mindspore/ccsrc/utils/context/ms_context.cc View File

@@ -366,7 +366,11 @@ void MsContext::GetGeOptions(std::map<std::string, std::string> *ge_options) con
}

// Enable auto mixed precision according to the context options
(*ge_options)["ge.exec.auto_mix_precision"] = std::to_string(auto_mixed_precision_flag_);
if (auto_mixed_precision_flag_) {
(*ge_options)["ge.exec.precision_mode"] = "allow_mix_precision";
} else {
(*ge_options)["ge.exec.precision_mode"] = "allow_fp32_to_fp16";
}
// Disable the global variable acc, only enable it whlie adding training graph in pipeline
(*ge_options)["ge.exec.variable_acc"] = "0";
#endif


Loading…
Cancel
Save