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

[core][experimental] Avoid false positives in deadlock detection #47912

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Oct 6, 2024

Why are these changes needed?

Initially, the deadlock detection mechanism was designed based on a DAGNode-based execution schedule, meaning the read, compute, and write operations belonging to the same DAGNode will be executed consecutively.

Then, #46911 changes the execution schedule from DAGNode-based to operation-based to avoid deadlocks caused by NCCL operations. Therefore, there are some false positives for the old deadlock detection mechanism.

With this PR, the deadlock detection focuses only on NCCL operations where both the reader and writer belong to the same actor.

Future works: Avoid false negatives

actor1.f1 ---> actor2.f1
           |
actor1.f2 --

In this case, actor1.f1 and actor1.f2 have control dependencies between them. If actor2.f1 reads actor1.f2 first and then actor1.f1, there will be a deadlock. However, this deadlock is not detectable until we have a more granular execution schedule.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
@@ -746,28 +745,6 @@ def test_torch_tensor_nccl_nested_dynamic(ray_start_regular):
compiled_dag.teardown()


@pytest.mark.parametrize("ray_start_regular", [{"num_cpus": 4}], indirect=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

This has already been covered by tests in test_detect_deadlock_dag.py.

@kevin85421 kevin85421 marked this pull request as ready for review October 6, 2024 00:59
python/ray/dag/compiled_dag_node.py Outdated Show resolved Hide resolved
Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
@kevin85421 kevin85421 added the go add ONLY when ready to merge, run all tests label Oct 7, 2024
@kevin85421 kevin85421 assigned kevin85421 and unassigned rkooo567 and ruisearch42 Oct 7, 2024
@jjyao jjyao merged commit 02d65eb into ray-project:master Oct 8, 2024
6 checks passed
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
…-project#47912)

Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants