Unverified Commit 0172968f authored by guoshzhao's avatar guoshzhao Committed by GitHub
Browse files

add _post_process() interface. (#40)


Co-authored-by: default avatarGuoshuai Zhao <guzhao@microsoft.com>
parent c74f4879
...@@ -109,6 +109,14 @@ def _preprocess(self): ...@@ -109,6 +109,14 @@ def _preprocess(self):
return True return True
def _postprocess(self):
"""Postprocess/cleanup operations after the benchmarking.
Return:
True if _postprocess() succeed.
"""
return True
@abstractmethod @abstractmethod
def _benchmark(self): def _benchmark(self):
"""Implementation for benchmarking.""" """Implementation for benchmarking."""
...@@ -134,6 +142,9 @@ def run(self): ...@@ -134,6 +142,9 @@ def run(self):
if not self.__check_result_format(): if not self.__check_result_format():
return False return False
if not self._postprocess():
return False
return True return True
def __check_result_format(self): def __check_result_format(self):
......
...@@ -18,7 +18,8 @@ class ReturnCode(Enum): ...@@ -18,7 +18,8 @@ class ReturnCode(Enum):
MODEL_TRAIN_FAILURE = 11 MODEL_TRAIN_FAILURE = 11
MODEL_INFERENCE_FAILURE = 12 MODEL_INFERENCE_FAILURE = 12
DISTRIBUTED_SETTING_INIT_FAILURE = 13 DISTRIBUTED_SETTING_INIT_FAILURE = 13
DATASET_GENERATION_FAILURE = 14 DISTRIBUTED_SETTING_DESTROY_FAILURE = 14
DATALOADER_INIT_FAILURE = 15 DATASET_GENERATION_FAILURE = 15
OPTIMIZER_CREATION_FAILURE = 16 DATALOADER_INIT_FAILURE = 16
MODEL_CREATION_FAILURE = 17 OPTIMIZER_CREATION_FAILURE = 17
MODEL_CREATION_FAILURE = 18
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment