-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
In the future, we might use this in production, but for getting started we only need it in the sample test.
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. |
There was a problem hiding this 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).
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+@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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platform - and super informative comments- thanks!
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: complete! all discussions resolved, LGTM from assignees EricCousineau-TRI(platform),hongkai-dai (waiting on @jwnimmer-tri)
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