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

Improved configuration #9

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Conversation

ispielma
Copy link

This includes a pretty significant change to the configuration file format, enabling grouping of parameters as well as enabling and disabling of specific parameters. The goal is to make it easy to turn on and off different options during optimization rather than keeping around a pile of similar config files.

A configuration might look like:

[COMPILATION]
mock = false

[ANALYSIS]
cost_key = ["fake_result", "y"]
maximize = true
ignore_bad = false # true
analysislib_console_log_level = 20
analysislib_file_log_level = 10
groups = ["MOT"]

[MLOOP]
num_training_runs = 5
max_num_runs_without_better_params = 10
max_num_runs = 30
trust_region = 0.05
cost_has_noise = true
no_delay = false
visualisations = false
controller_type = "gaussian_process"
console_log_level = 0

# Automatically creates the mapping to a runmanager global

[MLOOP_PARAMS.MOT.x] # this is part of the MOT group 
global_name = "x"  # << Specify the runmanager global it maps to
enable = true # This is an optional parameter that defaults to true
min = -5.0
max = 5.0
start = -2

# The mapping automatically created above by defining global_name is equivalent to

# [RUNMANAGER_GLOBALS.MOT.x] # this is part of the MOT group 
# expr = "lambda m: m"
# args = ["x"]

# Create a MLOOP parameter but define its mapping to runmanager globals later

[MLOOP_PARAMS.TEST_FUNCTION.y] # this is part of the TEST_FUNCTION group 
min = -5.0
max = 5.0
start = -2

[MLOOP_PARAMS.TEST_FUNCTION.z]  # this is part of the TEST_FUNCTION group 
min = -5.0
max = 5.0
start = -2

[RUNMANAGER_GLOBALS.TEST_FUNCTION.test_tuple]  # this is part of the TEST_FUNCTION group 
expr = "lambda x, y: (x, y)"
args = ["y", "z"]

At zakv's advice I am keeping this pull request brief, but there are several more pieces of functionality upcoming:

  1. Using a more standard import mechanism to access the analysislib_mloop tools rather than just cloning a repo (this makes distinguishing changes associated with your optimization tasks versus changes to the code base tricky). After this the lyse script will look like (this is done and a pull request will follow once this one is merged):
import lyse
import os
import analysislib.common.mloop.mloop_multishot as mloop_multishot

if __name__ == '__main__':
    # Location of config file with respect to this script
    config_file = os.path.join(os.path.dirname(__file__), "mloop_config.toml")
    mloop_multishot.run_singleshot_multishot(config_file)
  1. Keeping a predefined number of shots in the blacs queue. This is important because currently this package slows down the experimental cycle time which in my case ends up changing the temperature of the experiment, which in turn modifies its performance. This one is not done because it may also require a change to m-loop proper. TBD.

Copy link
Collaborator

@zakv zakv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple minor suggestions, but overall looks good to me!

Full disclosure though I don't think I have merge permissions on this repo, so we'd need Russ to merge it if he's ok with it

README.md Outdated Show resolved Hide resolved
mloop_config.py Outdated Show resolved Hide resolved
mloop_multishot.py Outdated Show resolved Hide resolved
spielman added 4 commits January 28, 2024 16:32
@zakv
Copy link
Collaborator

zakv commented Jan 28, 2024

So it actually looks like I might have merge permissions on this repo, but I'll give Russ a chance to weigh in regardless. @rpanderson would you mind if we merged this? And are you interested in taking a look at Ian's other upcoming PRs before we merge them?

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.

3 participants