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

IllegalStateException: AAAAAH! during SMAC localSearch #2

Open
stephanheinemann opened this issue Oct 8, 2021 · 8 comments
Open

IllegalStateException: AAAAAH! during SMAC localSearch #2

stephanheinemann opened this issue Oct 8, 2021 · 8 comments

Comments

@stephanheinemann
Copy link

I am using SMAC as planning tuner in a Smart Autoflight Control System PhD project and just observed the following exception after otherwise successful tuning runs:

java.lang.IllegalStateException: AAAAAAH!
at ca.ubc.cs.beta.smac.configurator.SequentialModelBasedAlgorithmConfiguration.localSearch (SequentialModelBasedAlgorithmConfiguration.java:658)
at ca.ubc.cs.beta.smac.configurator.SequentialModelBasedAlgorithmConfiguration.selectChallengersWithEI (SequentialModelBasedAlgorithmConfiguration.java:427)
at ca.ubc.cs.beta.smac.configurator.SequentialModelBasedAlgorithmConfiguration.selectConfigurations (SequentialModelBasedAlgorithmConfiguration.java:277)
at ca.ubc.cs.beta.smac.configurator.AbstractAlgorithmFramework.run (AbstractAlgorithmFramework.java:573)
at com.cfar.swim.worldwind.managers.smac.SmacAutonomicManager.run (SmacAutonomicManager.java:659)
at com.cfar.swim.worldwind.managers.AbstractAutonomicManager.manage (AbstractAutonomicManager.java:1083)
at com.cfar.swim.worldwind.ui.world.WorldPresenter$23.run (WorldPresenter.java:1242)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
at java.lang.Thread.run (Thread.java:834)

Any help with this would be appreciated. Thanks a lot for developing SMAC!

@stephanheinemann
Copy link
Author

stephanheinemann commented Oct 8, 2021

Apparently this problem is related to the reported quality of my solutions. The quality is minimized by SMAC which led me to report 1d / quality in the ExistingAlgorithmRunResult and if there is no solution, then the quality is 0 and the solution is RunStatus.UNSAT. If I use 1000d - quality instead, I do not see this exception. However, reporting any of Double.POSITIVE_INFINITY or Double.MAX_VALUE leads reproducibly to this exception.

@stephanheinemann
Copy link
Author

stephanheinemann commented Oct 8, 2021

Thanks for looking at the code. I am aware that software has been developed several years ago but I am very happy to have
a Java implementation available. The workaround (using a fix number to subtract from, which cannot be exceeded by the quality)
apparently works fine for me. Maybe the issue is related to dividing by quality values smaller than 1 which creates a significant
quality spread between neighboring configurations. I could imagine that a large spread could be an issue for local search? Just an assumption really... If you don't mind, I would have a look at the problem in the future and possibly try to find a solution. Would you be ok with me releasing the current version to Maven central for better dependency management in my project (including the aeatk and fastrf artifacts)? I would be releasing under my root com.uvic-cfar.swim (https://search.maven.org/search?q=com.uvic-cfar.swim). Thanks for your help!

@stephanheinemann
Copy link
Author

I would also be releasing your modified com.beust.jcommander artifact with the added @ParameterFile annotation. This has unfortunately never been merged into jcommander (cbeust/jcommander#123).

Repository owner deleted a comment from steve-r-west Oct 8, 2021
@SJrX
Copy link
Owner

SJrX commented Oct 8, 2021

I spent about 15 minutes looking at the code and it's not clear exactly when this would happen, but it did happen before or was done in reason. If you have a work around I would recommend using it. It's been a while since I (or to the best of my knowledge anyone has been using it)

I think there is also a python implementation that has kind of replaced it: https://github.com/automl/SMAC3

@SJrX
Copy link
Owner

SJrX commented Oct 8, 2021

Maybe the issue is related to dividing by quality values smaller than 1 which creates a significant
quality spread between neighboring configurations.

It's some kind of logic error. I still have the data from the ticketing system available in a db backup somewhere but I dunno if I want to dig into it. If you wanted to set a breakpoint on the exception you might be able to get an idea of what is happening. It might be that one of the values is just some odd value in float arithmetic and a comparison doesn't work or something.

Would you be ok with me releasing the current version to Maven central for better dependency management in my project (including the aeatk and fastrf artifacts)? I would be releasing under my root com.uvic-cfar.swim (https://search.maven.org/search?q=com.uvic-cfar.swim). Thanks for your help!

I personally have no objection, although I don't know if I have the moral authority to give it my blessing, especially fastrf which I basically had very little to due with. I suspect no one else really cares though. From a legal standpoint all three are presumably under AGPLv3, for v2.10.03 only, so I think you certainly think legally you can do it and I won't object and I think everyone else has forgotten about it :) Previous versions are only free for academic and non-commercial usage. I think you need to make sure that the licensing is preserved.

would also be releasing your modified com.beust.jcommander artifact with the added @ParameterFile annotation. This has unfortunately never been merged into jcommander

Yup go nuts, and good luck, and you can try and ping me if you are stuck with anything else.

@SJrX
Copy link
Owner

SJrX commented Oct 8, 2021

If you do want to dig into it, instead of setting a break point, you could just log a few values here: https://github.com/SJrX/SMAC/blob/master/src/ca/ubc/cs/beta/smac/configurator/SequentialModelBasedAlgorithmConfiguration.java#L658 and make the exception something useful.

I'd log currentMinEI, epsilon, and min. and maybe Arrays.toString(eiVal)

@frank-hutter
Copy link
Collaborator

frank-hutter commented Oct 8, 2021 via email

@stephanheinemann
Copy link
Author

Thanks Frank, any more up-to-date version would be greatly appreciated. It was a lucky coincidence that I discovered your paper about SMAC. SMAC in fact turns out to be a very promising option for a tuner in an autonomic manager of a smart flight guidance system that tunes and selects planners according to the extracted autonomic context (planning context) features (environment, weather, traffic, airspaces etc.). Since SMAC supports tuning based on features, it just fit in perfectly.

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

3 participants