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

Respect average nthreads in adaptive #8041

Merged
merged 6 commits into from
Jul 28, 2023
Merged

Conversation

mrocklin
Copy link
Member

Previously we would assume in adaptive that workers had a single core.

Now we do a pass through all the workers to sum up the number of threads per machine and divide the recommendation by this amount.

This is not very expensive

In [1]: class Worker:
   ...:     def __init__(self):
   ...:         self.cpu = 4
   ...:

In [2]: workers = [Worker() for _ in range(1000)]

In [3]: %timeit sum(w.cpu for w in workers)
33.6 µs ± 170 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

Supercedes #8039

Previously we would assume in adaptive that workers had a single core.

Now we do a pass through all the workers to sum up the number of threads
per machine and divide the recommendation by this amount.

This is not very expensive

```python-console
In [1]: class Worker:
   ...:     def __init__(self):
   ...:         self.cpu = 4
   ...:

In [2]: workers = [Worker() for _ in range(1000)]

In [3]: %timeit sum(w.cpu for w in workers)
33.6 µs ± 170 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
```
@github-actions
Copy link
Contributor

github-actions bot commented Jul 27, 2023

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       20 files  ±  0         20 suites  ±0   10h 37m 14s ⏱️ - 46m 54s
  3 745 tests +  2    3 633 ✔️ +  2     106 💤 ±  0    6 ±0 
36 135 runs   - 69  34 383 ✔️  - 57  1 738 💤  - 10  14  - 2 

For more details on these failures, see this check.

Results for commit 2a2aedf. ± Comparison against base commit 9d9702e.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
distributed.deploy.tests.test_adaptive ‑ test_target_duration
distributed.deploy.tests.test_adaptive ‑ test_respect_average_nthreads
distributed.deploy.tests.test_adaptive ‑ test_target_duration[1]
distributed.deploy.tests.test_adaptive ‑ test_target_duration[5]

♻️ This comment has been updated with latest results.

@mrocklin
Copy link
Member Author

@fjetter handing this off to you and your team if you're cool with that.

@hendrikmakait hendrikmakait self-requested a review July 28, 2023 15:56
Copy link
Member

@fjetter fjetter left a comment

Choose a reason for hiding this comment

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

@hendrikmakait feel free to merge once the test works

@hendrikmakait hendrikmakait merged commit a7f7764 into dask:main Jul 28, 2023
16 of 25 checks passed
@mrocklin mrocklin deleted the adapt-nthreads branch July 28, 2023 18:27
@mrocklin
Copy link
Member Author

Thank you both for getting this in.

@mrocklin
Copy link
Member Author

cc @dchudz , this is in.

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