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

Add basic first version of random kahypar+ #35

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

CSNWEB
Copy link

@CSNWEB CSNWEB commented Apr 29, 2024

Based on https://github.com/ti2-group/hybrid_contraction_tree_optimizer/

Unfortunately I just realized that the RandomOptimizer does not optimize the costmod and temperature. Not sure how I missed that while going over the code. Without that the results are much worse though. I think ideally these parameters should be randomly chosen within the optimize function for each trial. For now I just hacked it over the optimize functions, which will probably lose some performance in the accelerated rust case.

@pep8speaks
Copy link

pep8speaks commented Apr 29, 2024

Hello @CSNWEB! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-05-05 00:03:57 UTC

@CSNWEB CSNWEB marked this pull request as draft April 30, 2024 10:57
@jcmgray
Copy link
Owner

jcmgray commented Apr 30, 2024

Thanks for this! Yes random sampling of costmod and temperature can be very easily added to the python and rust version, though actual optimization / tuning of the distribution they sample from a bit harder. Do you have any assessment of how good the performance is with uniform sampling?

@CSNWEB
Copy link
Author

CSNWEB commented Apr 30, 2024

The basic version I added in this PR (temperature exponential, costumed uniform), which comes from your original hyperoptimizer if I remember correctly, was very effective in my tests. It nearly always performed better in terms of best path found after x seconds than optuna or nevergrad. It definitely seems to be sufficient to find reasonably good greedy paths.

@CSNWEB CSNWEB marked this pull request as ready for review May 5, 2024 00:04
@CSNWEB
Copy link
Author

CSNWEB commented May 5, 2024

I reduced the code size quite a bit by removing all the contract tree related stuff and merging the paths directly while removing the duplicated tree traversal. Apart from the hacked in costmod and temperature tuning I am happy with the code now.

@jcmgray
Copy link
Owner

jcmgray commented May 7, 2024

Great, could you maybe add a basic test? e.g. just to the matrix in test_optimizers.py.

I'll take a look and add the costmod and temperature sampling soon.

@jcmgray
Copy link
Owner

jcmgray commented May 8, 2024

OK I've added costmod and temperature sampling now, which yes does increase the path quality quite nicely without much drawback. It's in cotengra main now and v0.1.3 of cotengrust (https://github.com/jcmgray/cotengrust/releases/tag/v0.1.3) has it enabled also.

@CSNWEB
Copy link
Author

CSNWEB commented May 14, 2024

Awesome, thanks. I will try to add some tests towards the end of the week.

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

Successfully merging this pull request may close these issues.

None yet

3 participants