Skip to content

Improved error messages for P2P shuffling#7979

Merged
hendrikmakait merged 8 commits intodask:mainfrom
hendrikmakait:improved-p2p-errors
Jul 10, 2023
Merged

Improved error messages for P2P shuffling#7979
hendrikmakait merged 8 commits intodask:mainfrom
hendrikmakait:improved-p2p-errors

Conversation

@hendrikmakait
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

A few minor cleanups


async def barrier(self, id: ShuffleId, run_id: int) -> None:
shuffle = self.states[id]
assert shuffle.run_id == run_id
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.

Suggested change
assert shuffle.run_id == run_id
assert shuffle.run_id == run_id, "Shuffle barrier ID does not match requested run_id"

? Or something like that?

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.

Done!

)
if run_id < shuffle.run_id:
raise RuntimeError("Stale shuffle")
raise RuntimeError(f"{shuffle} stale, expected run_id=={run_id}")
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.

Suggested change
raise RuntimeError(f"{shuffle} stale, expected run_id=={run_id}")
raise RuntimeError(f"{shuffle} stale, expected {run_id=}")

elif run_id > shuffle.run_id:
# This should never happen
raise RuntimeError("Invalid shuffle state")
raise RuntimeError(f"{shuffle} invalid, expected run_id=={run_id}")
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.

Suggested change
raise RuntimeError(f"{shuffle} invalid, expected run_id=={run_id}")
raise RuntimeError(f"{shuffle} invalid, expected {run_id=}")

@@ -696,10 +703,10 @@ async def _get_shuffle_run(
shuffle_id=shuffle_id,
)
if run_id < shuffle.run_id:
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.

Minor: use the same ordering for the conditions (shuffle.run_id > run_id) as in _restrict_task in the scheduler extensions?

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.

Done

elif run_id > shuffle.run_id:
# This should never happen
raise RuntimeError("Invalid shuffle state")
if run_id > shuffle.run_id:
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.

Minor: flip order of operands to align with restrict_task in the scheduler extension?

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.

Good point, done.

hendrikmakait and others added 2 commits July 10, 2023 12:44
Co-authored-by: Lawrence Mitchell <wence@gmx.li>
@hendrikmakait hendrikmakait merged commit 9beab9a into dask:main Jul 10, 2023
@hendrikmakait hendrikmakait deleted the improved-p2p-errors branch July 10, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants