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

[workspace] Add libcmaes as a testonly dependency #16441

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Jan 26, 2022

In the future, we might use this in production, but for getting started we only need it in the sample test.

Closes #16433.


This change is Reviewable

In the future, we might use this in production, but for getting started
we only need it in the sample test.
@jwnimmer-tri jwnimmer-tri added status: do not merge status: do not review release notes: fix This pull request contains fixes (no new features) labels Jan 26, 2022
@jwnimmer-tri
Copy link
Collaborator Author

Tested on macOS locally; no build errors.

+@hongkai-dai to begin feature review, please. Check over the parts you care about (is the demo working correctly; are there any important upstream optimization flags missing). You can leave the detailed BUILD review for someone else to cover.

Copy link
Contributor

@hongkai-dai hongkai-dai left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 6 files at r1.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee hongkai-dai, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on @hongkai-dai and @jwnimmer-tri)


tools/workspace/libcmaes/dev/sample_code.cc, line 48 at r1 (raw file):

  CMAParameters<> cmaparams(x0,sigma);
  //cmaparams._algo = BIPOP_CMAES;
  CMASolutions cmasols = cmaes<>(fsphere,cmaparams);

Thanks Jeremy. I am not sure how to check whether this code runs on multi-thread (the black-box optimizer would benefit from multithreading). libcmaes suggest to put this line to activate multi-threading

cmaparams.set_mt_feval(true); // activates the parallel evaluation

according to https://github.com/CMA-ES/libcmaes/wiki/Multithreading

They also suggest to wrap the objective function fsphere with a mutex.

I am OK to not check the multi-threading in this PR (sorry I never use multi-threading before).

Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri 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, LGTM missing from assignee hongkai-dai, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on @hongkai-dai)


tools/workspace/libcmaes/dev/sample_code.cc, line 48 at r1 (raw file):

Previously, hongkai-dai (Hongkai Dai) wrote…

Thanks Jeremy. I am not sure how to check whether this code runs on multi-thread (the black-box optimizer would benefit from multithreading). libcmaes suggest to put this line to activate multi-threading

cmaparams.set_mt_feval(true); // activates the parallel evaluation

according to https://github.com/CMA-ES/libcmaes/wiki/Multithreading

They also suggest to wrap the objective function fsphere with a mutex.

I am OK to not check the multi-threading in this PR (sorry I never use multi-threading before).

Looking at the libcmaes code, set_mt_feval only has any effect when OpenMP is enabled at compile-time. Therefore, it is a no-op in our Drake builds (because we do not enable OpenMP yet), so I think it's OK to merge this as-is. We can work on adjusting the settings in future commits, if we need to.

Copy link
Contributor

@hongkai-dai hongkai-dai left a comment

Choose a reason for hiding this comment

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

:lgtm: +@EricCousineau-TRI for Thursday's platform review, thanks!

Reviewed 2 of 6 files at r1.
Reviewable status: LGTM missing from assignee EricCousineau-TRI(platform) (waiting on @EricCousineau-TRI)

Copy link
Contributor

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

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

:lgtm: platform - and super informative comments- thanks!

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees EricCousineau-TRI(platform),hongkai-dai (waiting on @jwnimmer-tri)

@EricCousineau-TRI EricCousineau-TRI merged commit ed5fdb0 into RobotLocomotion:master Jan 27, 2022
@jwnimmer-tri jwnimmer-tri deleted the cmaes branch January 27, 2022 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: fix This pull request contains fixes (no new features)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bring in libcmaes as a dependency
3 participants