Skip to content

Draft: merge optional andie backend#31

Open
konstpieper wants to merge 10 commits into
developfrom
andie-bson-dep-fix
Open

Draft: merge optional andie backend#31
konstpieper wants to merge 10 commits into
developfrom
andie-bson-dep-fix

Conversation

@konstpieper

Copy link
Copy Markdown
Contributor

Draft MR: Add ANDIE as an optional backend.

ashriva16 and others added 10 commits May 12, 2025 16:27
…int issue; added client stopping criterion when the last grid point is sampled
…emperature range 100-500K; updated temperature grid and mock intensity-temperature profile in andie_mock.py for temperature range 100-500K
Signed-off-by: Lance-Drane <Lance-Drane@users.noreply.github.com>
… script andie_general_mock.py, the caveat is that the sampling method is still hardcoded since it depends on the specific problem
Comment thread nohup.out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should be removed?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we can remove this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah *.out should also be added to .gitignore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a reason to keep andie_backend and andie_backend_general? We could just have a default parameter dict for general?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Once andie_backend_general is tested, we may remove the andie_backend option. I'm not sure if there is a need for the generalized version though.

Comment thread pyproject.toml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Lance-Drane can we move these to optional dependencies right now?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sure; I can either make a push directly to this branch which changes this, or I can make a separate branch and make a MR into this branch

Comment thread pyproject.toml
"pymongo>=4.12.1", # TODO - this is only needed for dial_service, dial_dataclass can use a simple fixture for ObjectID representation which allows it to skip this dependency
"sable @ git+https://code.ornl.gov/sable/sable.git", # TODO this references the internal repo, transition to public version
"bumps>=0.9.3", # TODO consider making an optional dependency group
"bump>=1.4.0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we need this package? https://pypi.org/project/bump/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It certainly looks like a typo for bumps to me. I'm not seeing any new code in this PR that uses bump.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Right, it is a typo from an early pip freeze and should be removed.

available_backends = [
bkend for bkend in _POSSIBLE_BACKENDS if importlib.util.find_spec(bkend) is not None
bkend for bkend in _POSSIBLE_BACKENDS
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can modify the old logic slightly from the old implementation; we should probably have a mapping of backend names to required imports. (It makes sense to call the backend andie but the old logic assumed that the name of the import package itself is andie.) I can add this change myself, either directly on this branch or in a MR targeting this branch; I would probably also include the optional dependency stuff in the same MR.

(A backend could require any number of non-stdlib packages being available, and a backend may not necessarily require any non-stdlib packages being available.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we need to call the backend andie -- essentially this is just an example of MCMC-based Bayesian inference of parameters for a fixed functional form.

I'm open to other names, but I'd consider calling this functional_form or something along those lines.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need to call the backend andie -- essentially this is just an example of MCMC-based Bayesian inference of parameters for a fixed functional form.

I'm open to other names, but I'd consider calling this functional_form or something along those lines.

functional_form is fine with me (I should not be in charge of naming things, so I am fine with whatever is decided!). I can go ahead and make a separate MR for this targeting develop, then this branch can rebase/merge into develop and add a single line to the mapping I'll generate.

),
]
kernel: Literal['rbf', 'matern', 'linear']
kernel: Literal['rbf', 'matern', 'linear', None]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Having None as the kernel is probably okay, as IIRC we are eventually going to change the API to not have the user provide this (?). However, we need to verify that nothing else breaks from doing this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I'm interpreting this correctly, it's that we currently have kernel as a required parameter, but the andie approaches don't have a kernel, so None is most appropriate.

'upper_confidence_bound_nomad',
'polymer_acl_sampler',
]
None]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this on the other hand I don't like, I think that a user should always specify a strategy to use and this should never be empty or default.

Similarly to the kernel type, I think a long-term goal (not to be tackled in this MR) is to encapsulate the user from directly selecting a backend; however, we can always add more strategy values that we accept. For the moment, we can check to make sure that the strategy/backend combination is supported in the various core functions with simple control flow branching, probably after first checking that the strategy isn't random or hypercube (since these strategies don't even use any of the backends).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My instinct is to agree with @Lance-Drane here -- I'd expect the user to always specify a strategy. The only case where I could see None being appropriate is if we just want to return the surrogate value without doing any active learning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The only case where I could see None being appropriate is if we just want to return the surrogate value without doing any active learning.

It's still probably better to give an explicit strategy name instead of relying on a user being able to parse what a "null strategy" means (on the INTERSECT side, "None" always translates to "null").

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.

5 participants