|
|
|
@ -53,13 +53,13 @@ class _AlgoParameterConfig():
|
|
|
|
|
self.check_config_handle()
|
|
|
|
|
return self._config_handle.get_simplify_cal()
|
|
|
|
|
|
|
|
|
|
def set_not_fully_use_devices(self, not_fully):
|
|
|
|
|
def set_fully_use_devices(self, not_fully):
|
|
|
|
|
self.check_config_handle()
|
|
|
|
|
self._config_handle.set_not_fully_use_devices(not_fully)
|
|
|
|
|
self._config_handle.set_fully_use_devices(not_fully)
|
|
|
|
|
|
|
|
|
|
def get_not_fully_use_devices(self):
|
|
|
|
|
def get_fully_use_devices(self):
|
|
|
|
|
self.check_config_handle()
|
|
|
|
|
return self._config_handle.get_not_fully_use_devices()
|
|
|
|
|
return self._config_handle.get_fully_use_devices()
|
|
|
|
|
|
|
|
|
|
def set_elementwise_op_strategy_follow(self, element_strategy_follow):
|
|
|
|
|
self.check_config_handle()
|
|
|
|
@ -119,7 +119,7 @@ def _algo_parameter_config():
|
|
|
|
|
|
|
|
|
|
set_algo_parameters_config_func_map = {
|
|
|
|
|
"simplify_cal": _algo_parameter_config().set_simplify_cal,
|
|
|
|
|
"not_fully_use_devices": _algo_parameter_config().set_not_fully_use_devices,
|
|
|
|
|
"fully_use_devices": _algo_parameter_config().set_fully_use_devices,
|
|
|
|
|
"elementwise_op_strategy_follow": _algo_parameter_config().set_elementwise_op_strategy_follow,
|
|
|
|
|
"tensor_slice_align_enable": _algo_parameter_config().set_tensor_slice_align_enable,
|
|
|
|
|
"tensor_slice_align_size": _algo_parameter_config().set_tensor_slice_align_size}
|
|
|
|
@ -127,14 +127,14 @@ set_algo_parameters_config_func_map = {
|
|
|
|
|
|
|
|
|
|
get_algo_parameters_config_func_map = {
|
|
|
|
|
"simplify_cal": _algo_parameter_config().get_simplify_cal,
|
|
|
|
|
"not_fully_use_devices": _algo_parameter_config().get_not_fully_use_devices,
|
|
|
|
|
"fully_use_devices": _algo_parameter_config().get_fully_use_devices,
|
|
|
|
|
"elementwise_op_strategy_follow": _algo_parameter_config().get_elementwise_op_strategy_follow,
|
|
|
|
|
"tensor_slice_align_enable": _algo_parameter_config().get_tensor_slice_align_enable,
|
|
|
|
|
"tensor_slice_align_size": _algo_parameter_config().get_tensor_slice_align_size}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@args_type_check(simplify_cal=bool, tensor_slice_align_enable=bool, tensor_slice_align_size=int,
|
|
|
|
|
not_fully_use_devices=bool, elementwise_op_strategy_follow=bool)
|
|
|
|
|
fully_use_devices=bool, elementwise_op_strategy_follow=bool)
|
|
|
|
|
def set_algo_parameters(**kwargs):
|
|
|
|
|
"""
|
|
|
|
|
Set algo parameter config.
|
|
|
|
@ -146,7 +146,7 @@ def set_algo_parameters(**kwargs):
|
|
|
|
|
simplify_cal (bool): Whether simplifying calculations in strategy-searching algorithm. Default: True
|
|
|
|
|
tensor_slice_align_enable (bool): Whether checking tensor slice shape. Default: False
|
|
|
|
|
tensor_slice_align_size (int): The minimum tensor slice shape, the value must be in [1, 1024]. Default: 16
|
|
|
|
|
not_fully_use_devices (bool): Whether generating strategies that not fully use devices. Default: False
|
|
|
|
|
fully_use_devices (bool): Whether generating strategies that fully use all available devices. Default: True
|
|
|
|
|
elementwise_op_strategy_follow (bool): Whether the elementwise operator have the same strategies as its
|
|
|
|
|
subsequent operators. Default: False
|
|
|
|
|
|
|
|
|
|