Skip to content
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

Standardize UCX config separator to - #5539

Merged
merged 2 commits into from
Nov 23, 2021

Conversation

pentschev
Copy link
Member

Some of the UCX configurations use _ whereas others use -. This is confusing so we now standardize everything to -. This also fixes an inconsistency from #5526, where configuration files used create-cuda-context, but the configuration read was create_cuda_context.

Some of the UCX configurations use `_` whereas others use `-`. This is
confusing so we now standardize everything to `-`. This also fixes an
inconsistency from dask#5526, where
configuration files used `create-cuda-context`, but the configuration
read was `create_cuda_context`.
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pentschev. In general I'm in favor of this change as it's more consistent with the naming convention of other configuration values. I am wondering if this makes a practical difference as my current understanding is our configuration system will treat - and _ the same. From https://docs.dask.org/en/stable/configuration.html#directly-within-python:

Note that the set function treats underscores and hyphens identically. For example, dask.config.set({'scheduler.work-stealing': True}) is equivalent to dask.config.set({'scheduler.work_stealing': True}).

@quasiben
Copy link
Member

Agreed, it shouldn't make any functional difference but will be consistent throughout our codebase. @pentschev any more additional thoughts ?

@pentschev
Copy link
Member Author

Thanks @pentschev. In general I'm in favor of this change as it's more consistent with the naming convention of other configuration values. I am wondering if this makes a practical difference as my current understanding is our configuration system will treat - and _ the same. From https://docs.dask.org/en/stable/configuration.html#directly-within-python:

Yes, and no. The reason I wanted to do this is because we may want to get the current/default configs with dask.config.get("distributed.comm.ucx") and rewrite them via the returned dict programatically, see what I'm doing in https://github.com/rapidsai/dask-cuda/pull/806/files#diff-fae45034757fc51999601c0f9886684027d56d2db243beb98ac08ef380731da1R301-R309 . However, before the PR I just linked to, we had the options hardcoded in https://github.com/rapidsai/dask-cuda/blob/branch-21.12/dask_cuda/utils.py#L299-L308, which would failed because of a missing recently introduced new option from Distributed (i.e., create_cuda_context). Therefore, this is mostly to avoid confusion when you dask.config.get and want to change configurations that are later passed to dask.config.{set,update}.

@pentschev
Copy link
Member Author

To be clearer with an example, this is what we get before this PR:

In [1]: import dask, distributed

In [2]: dask.config.get("distributed.comm.ucx")
Out[2]:
{'cuda_copy': None,
 'tcp': None,
 'nvlink': None,
 'infiniband': None,
 'rdmacm': None,
 'net-devices': None,
 'reuse-endpoints': None,
 'create-cuda-context': None}

See how _ (in cuda_copy) and - (in create-cuda-context and others) are different in the returned dict above.

@pentschev
Copy link
Member Author

I'm attempting to resolve the gpuCI test that failed in #5540 .

@pentschev
Copy link
Member Author

rerun tests

@jrbourbeau
Copy link
Member

Ah I see, thank you for the clarification. I've not had a chance to think too deeply about it yet, but I wonder if the dask.config.canonical_name utility might be useful for making how dask-cuda handles this case more flexible

@pentschev
Copy link
Member Author

Ah I see, thank you for the clarification. I've not had a chance to think too deeply about it yet, but I wonder if the dask.config.canonical_name utility might be useful for making how dask-cuda handles this case more flexible

Thanks @jrbourbeau , I had missed that utility. I agree, it seems useful and I'll make sure to use it in Dask-CUDA to prevent the issue I mentioned. For now, I think we could merge this and make it consistent anyway, there should be no downside in doing so.

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agreed -- thanks @pentschev

@jrbourbeau jrbourbeau merged commit b9b26ee into dask:main Nov 23, 2021
@pentschev
Copy link
Member Author

Thanks @jrbourbeau and @quasiben !

rapids-bot bot pushed a commit to rapidsai/dask-cuda that referenced this pull request Nov 23, 2021
Some of the UCX configurations used `_` whereas others used `-` as a separator. This has been standardized in dask/distributed#5539, and this updates Dask-CUDA to the new standard.

Authors:
  - Peter Andreas Entschev (https://github.com/pentschev)

Approvers:
  - Mads R. B. Kristensen (https://github.com/madsbk)

URL: #806
@pentschev pentschev deleted the standardize-ucx-config-separator branch December 3, 2021 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants