Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
superbenchmark
Commits
0172968f
Unverified
Commit
0172968f
authored
Apr 12, 2021
by
guoshzhao
Committed by
GitHub
Apr 12, 2021
Browse files
add _post_process() interface. (#40)
Co-authored-by:
Guoshuai Zhao
<
guzhao@microsoft.com
>
parent
c74f4879
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
superbench/benchmarks/base.py
superbench/benchmarks/base.py
+11
-0
superbench/benchmarks/return_code.py
superbench/benchmarks/return_code.py
+5
-4
No files found.
superbench/benchmarks/base.py
View file @
0172968f
...
@@ -109,6 +109,14 @@ class Benchmark(ABC):
...
@@ -109,6 +109,14 @@ class Benchmark(ABC):
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 @@ class Benchmark(ABC):
...
@@ -134,6 +142,9 @@ class Benchmark(ABC):
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
):
...
...
superbench/benchmarks/return_code.py
View file @
0172968f
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment