diff --git a/tf_adapter/interface_spec/api_npu_config.pyh b/tf_adapter/interface_spec/api_npu_config.pyh index 21be81cae23729ead070cdf64dca671e05ad79f8..3da9eb54a385a9ca49aa351cf464ab606557eb65 100644 --- a/tf_adapter/interface_spec/api_npu_config.pyh +++ b/tf_adapter/interface_spec/api_npu_config.pyh @@ -37,4 +37,4 @@ class DynamicInputConfig(): class MemoryConfig(): def __init__(self, atomic_clean_policy=0, static_memory_policy=0, memory_optimization_policy=None, - variable_use_1g_huge_page=0): \ No newline at end of file + variable_use_1g_huge_page=2): \ No newline at end of file diff --git a/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py b/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py index 04b63e1abb4f564389abf028fa0f4c4a8a92233c..3ac6d95b6ad936837e20b7da8214adcfe9b97926 100644 --- a/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py +++ b/tf_adapter/python/npu_bridge/estimator/npu/npu_config.py @@ -369,7 +369,7 @@ class MemoryConfig(): atomic_clean_policy=0, static_memory_policy=0, memory_optimization_policy=None, - variable_use_1g_huge_page=0): + variable_use_1g_huge_page=2): """ Constructs a MemoryConfig. Args: diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index f1e23afb0bd80f51c1c36dd4e7bf0286eacfdcd1..f2722dd5e1013d984c4779f40e54caef0c87188a 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -480,7 +480,7 @@ std::map NpuAttrs::GetSessOptions(const OpKernelConstr std::string atomic_clean_policy = "0"; std::string memory_optimization_policy; std::string static_memory_policy = "0"; - std::string variable_use_1g_huge_page = "0"; + std::string variable_use_1g_huge_page = "2"; std::string topo_sorting_mode; std::string insert_op_file; std::string resource_config_path; @@ -655,7 +655,7 @@ std::map NpuAttrs::GetInitOptions(const OpKernelConstr std::string precision_mode_v2; std::string profiling_mode = "0"; std::string static_memory_policy = "0"; - std::string variable_use_1g_huge_page = "0"; + std::string variable_use_1g_huge_page = "2"; std::string auto_tune_mode; std::string graph_run_mode = "1"; std::string op_debug_level; @@ -1179,7 +1179,7 @@ std::map NpuAttrs::GetAllAttrOptions(const AttrSlice & std::string atomic_clean_policy = "0"; std::string memory_optimization_policy; std::string static_memory_policy = "0"; - std::string variable_use_1g_huge_page = "0"; + std::string variable_use_1g_huge_page = "2"; std::string auto_tune_mode; std::string graph_run_mode = "1"; std::string op_debug_level; @@ -1834,7 +1834,7 @@ Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options int64_t atomic_clean_policy = 0L; std::string memory_optimization_policy; std::string static_memory_policy = "0"; - std::string variable_use_1g_huge_page = "0"; + std::string variable_use_1g_huge_page = "2"; std::string auto_tune_mode; int64_t graph_run_mode = 1L; std::string enable_scope_fusion_passes; diff --git a/tf_adapter_2.x/python/npu_device/configs/memory_config.py b/tf_adapter_2.x/python/npu_device/configs/memory_config.py index 06581e74ddd2e34c392a8f4f098f1674bf74d137..519499b02413e257e450ed3167acf2e219f69404 100644 --- a/tf_adapter_2.x/python/npu_device/configs/memory_config.py +++ b/tf_adapter_2.x/python/npu_device/configs/memory_config.py @@ -25,6 +25,6 @@ class MemoryConfig(NpuBaseConfig): def __init__(self): self.atomic_clean_policy = OptionValue(0, [0, 1]) self.static_memory_policy = OptionValue(0, [0, 1, 2, 3, 4]) - self.variable_use_1g_huge_page = OptionValue(0, [0, 1, 2]) + self.variable_use_1g_huge_page = OptionValue(2, [0, 1, 2]) super(MemoryConfig, self).__init__()