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

Concatenate small input chunks before P2P rechunking #8832

Merged
merged 22 commits into from
Aug 23, 2024

Conversation

hendrikmakait
Copy link
Member

@hendrikmakait hendrikmakait commented Aug 14, 2024

Blocked by (and includes) #8831

  • Tests added / passed
  • Passes pre-commit run --all-files

@hendrikmakait hendrikmakait marked this pull request as draft August 14, 2024 07:27
Copy link
Contributor

github-actions bot commented Aug 14, 2024

Unit Test Results

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

    25 files  ± 0      25 suites  ±0   10h 9m 26s ⏱️ - 10m 16s
 4 118 tests + 6   4 000 ✅ + 5    111 💤  -  2  7 ❌ +3 
47 571 runs  +60  45 457 ✅ +81  2 106 💤  - 25  8 ❌ +4 

For more details on these failures, see this check.

Results for commit 5487c23. ± Comparison against base commit e9d8233.

This pull request removes 8 and adds 14 tests. Note that renamed tests count towards both.
distributed.tests.test_client ‑ test_client_connectionpool_semaphore_loop
distributed.tests.test_client ‑ test_client_gather_semaphore_loop
distributed.tests.test_utils_test ‑ test_dump_cluster_state
distributed.tests.test_utils_test ‑ test_dump_cluster_state_nannies
distributed.tests.test_utils_test ‑ test_dump_cluster_state_no_workers
distributed.tests.test_utils_test ‑ test_dump_cluster_state_timeout
distributed.tests.test_utils_test ‑ test_dump_cluster_state_unresponsive_local_worker
distributed.tests.test_utils_test ‑ test_dump_cluster_unresponsive_remote_worker
distributed.diagnostics.tests.test_install_plugin ‑ test_package_install_on_nanny
distributed.diagnostics.tests.test_install_plugin ‑ test_package_install_on_worker
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_3d[old0-new0-expected0]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_3d[old1-new1-expected1]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_3d[old2-new2-expected2]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_3d[old3-new3-expected3]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_concatenation[1 B-expected0]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_concatenation[100 B-expected3]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_concatenation[20 B-expected1]
distributed.shuffle.tests.test_rechunk ‑ test_calculate_prechunking_concatenation[40 B-expected2]
…

♻️ This comment has been updated with latest results.

@hendrikmakait
Copy link
Member Author

A/B tests performed on coiled/benchmarks#1532 show a significant improvement in runtime for tests with small input chunks:

Screenshot 2024-08-19 at 09 49 32

As expected, we also see a significant increase in memory usage for those tests:
Screenshot 2024-08-19 at 09 49 40

The memory usage is still within very safe bounds.

Interestingly, we also see an increase in tiles_to_rows, once again within safe bounds:

Screenshot 2024-08-19 at 09 50 38

@hendrikmakait hendrikmakait marked this pull request as ready for review August 20, 2024 16:21
@phofl
Copy link
Collaborator

phofl commented Aug 22, 2024

The memory usage is still within very safe bounds.

Could you quantify this a little?

@hendrikmakait
Copy link
Member Author

hendrikmakait commented Aug 22, 2024

The memory usage is still within very safe bounds.

Could you quantify this a little?

Average memory increases by 10%-30% of the original value.

@hendrikmakait
Copy link
Member Author

@phofl: As discussed offline, I've extended the documentation. LMK if anything is still unclear.

Copy link
Collaborator

@phofl phofl left a comment

Choose a reason for hiding this comment

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

few very small comment, but lgtm now!

Thanks for the comments, that was very helpful

(
((2, 2), (1, 1, 1, 1), (1, 1, 1, 1)),
((1, 1, 1, 1), (2, 2), (2, 2)),
((2, 2), (2, 2), (2, 2)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one worries me a little bit. the max input chunk is 2, max output chunk is 4 but the algorithm concatenates in a way that we end with 8, which is not great

Copy link
Collaborator

Choose a reason for hiding this comment

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

is the block size limit the upper bound here?

Copy link
Member Author

Choose a reason for hiding this comment

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

distributed/shuffle/_rechunk.py Outdated Show resolved Hide resolved
# by trying dimensions in decreasing value / weight order.
def key(k: int) -> float:
gse = graph_size_effect[k]
bse = block_size_effect[k]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a sentences what these 2 variables represent when you define them above? Took me a bit to figure this out

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

hendrikmakait and others added 3 commits August 23, 2024 13:20
Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
@hendrikmakait hendrikmakait merged commit ea7d35c into dask:main Aug 23, 2024
24 of 32 checks passed
@hendrikmakait hendrikmakait deleted the use-rechunking-to-prerechunk branch August 23, 2024 12:49
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.

2 participants