-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
Use queued tasks in adaptive target #8037
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea7d8e0
Use queued tasks in adaptive target
mrocklin 43d26b3
add large test as well
mrocklin 1b6a2c5
handle None Tasks in queued
mrocklin bd4069a
Support unrunnable in adaptivity, also use take rather than sample
mrocklin 2da9df9
Simplify
mrocklin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -19,7 +19,7 @@ | |||||||
) | ||||||||
from distributed.compatibility import LINUX, MACOS, WINDOWS | ||||||||
from distributed.metrics import time | ||||||||
from distributed.utils_test import async_poll_for, gen_test, slowinc | ||||||||
from distributed.utils_test import async_poll_for, gen_cluster, gen_test, slowinc | ||||||||
|
||||||||
|
||||||||
def test_adaptive_local_cluster(loop): | ||||||||
|
@@ -484,3 +484,26 @@ async def test_adaptive_stopped(): | |||||||
pc = instance.periodic_callback | ||||||||
|
||||||||
await async_poll_for(lambda: not pc.is_running(), timeout=5) | ||||||||
|
||||||||
|
||||||||
@pytest.mark.parametrize("saturation", [1, float("inf")]) | ||||||||
@gen_cluster( | ||||||||
client=True, | ||||||||
nthreads=[], | ||||||||
config={ | ||||||||
"distributed.scheduler.default-task-durations": {"slowinc": 1000}, | ||||||||
}, | ||||||||
) | ||||||||
async def test_scale_up_large_tasks(c, s, saturation): | ||||||||
s.WORKER_SATURATION = saturation | ||||||||
futures = c.map(slowinc, range(10)) | ||||||||
while not s.tasks: | ||||||||
await asyncio.sleep(0.001) | ||||||||
|
||||||||
assert s.adaptive_target() == 10 | ||||||||
|
||||||||
more_futures = c.map(slowinc, range(200)) | ||||||||
while len(s.tasks) != 200: | ||||||||
await asyncio.sleep(0.001) | ||||||||
Comment on lines
+506
to
+507
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
|
||||||||
|
||||||||
assert s.adaptive_target() == 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
I prefer not to use these. I find that this removes one line but at the cost of adding a new abstraction (
async_poll_for
). The tradeoff here doesn't seem positive to me.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.
We are using these ubiquitously. I think this is not a design choice that should be left to the whim and taste of the individual developers; if you don't like them we should have a team talk about them which should result in either using them everywhere or removing them completely.