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
c4795b22
Commit
c4795b22
authored
Aug 24, 2021
by
Antoine Kaufmann
Browse files
experiments: add --proxy-type switch for --auto-dist
Can now select between sockets (default) or rdma.
parent
d58221bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
experiments/run.py
experiments/run.py
+4
-1
experiments/simbricks/runtime/distributed.py
experiments/simbricks/runtime/distributed.py
+12
-3
No files found.
experiments/run.py
View file @
c4795b22
...
@@ -93,6 +93,9 @@ g_dist.add_argument('--dist', dest='runtime', action='store_const',
...
@@ -93,6 +93,9 @@ g_dist.add_argument('--dist', dest='runtime', action='store_const',
g_dist
.
add_argument
(
'--auto-dist'
,
action
=
'store_const'
,
const
=
True
,
g_dist
.
add_argument
(
'--auto-dist'
,
action
=
'store_const'
,
const
=
True
,
default
=
False
,
default
=
False
,
help
=
'Automatically distribute non-distributed experiments'
)
help
=
'Automatically distribute non-distributed experiments'
)
g_dist
.
add_argument
(
'--proxy-type'
,
metavar
=
'TYPE'
,
type
=
str
,
default
=
'sockets'
,
help
=
'Proxy type to use (sockets,rdma) for auto distribution'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
@@ -171,7 +174,7 @@ if not args.pickled:
...
@@ -171,7 +174,7 @@ if not args.pickled:
for
e
in
experiments
:
for
e
in
experiments
:
if
args
.
auto_dist
and
not
isinstance
(
e
,
exp
.
DistributedExperiment
):
if
args
.
auto_dist
and
not
isinstance
(
e
,
exp
.
DistributedExperiment
):
e
=
runtime
.
auto_dist
(
e
,
executors
)
e
=
runtime
.
auto_dist
(
e
,
executors
,
args
.
proxy_type
)
# apply filter if any specified
# apply filter if any specified
if
(
args
.
filter
)
and
(
len
(
args
.
filter
)
>
0
):
if
(
args
.
filter
)
and
(
len
(
args
.
filter
)
>
0
):
match
=
False
match
=
False
...
...
experiments/simbricks/runtime/distributed.py
View file @
c4795b22
...
@@ -58,7 +58,7 @@ class DistributedSimpleRuntime(Runtime):
...
@@ -58,7 +58,7 @@ class DistributedSimpleRuntime(Runtime):
for
run
in
self
.
runnable
:
for
run
in
self
.
runnable
:
asyncio
.
run
(
self
.
do_run
(
run
))
asyncio
.
run
(
self
.
do_run
(
run
))
def
auto_dist
(
e
,
execs
):
def
auto_dist
(
e
,
execs
,
proxy_type
=
'sockets'
):
""" Converts an Experiment into a DistributedExperiment. Assigns network to
""" Converts an Experiment into a DistributedExperiment. Assigns network to
executor zero, and then round-robin assignment of hosts to executors,
executor zero, and then round-robin assignment of hosts to executors,
while also assigning all nics for a host to the same executor.
while also assigning all nics for a host to the same executor.
...
@@ -69,6 +69,15 @@ def auto_dist(e, execs):
...
@@ -69,6 +69,15 @@ def auto_dist(e, execs):
elif
len
(
execs
)
>
2
:
elif
len
(
execs
)
>
2
:
print
(
'Warning: currently auto_dist only uses the first two hosts'
)
print
(
'Warning: currently auto_dist only uses the first two hosts'
)
if
proxy_type
==
'sockets'
:
proxy_listener_c
=
proxy
.
SocketsNetProxyListener
proxy_connecter_c
=
proxy
.
SocketsNetProxyConnecter
elif
proxy_type
==
'rdma'
:
proxy_listener_c
=
proxy
.
RDMANetProxyListener
proxy_connecter_c
=
proxy
.
RDMANetProxyConnecter
else
:
raise
RuntimeError
(
'Unknown proxy type specified'
)
# Create the distributed experiment
# Create the distributed experiment
de
=
exp
.
DistributedExperiment
(
e
.
name
,
2
)
de
=
exp
.
DistributedExperiment
(
e
.
name
,
2
)
de
.
timeout
=
e
.
timeout
de
.
timeout
=
e
.
timeout
...
@@ -77,7 +86,7 @@ def auto_dist(e, execs):
...
@@ -77,7 +86,7 @@ def auto_dist(e, execs):
de
.
metadata
=
e
.
metadata
.
copy
()
de
.
metadata
=
e
.
metadata
.
copy
()
# create listening proxy on host 0
# create listening proxy on host 0
lp
=
proxy
.
RDMANetProxyL
istener
()
lp
=
proxy
_l
istener
_c
()
lp
.
name
=
'listener'
lp
.
name
=
'listener'
de
.
add_proxy
(
lp
)
de
.
add_proxy
(
lp
)
de
.
assign_sim_host
(
lp
,
0
)
de
.
assign_sim_host
(
lp
,
0
)
...
@@ -88,7 +97,7 @@ def auto_dist(e, execs):
...
@@ -88,7 +97,7 @@ def auto_dist(e, execs):
de
.
assign_sim_host
(
net
,
0
)
de
.
assign_sim_host
(
net
,
0
)
# create connecting proxy on host 1
# create connecting proxy on host 1
cp
=
proxy
.
RDMANetProxyC
onnecter
(
lp
)
cp
=
proxy
_c
onnecter
_c
(
lp
)
cp
.
name
=
'connecter'
cp
.
name
=
'connecter'
de
.
add_proxy
(
cp
)
de
.
add_proxy
(
cp
)
de
.
assign_sim_host
(
cp
,
1
)
de
.
assign_sim_host
(
cp
,
1
)
...
...
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