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

CPU bottleneck when benchmarking with large population size #232

Open
nikohansen opened this issue Apr 6, 2023 · 0 comments
Open

CPU bottleneck when benchmarking with large population size #232

nikohansen opened this issue Apr 6, 2023 · 0 comments
Labels
howto use cases, procedures, and workarounds usability

Comments

@nikohansen
Copy link
Contributor

When the objective function is quick to optimize, the bottleneck is (still) the SolutionDict.

Replacing the SolutionDict (which maps back the phenotypes to genotypes in tell) with an empty class like

import cma

cma.evolution_strategy._CMASolutionDict = cma.evolution_strategy._CMASolutionDict_empty

gives a more than six times faster execution when the population size is large as shown below. This changes the algorithm when boundary handling is applied (or when the gp attribute represents not the identity for some other reason), so whether this is the case needs to be carefully checked in each case.

Times recorded by the notebook cells and shown in the printed lines for running 20 iterations with popsize 3000:

Screenshot 2023-04-04 at 21 45 20

We may also want to investigate whether the SolutionDict implementation can still be improved.

@nikohansen nikohansen added howto use cases, procedures, and workarounds usability labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
howto use cases, procedures, and workarounds usability
Projects
None yet
Development

No branches or pull requests

1 participant