You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how to use ucx protocol for the communication between workers and schedulers #371
It seems that the dask.distributed has supported the ucx protocol for the communications between workers and schedulers, which seems to have large advantages over tcp when equipped with infiniband. How can I use that with jobqueue? It seems not a hard thing because jobqueue is based on dask.distributed. If I add --protocol ucx option for scheduler and worker command, would that be ok ?
@songqiqqq I'm very excited to see a ucx/dask-jobqueue experiment. You are correct you will need to add the --protocol ucx but you will also need a handful of env variables to enable specific devices such as inifiniband and/or nvlink. We started to outline those configurations here:
I did. Things worked, but weren't yet any faster. The Dask + UCX team within RAPIDS (which @quasiben leads) is working on profiling and performance now, so hopefully we'll see some larger speedups soon.
As @quasiben states above, I did this just by adding the protocol="ucx://" keyword to the FooCluster classes.
Thanks for the ping @lesteve I pushed up some recent work here: #390. Still early days -- I probably won't be able to spend much time on it until later this month
This is a bit of a hack but may get you started quicker for your benchmarks, the approach I had in mind at the workshop (I did not explain as well as I could have probably):
@lesteve the following is what i've been doing (note: my nodes are currently a DGX -- 8 gpu machine). The scheduler and workers are executed together, again, because my nodes are a DGX machine and the granularity is one node
I did. Things worked, but weren't yet any faster. The Dask + UCX team within RAPIDS (which @quasiben leads) is working on profiling and performance now, so hopefully we'll see some larger speedups soon.
As @quasiben states above, I did this just by adding the protocol="ucx://" keyword to the FooCluster classes.
@mrocklin, could you point me to the setup you used on Cheyenne/Casper? I've been trying to launch a dask cluster with ucx protocol for communication. All my attempts have failed
I tried launching the scheduler from the command line, and I ran into a different error:
Details
(dask-gpu) bash-4.2$ dask-scheduler --protocol ucx
distributed.scheduler - INFO - -----------------------------------------------
distributed.scheduler - INFO - -----------------------------------------------
distributed.scheduler - INFO - Clear task state
[1621471211.546747] [casper-login1:254743:0] ucp_context.c:735 UCX WARN network device 'mlx5_0:1' is not available, please use one or more of: 'ext'(tcp), 'ib0'(tcp), 'mgt'(tcp)
[1621471211.546766] [casper-login1:254743:0] ucp_context.c:1071 UCX ERROR no usable transports/devices (asked tcp,sockcm on network:mlx5_0:1 )
Traceback (most recent call last):
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/cli/dask_scheduler.py", line 208, in main
loop.run_sync(run)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/tornado/ioloop.py", line 530, in run_sync
returnfuture_cell[0].result()
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/cli/dask_scheduler.py", line 204, in run
await scheduler
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/core.py", line 285, in _
await self.start()
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/scheduler.py", line 3678, in start
await self.listen(
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/core.py", line 400, in listen
listener = await listen(
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/comm/core.py", line 208, in _
await self.start()
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/comm/ucx.py", line 404, in start
init_once()
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/comm/ucx.py", line 76, in init_once
ucp.init(options=ucx_config, env_takes_precedence=True)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/ucp/core.py", line 766, in init
_ctx = ApplicationContext(options, blocking_progress_mode=blocking_progress_mode)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/ucp/core.py", line 234, in __init__
self.context = ucx_api.UCXContext(config_dict)
File "ucp/_libs/ucx_api.pyx", line 295, in ucp._libs.ucx_api.UCXContext.__init__
File "ucp/_libs/ucx_api.pyx", line 107, in ucp._libs.ucx_api.assert_ucs_status
ucp.exceptions.UCXError: No such device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/bin/dask-scheduler", line 11, in<module>sys.exit(go())
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/cli/dask_scheduler.py", line 217, in go
main()
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/click/core.py", line 1134, in __call__
return self.main(*args, **kwargs)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/click/core.py", line 1059, in main
rv = self.invoke(ctx)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/click/core.py", line 1401, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/click/core.py", line 767, in invoke
return __callback(*args, **kwargs)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/cli/dask_scheduler.py", line 212, in main
logger.info("End scheduler at %r", scheduler.address)
File "/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/core.py", line 359, in address
raise ValueError("cannot get address of non-running Server")
ValueError: cannot get address of non-running Server
Am I making a trivial error, or do I need to do some extra setup for things to work properly?
Ccing @quasiben in case he has some suggestions, too.
@andersy005 can you post the version of ucx / ucx-py and what ifconfig returns on one of the compute nodes? When using IB (Infiniband) you will also need to set rc to the UCX_TLS env var
I noticed that in my previously failed attempt, I was on the login node. I switched to a compute node, and launching the scheduler from the command line appears to be working. One thing to note here is that scheduler's IP address that ends up being used here is the Public IP address of the compute node:
$ dask-scheduler --protocol ucx
distributed.scheduler - INFO - -----------------------------------------------
/glade/work/abanihi/opt/miniconda/envs/dask-gpu/lib/python3.8/site-packages/distributed/node.py:160: UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 42672 instead
warnings.warn(
distributed.scheduler - INFO - -----------------------------------------------
distributed.scheduler - INFO - Clear task state
[1621529384.933221] [crhtc53:187174:0] ucp_context.c:735 UCX WARN network device 'mlx5_0:1' is not available, please use one or more of: 'ext'(tcp), 'ib0'(tcp), 'mgt'(tcp)
distributed.scheduler - INFO - Scheduler at: ucx://PUBLIC_IP:8786
distributed.scheduler - INFO - dashboard at: :42672
When I try to set up a cluster using dask-jobqueue on the same compute node, I get the same error as before
UCXPY_IFNAME should have no effect in Dask. If you want to use a specific interface you should use the --interface/interface to launch the Dask scheduler, I'm not sure how/if that's exposed in dask-jobqueue. On a UCX level, you can limit the interfaces that the process can see with UCX_NET_DEVICES, for example UCX_NET_DEVICES=ib0, but I think you would still need to pass interface to the scheduler. Also note that you do not have InfiniBand support built-in, as we don't ship conda packages with that enabled, so if that's what you're trying to test you'll have to build UCX from source.
I'm glad @andersy005 that you are trying to test this. Looks like there is some more testing and a good documentation effort to make all this work.
you should use the --interface/interface to launch the Dask scheduler, I'm not sure how/if that's exposed in dask-jobqueue
Yes it is, so we should be OK on this part.
Also note that you do not have InfiniBand support built-in, as we don't ship conda packages with that enabled, so if that's what you're trying to test you'll have to build UCX from source.
I think this is what we want!
I should add here that we also tested this a few months ago and found it to give no performance benefit (at least in our use case). We also found that it kills resilience, though this may have since changed.
Activity
quasiben commentedon Nov 24, 2019
@songqiqqq I'm very excited to see a ucx/dask-jobqueue experiment. You are correct you will need to add the
--protocol ucxbut you will also need a handful of env variables to enable specific devices such as inifiniband and/or nvlink. We started to outline those configurations here:https://ucx-py.readthedocs.io/en/latest/configuration.html
I believe for just IB you will need the following:
dask-jobqueue may also been interested in building a nicer abstraction for configuring UCX.
dask-cudahas been experimenting with this here:https://github.com/rapidsai/dask-cuda/blob/fbf3ef2cde8f42147945597d5bee81e6e388d5de/dask_cuda/dgx.py#L53-L61
guillaumeeb commentedon Nov 27, 2019
It would be really nice if some people could dive into this. This would be really helpful for the community.
@mrocklin didn't you try things on Cheyenne?
mrocklin commentedon Nov 27, 2019
I did. Things worked, but weren't yet any faster. The Dask + UCX team within RAPIDS (which @quasiben leads) is working on profiling and performance now, so hopefully we'll see some larger speedups soon.
As @quasiben states above, I did this just by adding the
protocol="ucx://"keyword to theFooClusterclasses.songqiqqq commentedon Nov 27, 2019
Sorry that I am messed up with lots of work at the end of the year. I would try to keep up with you and report here if any advances.
lesteve commentedon Mar 5, 2020
@quasiben was looking at this at one point at the Dask workshop. @quasiben if you manage to make progress on this, let us know!
quasiben commentedon Mar 5, 2020
Thanks for the ping @lesteve I pushed up some recent work here: #390. Still early days -- I probably won't be able to spend much time on it until later this month
lesteve commentedon Mar 6, 2020
Thanks a lot!
This is a bit of a hack but may get you started quicker for your benchmarks, the approach I had in mind at the workshop (I did not explain as well as I could have probably):
submission-script.sh(Submission script)your-dask-jobqueue-script.py(Python script creating the Dask scheduler and workers)And then you submit your submission script with
sbatch:This way the Dask scheduler will live on a cluster compute node with Infiniband.
If anything is not clear or does not quite work, let me know!
quasiben commentedon Mar 10, 2020
@lesteve the following is what i've been doing (note: my nodes are currently a DGX -- 8 gpu machine). The scheduler and workers are executed together, again, because my nodes are a DGX machine and the granularity is one node
dask-scheduler.script
dask-cuda-worker.script
andersy005 commentedon May 20, 2021
@mrocklin, could you point me to the setup you used on Cheyenne/Casper? I've been trying to launch a dask cluster with ucx protocol for communication. All my attempts have failed
Running the following
Results in a timeout error.
Details
I tried launching the scheduler from the command line, and I ran into a different error:
Details
Am I making a trivial error, or do I need to do some extra setup for things to work properly?
Ccing @quasiben in case he has some suggestions, too.
quasiben commentedon May 20, 2021
@andersy005 can you post the version of ucx / ucx-py and what ifconfig returns on one of the compute nodes? When using IB (Infiniband) you will also need to set
rcto theUCX_TLSenv varandersy005 commentedon May 20, 2021
@quasiben,
Here are the versions I am using
# Name Version Build Channel ucx 1.9.0+gcd9efd3 cuda11.0_0 rapidsai ucx-proc 1.0.0 gpu conda-forge ucx-py 0.19.0 py38_gcd9efd3_0 rapidsaiHere's the ifconfig output
Details
I noticed that in my previously failed attempt, I was on the login node. I switched to a compute node, and launching the scheduler from the command line appears to be working. One thing to note here is that scheduler's IP address that ends up being used here is the Public IP address of the compute node:
When I try to set up a cluster using dask-jobqueue on the same compute node, I get the same error as before
In this case, scheduler appears to be using the PRIVATE IP address instead of the PUBLIC IP address.
pentschev commentedon May 20, 2021
UCXPY_IFNAMEshould have no effect in Dask. If you want to use a specific interface you should use the--interface/interfaceto launch the Dask scheduler, I'm not sure how/if that's exposed in dask-jobqueue. On a UCX level, you can limit the interfaces that the process can see withUCX_NET_DEVICES, for exampleUCX_NET_DEVICES=ib0, but I think you would still need to passinterfaceto the scheduler. Also note that you do not have InfiniBand support built-in, as we don't ship conda packages with that enabled, so if that's what you're trying to test you'll have to build UCX from source.guillaumeeb commentedon May 28, 2021
I'm glad @andersy005 that you are trying to test this. Looks like there is some more testing and a good documentation effort to make all this work.
ocaisa commentedon May 28, 2021
I should add here that we also tested this a few months ago and found it to give no performance benefit (at least in our use case). We also found that it kills resilience, though this may have since changed.