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

Parallelize the Rounding Stage of GCS #22222

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cohnt
Copy link
Contributor

@cohnt cohnt commented Nov 20, 2024

This ended up being pretty simple -- solve all the restrictions in a parallel for loop, and override options.parallelism to set the number of threads to one if any not-thread-safe costs or constraints are included in the GCS.

Gonna test this with the various debug builds before I send it up for review.


This change is Reviewable

@cohnt
Copy link
Contributor Author

cohnt commented Nov 21, 2024

@drake-jenkins-bot linux-jammy-clang-bazel-experimental-thread-sanitizer please
@drake-jenkins-bot linux-jammy-clang-bazel-experimental-valgrind-memcheck please
@drake-jenkins-bot linux-jammy-clang-bazel-experimental-undefined-behavior-sanitizer please
@drake-jenkins-bot linux-jammy-clang-bazel-experimental-address-sanitizer please

Copy link
Contributor

@AlexandreAmice AlexandreAmice left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, needs platform reviewer assigned, needs at least two assigned reviewers, labeled "do not merge", commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @cohnt)


geometry/optimization/graph_of_convex_sets.cc line 1618 at r1 (raw file):

    // If any costs or constraints aren't thread-safe, we can't parallelize.
    bool is_thread_safe = true;

Don't forget to set options.kMaxThreads = 1 and make sure to warn if is_thread_safe == false && parallelism.num_threads() > 1, otherwise users might be surprised if the extra threads aren't used.

…ts or constraints. Also make sure only one thread is used per solver.
Copy link
Contributor Author

@cohnt cohnt left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, needs platform reviewer assigned, needs at least two assigned reviewers, labeled "do not merge", commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @cohnt)


geometry/optimization/graph_of_convex_sets.cc line 1618 at r1 (raw file):

Previously, AlexandreAmice (Alexandre Amice) wrote…

Don't forget to set options.kMaxThreads = 1 and make sure to warn if is_thread_safe == false && parallelism.num_threads() > 1, otherwise users might be surprised if the extra threads aren't used.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: TODO (GCS)
Development

Successfully merging this pull request may close these issues.

2 participants