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

Most models do not honor ParallelEval #49

Open
spakin opened this issue Feb 7, 2021 · 0 comments
Open

Most models do not honor ParallelEval #49

spakin opened this issue Feb 7, 2021 · 0 comments

Comments

@spakin
Copy link
Contributor

spakin commented Feb 7, 2021

Problem

Most of the models defined in models.go evaluate the fitness function sequentially, even if ParallelEval is set to true. From what I can tell from inspecting the source code, this applies to ModDownToSize, ModRing, and ModMutationOnly. This poses a problem because SPSO, DiffEvo, and OES all hard-wire ModMutationOnly as their model.

Reproducer

Here's a reproducer:

pareval.zip

Run first with the ModRing stanza commented out then with the ModGenerational stanza commented out and observe the performance difference. Here's what I measured:

ModGenerational

$ time ./pareval 
Best fitness at generation 0: -0.348941
Best fitness at generation 1: -0.757410
Best fitness at generation 2: -0.960569
Best fitness at generation 3: -0.960569
Best fitness at generation 4: -0.968049
Best fitness at generation 5: -0.968049
Best fitness at generation 6: -0.968049
Best fitness at generation 7: -0.968049
Best fitness at generation 8: -0.968049
Best fitness at generation 9: -0.983219
Best fitness at generation 10: -0.999640

real	0m42.007s
user	0m0.014s
sys	0m0.000s

ModRing

$ time ./pareval 
Best fitness at generation 0: -0.522594
Best fitness at generation 1: -0.928452
Best fitness at generation 2: -0.928452
Best fitness at generation 3: -0.928452
Best fitness at generation 4: -0.935102
Best fitness at generation 5: -0.935497
Best fitness at generation 6: -0.996757
Best fitness at generation 7: -0.996757
Best fitness at generation 8: -0.996757
Best fitness at generation 9: -0.996757
Best fitness at generation 10: -0.998831

real	7m32.042s
user	0m0.050s
sys	0m0.033s

Resolution

Unfortunately, this may be a difficult problem to fix. As far as I can tell, a Model has no access to a GAConfig and therefore can't determine if ParallelEval is set to true or false. If nothing else, others can reference this issue if, like I, they find that SPSO, DiffEvo, and OES run substantially slower than GA when given a computationally intense fitness function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant