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

Fix useless property #944

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Jul 4, 2022

Make thejit_unspill property a local as discussed in #944.

In addition, fix a bug that was introduced in dask-cuda-worker in #944: the data argument has to be a callable, and should presumably return an object that is unique for each nanny.

wence- added 2 commits July 4, 2022 16:46
This class attribute is only ever looked at in __init__, so no need to
save it.
The construction of nannies requires that the data argument be a
callable, fix that in the case where we're trying to build a bare
dictionary.
@wence- wence- requested a review from madsbk July 4, 2022 15:57
@wence- wence- requested a review from a team as a code owner July 4, 2022 15:57
@github-actions github-actions bot added the python python code needed label Jul 4, 2022
@wence- wence- added breaking Breaking change 3 - Ready for Review Ready for review by team bug Something isn't working and removed python python code needed labels Jul 4, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.08@8dba7d1). Click here to learn what that means.
The diff coverage is n/a.

@@              Coverage Diff               @@
##             branch-22.08    #944   +/-   ##
==============================================
  Coverage                ?   0.00%           
==============================================
  Files                   ?      16           
  Lines                   ?    2103           
  Branches                ?       0           
==============================================
  Hits                    ?       0           
  Misses                  ?    2103           
  Partials                ?       0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8dba7d1...31e3776. Read the comment docs.

@@ -171,7 +171,7 @@ def del_pid_file():
if jit_unspill is None:
jit_unspill = dask.config.get("jit-unspill", default=False)
if device_memory_limit is None and memory_limit is None:
data = {}
data = lambda _: {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This breakage was not spotted by the test suite

TODO:

  • introduce test that exercises this code path.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

Choose a reason for hiding this comment

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

Maybe data = dict here would make more sense? A lambda to return an empty dict looks a bit weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

data is later called with a single argument which should be ignored in the dict case, so I don't think data = dict will work.

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok, I overlooked the argument. Let's leave it like this then.

Copy link
Member

@madsbk madsbk left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @wence-.

TODO: introduce test that exercises this code path

Agree, it would a good with a small test of this.

Copy link
Member

@pentschev pentschev left a comment

Choose a reason for hiding this comment

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

Looks good @wence- , left one suggestion but otherwise should be good to go.

@@ -171,7 +171,7 @@ def del_pid_file():
if jit_unspill is None:
jit_unspill = dask.config.get("jit-unspill", default=False)
if device_memory_limit is None and memory_limit is None:
data = {}
data = lambda _: {}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe data = dict here would make more sense? A lambda to return an empty dict looks a bit weird.

@pentschev
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit a3f1c13 into rapidsai:branch-22.08 Jul 5, 2022
@wence- wence- deleted the wence/fix-useless-property branch July 5, 2022 12:43
rapids-bot bot pushed a commit that referenced this pull request Jul 5, 2022
This introduces a test that was a TODO in #944

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

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

URL: #946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team breaking Breaking change bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants