Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
e2120984
Commit
e2120984
authored
Oct 10, 2022
by
Paul
Browse files
Format
parent
efbe9607
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
tools/tune_ck.py
tools/tune_ck.py
+5
-0
No files found.
tools/tune_ck.py
View file @
e2120984
...
@@ -17,6 +17,7 @@ def tmp_file(dump=None):
...
@@ -17,6 +17,7 @@ def tmp_file(dump=None):
def
pretty_print
(
obj
):
def
pretty_print
(
obj
):
print
(
json
.
dumps
(
obj
,
indent
=
2
))
print
(
json
.
dumps
(
obj
,
indent
=
2
))
def
run_driver
(
b
):
def
run_driver
(
b
):
print
(
b
)
print
(
b
)
with
tmp_file
(
lambda
tf
:
json
.
dump
(
b
,
tf
))
as
tf
:
with
tmp_file
(
lambda
tf
:
json
.
dump
(
b
,
tf
))
as
tf
:
...
@@ -31,13 +32,16 @@ def run_driver(b):
...
@@ -31,13 +32,16 @@ def run_driver(b):
continue
continue
yield
s
.
split
(
']: '
)[
1
].
strip
()
yield
s
.
split
(
']: '
)[
1
].
strip
()
def
convert_to_float
(
s
):
def
convert_to_float
(
s
):
return
s
[:
-
2
]
return
s
[:
-
2
]
def
get_device_time
(
s
):
def
get_device_time
(
s
):
fields
=
s
.
split
(
','
)
fields
=
s
.
split
(
','
)
return
convert_to_float
(
fields
[
-
1
].
strip
())
return
convert_to_float
(
fields
[
-
1
].
strip
())
def
benchmark_ck
(
config
,
tuning
):
def
benchmark_ck
(
config
,
tuning
):
b
=
{
b
=
{
'settings'
:
{
'settings'
:
{
...
@@ -70,6 +74,7 @@ def parse_log(f):
...
@@ -70,6 +74,7 @@ def parse_log(f):
config
=
json
.
loads
(
line
)
config
=
json
.
loads
(
line
)
yield
config
yield
config
def
benchmark_log
(
f
):
def
benchmark_log
(
f
):
result
=
[]
result
=
[]
for
config
in
parse_log
(
f
):
for
config
in
parse_log
(
f
):
...
...
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