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

Adapt Makers to use pydantic models instead of yamls #307

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

Conversation

naik-aakash
Copy link
Collaborator

@naik-aakash naik-aakash commented Dec 23, 2024

Closes #305 , #329, #324 and #330

Changes

  • providing default config file arg seems redundant (Maybe remove)
  • check if MLIPFitMaker also needs this change
  • Add type checks before updating kwargs of config (use pydantic to achieve this automatically)
  • add test to ensure RssConfig custom model work as intended
  • add MLIP hypers pydantic models
  • use pydantic models instead of load yamls for defaults (adapt fitting jobs / flows)
  • Move database_dir arg back to Make see RssMaker does not work as expected #329 (comment)
  • Extend MLIP hyper parameter models where possible (Maybe MACE for now > also no typechecking for fine-tuning hypers for MACE at this point in models)
  • remove use defaults arg of MLIPFitMaker/ machine learning fit method
  • Check if nequip_fitting function can be cleaned up
  • Add hypeparameters arg to machine_learning_fit function
  • Think if value Error should be raised or a warning when unexpected kwarg gets passed for fits. (Currently I decided to raise a warning)
  • Extend M3GNET and NEQUIP hyperparameters
  • Enable fine-tuning of M3GNET models
  • Figure out missing args in RssMaker doc-strings and placement of args (need some input from @YuanbinLiu)
  • Update fine-tuning docs for MACE
  • Update RssMaker documentation to reflect changes
  • Update AIRSS install instructions
  • Changed RssConfig yaml file format to enable typechecking of mlip hyperparameters
  • Update config file example to also include defaults which have none for formatting clarity
  • Add a note to upgrade pymongo if using fireworks in documentation

@naik-aakash naik-aakash marked this pull request as draft December 23, 2024 06:26
@naik-aakash naik-aakash changed the title [WIP] load yamls using post_init > no need to copy to remote server [WIP] load user provided yamls using __post_init__ > avoids need to also have that file on remote server Dec 23, 2024
@naik-aakash naik-aakash added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 23, 2024
@naik-aakash naik-aakash self-assigned this Dec 23, 2024
@JaGeo
Copy link
Collaborator

JaGeo commented Dec 23, 2024

Shouldn't we rather do something similar to atomate2 settings?

@JaGeo
Copy link
Collaborator

JaGeo commented Dec 23, 2024

@naik-aakash
Copy link
Collaborator Author

naik-aakash commented Dec 23, 2024

Hi @JaGeo , i think both above approach we can use to load the default yamls, which I plan to do next : similar to atomate2 settings

But we would still need postinit in the maker if we expect user to provide modified yaml path (so it gets read when the flow is created) and we don't want to copy that yamls to remote cluster. Due to nature of jobflow delayed execution

@JaGeo
Copy link
Collaborator

JaGeo commented Dec 23, 2024

@naik-aakash okay! Likely pymatgen approach is th closest to what we want for defaults

@JaGeo
Copy link
Collaborator

JaGeo commented Dec 23, 2024

Another thought: post init will not work if you initialize the flow during run time

@naik-aakash naik-aakash changed the title [WIP] load user provided yamls using __post_init__ > avoids need to also have that file on remote server Load user provided yamls using __post_init__ > avoids need to also have that file on remote server Jan 8, 2025
@naik-aakash naik-aakash marked this pull request as ready for review January 8, 2025 16:38
@naik-aakash naik-aakash changed the title Load user provided yamls using __post_init__ > avoids need to also have that file on remote server [WIP] Load user provided yamls using __post_init__ > avoids need to also have that file on remote server Jan 9, 2025
@naik-aakash naik-aakash marked this pull request as draft January 9, 2025 10:37
configs/mlip_hypers.json Outdated Show resolved Hide resolved
src/autoplex/settings.py Show resolved Hide resolved
configs/mlip_hypers.json Outdated Show resolved Hide resolved
@JaGeo
Copy link
Collaborator

JaGeo commented Jan 29, 2025

@naik-aakash Great. Yes, please go ahead. And thanks @YuanbinLiu and @nfragapane !!

src/autoplex/settings.py Outdated Show resolved Hide resolved
src/autoplex/settings.py Show resolved Hide resolved
src/autoplex/settings.py Outdated Show resolved Hide resolved
src/autoplex/auto/rss/jobs.py Show resolved Hide resolved
src/autoplex/auto/rss/jobs.py Show resolved Hide resolved
@@ -603,13 +603,11 @@ def do_rss_iterations(
if include_dimer:
include_dimer = False

(mlip_path,) = do_mlip_fit.output["mlip_path"]

do_iteration = do_rss_iterations(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we keep the line as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will not work as output reference cannot be resolved outside a job but rather inside. Have now changed it in the code and it works fine now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

src/autoplex/fitting/common/flows.py Show resolved Hide resolved
@JaGeo
Copy link
Collaborator

JaGeo commented Jan 31, 2025

@naik-aakash thanks! Some of the fixes were due to my change allowing to finetue on another system than one does DFT

@naik-aakash naik-aakash added the bug Something isn't working label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better handling of user provided yaml files
5 participants