From 031a2931b05106ccfd73783dc0c79e8fdb3daa4d Mon Sep 17 00:00:00 2001 From: gengdongjie Date: Tue, 12 May 2020 21:08:45 +0800 Subject: [PATCH] add new auto mix precision flag --- mindspore/ccsrc/utils/context/ms_context.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/utils/context/ms_context.cc b/mindspore/ccsrc/utils/context/ms_context.cc index 8d372b1488..33182c11fb 100644 --- a/mindspore/ccsrc/utils/context/ms_context.cc +++ b/mindspore/ccsrc/utils/context/ms_context.cc @@ -366,7 +366,11 @@ void MsContext::GetGeOptions(std::map *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