Skip to content

Update rearrange_by_column patch for explicit comms - #992

Merged
rapids-bot[bot] merged 7 commits into
rapidsai:branch-22.10from
rjzamora:rearrange_by_column-patch-update
Sep 27, 2022
Merged

rapids-bot[bot] merged 7 commits into
rapidsai:branch-22.10from
rjzamora:rearrange_by_column-patch-update

Conversation

@rjzamora

Copy link
Copy Markdown
Member

Motivated by discussions in NVIDIA/cudf#11576 (primarilty here). This PR updates the rearrange_by_columns_tasks wrapper to target rearrange_by_columns instead. The updated wrapper also handles the case that shuffle="explicit-comms".

@rjzamora rjzamora added 2 - In Progress Currently a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 22, 2022
@rjzamora
rjzamora requested a review from a team as a code owner September 22, 2022 16:52
@github-actions github-actions Bot added the python python code needed label Sep 22, 2022
@rjzamora

Copy link
Copy Markdown
Member Author

cc @madsbk @wence-

@rjzamora rjzamora added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Sep 22, 2022
@rjzamora

rjzamora commented Sep 23, 2022 •

Copy link
Copy Markdown
Member Author

@madsbk - Do you have any intuition on these CI failures

@wence- wence- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

More for discussion than definite change...

shuffle_arg = kwargs.pop("shuffle", None) or dask.config.get("shuffle", "disk")
if shuffle_arg == "explicit-comms" or (
dask.config.get("explicit-comms", False) and shuffle_arg == "tasks"
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this the minimally-surprising behaviour? My feeling is that the narrower specification (shuffle="tasks" as a keyword argument) should take precedence over the configuration variable.

Before this PR, there was one way to enable an explicit-comms shuffle: set dask.config["explicit-comms"] to True, which changed the meaning of shuffle="tasks" to be shuffle="explicit-comms".

Now that we are hooking in one level higher up, I think we can (unless we want to maintain backwards-compat) switch to a setup where the only way to request the explicit-comms shuffle is via dask.config["shuffle"] = "explicit-comms" or shuffle="explicit-comms", and remove the dask.config["explicit-comms"] option (unless we anticipate needing it for other things as well).

Concretely, I'm suggesting:

use_explicit_comms = kwargs.get("shuffle", dask.config.get("shuffle", None)) == "explicit-comms"
if use_explicit_comms:
    try:
        import distributed.worker
        distributed.worker.get_client()
    except (ImportError, ValueError):
        warning("Requested explicit-comms shuffle, but no distributed client available, using task-based shuffle")
        # slight action-at-a-distance here because this affects the call to `func` below in the (implicit) "not use_explicit_comms" branch.
        kwargs["shuffle"] = "tasks"
    else:
        ... # do the explicit-comms thing
return func(*args, **kwargs)

@rjzamora rjzamora Sep 26, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now that we are hooking in one level higher up, I think we can (unless we want to maintain backwards-compat) switch to a setup where...

Yes. I agree that we should move away from the "explicit-comms" config, but I was indeed trying to avoid a "breaking" change. With that said, I have no evidence that anyone is actually using the "explicit-comms" config in the wild. So, perhaps I was being too conservative.

Even if people are using the "explicit-comms" config, we should probably add a deprecation warning here, and tell them to use the "shuffle" option and config instead. What do you think about allowing the "explicit-comms"/"tasks" for now, but with a FutureWarning?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, let's do that (and try and get it in for 22.10 so we can immediately remove :P)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree, this is a good solution.

Comment thread docs/source/explicit_comms.rst Resolved
@codecov-commenter

codecov-commenter commented Sep 26, 2022 •

Copy link
Copy Markdown

Codecov Report

Base: 0.00% // Head: 0.00% // No change to project coverage 👍

Coverage data is based on head (1bcd412) compared to base (4f68949).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head 1bcd412 differs from pull request most recent head 58035c2. Consider uploading reports for the commit 58035c2 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           branch-22.10    #992   +/-   ##
============================================
  Coverage          0.00%   0.00%           
============================================
  Files                23      23           
  Lines              3102    3107    +5     
============================================
- Misses             3102    3107    +5     
Impacted Files Coverage Δ
dask_cuda/__init__.py 0.00% <0.00%> (ø)
dask_cuda/explicit_comms/dataframe/shuffle.py 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@madsbk madsbk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks @rjzamora

@rjzamora
rjzamora requested a review from wence- September 27, 2022 13:19
Comment thread docs/source/explicit_comms.rst Resolved

@wence- wence- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Comment thread docs/source/explicit_comms.rst Resolved
@rjzamora rjzamora added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Sep 27, 2022
@rjzamora

Copy link
Copy Markdown
Member Author

@gpucibot merge

@rapids-bot
rapids-bot Bot merged commit 8de9ce3 into rapidsai:branch-22.10 Sep 27, 2022
@rjzamora
rjzamora deleted the rearrange_by_column-patch-update branch September 27, 2022 14:51
rjzamora added a commit that referenced this pull request Sep 28, 2022
rapids-bot Bot pushed a commit to NVIDIA/cudf that referenced this pull request Sep 28, 2022
Due to some unfortunate issues with #11576 and rapidsai/dask-cuda#992, I feel that these PRs should be reverted before the 22.10 release.  This PRs roll back some recent changes that allow users to explicitly pass `shuffle="explicit-comms"` to certain shuffle-based algorithms.

cc @wence-

Authors:
  - Richard (Rick) Zamora (https://github.com/rjzamora)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Lawrence Mitchell (https://github.com/wence-)

URL: #11803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function non-breaking Non-breaking change python python code needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants