-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix UCX examples for InfiniBand #556
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,7 @@ | ||||||
import click | ||||||
import cupy | ||||||
|
||||||
from dask import array as da | ||||||
from dask.distributed import Client | ||||||
|
||||||
from dask_cuda.initialize import initialize | ||||||
|
@@ -27,7 +29,7 @@ def main( | |||||
ucx_net_devices = None | ||||||
|
||||||
if enable_infiniband: | ||||||
enable_rdmacm = True | ||||||
# enable_rdmacm = True # RDMACM not working right now | ||||||
ucx_net_devices = "mlx5_0:1" | ||||||
|
||||||
# set up environment | ||||||
|
@@ -40,7 +42,15 @@ def main( | |||||
) | ||||||
|
||||||
# initialize client | ||||||
client = Client(address) # noqa F841 | ||||||
client = Client(address) | ||||||
|
||||||
# client code here | ||||||
rs = da.random.RandomState(RandomState=cupy.random.RandomState) | ||||||
x = rs.random((10000, 10000), chunks=1000) | ||||||
x.sum().compute() | ||||||
|
||||||
# shutdown client | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shuts down the entire cluster, not the client: https://distributed.dask.org/en/latest/api.html#distributed.Client.shutdown . |
||||||
client.shutdown() | ||||||
|
||||||
|
||||||
if __name__ == "__main__": | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,7 @@ | ||||||
import click | ||||||
import cupy | ||||||
|
||||||
from dask import array as da | ||||||
from dask.distributed import Client | ||||||
from dask.utils import parse_bytes | ||||||
|
||||||
|
@@ -40,7 +42,7 @@ def main( | |||||
ucx_net_devices = None | ||||||
|
||||||
if enable_infiniband: | ||||||
enable_rdmacm = True | ||||||
# enable_rdmacm = True # RDMACM not working right now | ||||||
ucx_net_devices = "auto" | ||||||
|
||||||
if (enable_infiniband or enable_nvlink) and not interface: | ||||||
|
@@ -60,7 +62,15 @@ def main( | |||||
) | ||||||
|
||||||
# initialize client | ||||||
client = Client(cluster) # noqa F841 | ||||||
client = Client(cluster) | ||||||
|
||||||
# client code here | ||||||
rs = da.random.RandomState(RandomState=cupy.random.RandomState) | ||||||
x = rs.random((10000, 10000), chunks=1000) | ||||||
x.sum().compute() | ||||||
|
||||||
# shutdown client | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
client.shutdown() | ||||||
|
||||||
|
||||||
if __name__ == "__main__": | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit misleading, I would rename that to user code. Saying client code may sound like it's executed on the client-side only.