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
ycai
simbricks
Commits
3f91e459
"example/01_gemm/gemm_wmma_int8.cpp" did not exist on "941d1f7ce0a7529e7e23039baff1da3064a5d10e"
Commit
3f91e459
authored
Nov 04, 2020
by
Antoine Kaufmann
Browse files
experiments: support for checkpoints (maybe)
parent
c6139684
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
experiments/modes/runtime.py
experiments/modes/runtime.py
+1
-2
experiments/run.py
experiments/run.py
+23
-9
No files found.
experiments/modes/runtime.py
View file @
3f91e459
...
...
@@ -127,7 +127,7 @@ class LocalParallelRuntime(Runtime):
runs
=
self
.
runs_noprereq
+
self
.
runs_prereq
for
run
in
runs
:
# check if we first have to wait for memory or cores
while
not
self
.
enough_resources
(
run
)
or
not
self
.
prereq_ready
(
run
)
:
while
not
self
.
enough_resources
(
run
):
print
(
'waiting for resources'
)
await
self
.
wait_completion
()
...
...
@@ -205,7 +205,6 @@ class SlurmRuntime(Runtime):
script
=
self
.
prep_run
(
run
)
cmd
=
'sbatch '
+
script
stream
=
os
.
popen
(
'sbatch %s %s'
%
(
dep_cmd
,
script
))
output
=
stream
.
read
()
result
=
stream
.
close
()
...
...
experiments/run.py
View file @
3f91e459
...
...
@@ -62,6 +62,22 @@ elif args.runtime == 'slurm':
else
:
rt
=
runtime
.
LocalSimpleRuntime
(
verbose
=
args
.
verbose
)
def
add_exp
(
e
,
run
,
prereq
,
create_cp
,
restore_cp
):
outpath
=
'%s/%s-%d.json'
%
(
args
.
outdir
,
e
.
name
,
run
)
if
os
.
path
.
exists
(
outpath
):
print
(
'skip %s run %d'
%
(
e
.
name
,
run
))
return
None
workdir
=
'%s/%s/%d'
%
(
args
.
workdir
,
e
.
name
,
run
)
env
=
exp
.
ExpEnv
(
args
.
repo
,
workdir
)
env
.
create_cp
=
create_cp
env
.
restore_cp
=
restore_cp
run
=
runtime
.
Run
(
e
,
run
,
env
,
outpath
,
prereq
)
rt
.
add_run
(
run
)
return
run
# load experiments
if
not
args
.
pickled
:
# default: load python modules with experiments
...
...
@@ -75,16 +91,14 @@ if not args.pickled:
experiments
+=
mod
.
experiments
for
e
in
experiments
:
for
run
in
range
(
args
.
firstrun
,
args
.
firstrun
+
args
.
runs
):
outpath
=
'%s/%s-%d.json'
%
(
args
.
outdir
,
e
.
name
,
run
)
if
os
.
path
.
exists
(
outpath
):
print
(
'skip %s run %d'
%
(
e
.
name
,
run
))
continu
e
# if this is an experiment with a checkpoint we might have to create it
if
e
.
checkpoint
:
prereq
=
add_exp
(
e
,
0
,
None
,
True
,
False
)
else
:
prereq
=
Non
e
workdir
=
'%s/%s/%d'
%
(
args
.
workdir
,
e
.
name
,
run
)
env
=
exp
.
ExpEnv
(
args
.
repo
,
workdir
)
rt
.
add_run
(
runtime
.
Run
(
e
,
run
,
env
,
outpath
))
for
run
in
range
(
args
.
firstrun
,
args
.
firstrun
+
args
.
runs
):
add_exp
(
e
,
run
,
prereq
,
False
,
e
.
checkpoint
)
else
:
# otherwise load pickled run object
for
path
in
args
.
experiments
:
...
...
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