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
b37d1a81
Commit
b37d1a81
authored
Dec 15, 2022
by
Alan Turner
Browse files
Formatting
parent
fc1aa176
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
tools/tune_models.py
tools/tune_models.py
+18
-9
No files found.
tools/tune_models.py
View file @
b37d1a81
...
...
@@ -24,10 +24,12 @@ def parse_args():
type
=
int
,
default
=
18
,
help
=
'Number of instances to tune'
)
parser
.
add_argument
(
'--update'
,
parser
.
add_argument
(
'--update'
,
'-u'
,
type
=
str
,
help
=
'Existing tuning JSON. Configs already present will not be re-tuned.'
)
help
=
'Existing tuning JSON. Configs already present will not be re-tuned.'
)
args
=
parser
.
parse_args
()
return
args
...
...
@@ -52,7 +54,13 @@ def tune_models(models, batch_sizes, seq_len, n, existing):
update_logs
=
[]
with
open
(
log_file
,
"r"
)
as
lf
:
logs
=
[
line
for
line
in
lf
]
stripped_logs
=
[
line
.
replace
(
"ck_gemm: "
,
""
).
replace
(
"ck_gemm_softmax_gemm: "
,
""
).
replace
(
"
\"
"
,
"'"
).
replace
(
"
\n
"
,
""
)
for
line
in
logs
]
stripped_logs
=
[
line
.
replace
(
"ck_gemm: "
,
""
).
replace
(
"ck_gemm_softmax_gemm: "
,
""
).
replace
(
"
\"
"
,
"'"
).
replace
(
"
\n
"
,
""
)
for
line
in
logs
]
for
i
in
range
(
len
(
stripped_logs
)):
if
(
stripped_logs
[
i
]
not
in
configs
):
...
...
@@ -82,7 +90,8 @@ def tune_models(models, batch_sizes, seq_len, n, existing):
def
run
(
args
):
tune_models
(
args
.
models
,
args
.
batch_sizes
,
args
.
sequence_length
,
args
.
n
,
args
.
update
)
tune_models
(
args
.
models
,
args
.
batch_sizes
,
args
.
sequence_length
,
args
.
n
,
args
.
update
)
run
(
parse_args
())
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