forked from mindspore-Ecosystem/mindspore
set the environment variable "MS_GRAPH_KERNEL_FLAGS" to deprecated
This commit is contained in:
parent
fe9993a721
commit
be11003ec7
|
@ -160,8 +160,7 @@ set_context(**kwargs)
|
|||
|
||||
- dump_as_text:将详细信息转储为文本文件。默认值:False。
|
||||
|
||||
有关更多选项,可以参考实现代码。这些选项也可以通过环境变量MS_GRAPH_KERNEL_FLAGS设置,而无需修改网络源代码。
|
||||
例如,导出MS_GRAPH_KERNEL_FLAGS="--opt_level=2 --dump_as_text"。
|
||||
有关更多选项,可以参考实现代码。
|
||||
enable_reduce_precision (bool):表示是否开启降低精度计算。默认值:True。
|
||||
设置为True时,不支持用户指定的精度,且精度将自动更改。
|
||||
设置为False时,如果未指定用例的精度,则会报错并退出。
|
||||
|
@ -217,4 +216,4 @@ set_context(**kwargs)
|
|||
>>> context.set_context(grad_for_scalar=True)
|
||||
>>> context.set_context(save_compile_cache=True)
|
||||
>>> context.set_context(load_compile_cache=True)
|
||||
>>> context.set_context(pynative_synchronize=True)
|
||||
>>> context.set_context(pynative_synchronize=True)
|
||||
|
|
|
@ -150,11 +150,19 @@ class FlagRegister {
|
|||
} // namespace
|
||||
|
||||
std::pair<std::string, bool> GraphKernelFlags::GetGraphKernelContext() {
|
||||
// Use the environment variable in priority and not in lite
|
||||
// This environment variable is deprecated.
|
||||
auto env_flags = std::getenv("MS_GRAPH_KERNEL_FLAGS");
|
||||
std::string flags = env_flags ? std::string(env_flags) : "";
|
||||
bool use_env = (env_flags != nullptr);
|
||||
std::string flags = use_env ? std::string(env_flags) : "";
|
||||
bool enable_context{false};
|
||||
#ifndef MSLITE_ENABLE_GRAPH_KERNEL
|
||||
static bool print_warning = true;
|
||||
if (use_env && print_warning) {
|
||||
print_warning = false;
|
||||
MS_LOG(WARNING) << "The environment variable \"MS_GRAPH_KERNEL_FLAGS\" is deprecated from version 1.6 "
|
||||
<< "and will be removed in a future version, "
|
||||
<< "use context \"graph_kernel_flags\" instead.";
|
||||
}
|
||||
auto context = MsContext::GetInstance();
|
||||
MS_EXCEPTION_IF_NULL(context);
|
||||
if (flags.empty()) {
|
||||
|
|
|
@ -741,9 +741,7 @@ def set_context(**kwargs):
|
|||
|
||||
- dump_as_text: dump detail info as text files. Default: false.
|
||||
|
||||
More options can refer to the implementation code. These options can also be set by environment
|
||||
variable MS_GRAPH_KERNEL_FLAGS, without modifying network source code.
|
||||
For example, export MS_GRAPH_KERNEL_FLAGS="--opt_level=2 --dump_as_text".
|
||||
More options can refer to the implementation code.
|
||||
enable_reduce_precision (bool): Whether to enable precision reduction.
|
||||
If the operator does not support the user-specified precision, the precision will
|
||||
be changed automatically. Default: True.
|
||||
|
|
Loading…
Reference in New Issue