ai2_kit.workflow.fep_mlp module

ai2_kit.workflow.fep_mlp module#

class ai2_kit.workflow.fep_mlp.FepExecutorConfig(*, ssh: Optional[SshConfig] = None, queue_system: QueueSystemConfig, work_dir: str, python_cmd: str = 'python', context: Context)[source]#

Bases: BaseExecutorConfig

class Context(*, deepmd: CllDeepmdContextConfig, lammps: CllLammpsContextConfig, cp2k: CllCp2kContextConfig)[source]#

Bases: BaseModel

cp2k: CllCp2kContextConfig#
deepmd: CllDeepmdContextConfig#
lammps: CllLammpsContextConfig#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'cp2k': FieldInfo(annotation=CllCp2kContextConfig, required=True), 'deepmd': FieldInfo(annotation=CllDeepmdContextConfig, required=True), 'lammps': FieldInfo(annotation=CllLammpsContextConfig, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

context: Context#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'context': FieldInfo(annotation=FepExecutorConfig.Context, required=True), 'python_cmd': FieldInfo(annotation=str, required=False, default='python'), 'queue_system': FieldInfo(annotation=QueueSystemConfig, required=True), 'ssh': FieldInfo(annotation=Union[SshConfig, NoneType], required=False, default=None), 'work_dir': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ai2_kit.workflow.fep_mlp.FepWorkflowConfig(*, executors: Dict[str, FepExecutorConfig], artifacts: Mapping[str, Artifact], workflow: Any)[source]#

Bases: BaseModel

artifacts: Mapping[str, Artifact]#
executors: Dict[str, FepExecutorConfig]#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'artifacts': FieldInfo(annotation=Mapping[str, ai2_kit.core.artifact.Artifact], required=True), 'executors': FieldInfo(annotation=Dict[str, ai2_kit.workflow.fep_mlp.FepExecutorConfig], required=True), 'workflow': FieldInfo(annotation=Any, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

workflow: Any#
class ai2_kit.workflow.fep_mlp.WorkflowConfig(*, general: General, neu: Branch, red: Branch, lammps: CllLammpsInputConfig, update: Update)[source]#

Bases: BaseModel

class Branch(*, deepmd: CllDeepmdInputConfig, cp2k: CllCp2kInputConfig, threshold: CllModelDeviSelectorInputConfig)[source]#

Bases: BaseModel

cp2k: CllCp2kInputConfig#
deepmd: CllDeepmdInputConfig#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'cp2k': FieldInfo(annotation=CllCp2kInputConfig, required=True), 'deepmd': FieldInfo(annotation=CllDeepmdInputConfig, required=True), 'threshold': FieldInfo(annotation=CllModelDeviSelectorInputConfig, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

threshold: CllModelDeviSelectorInputConfig#
class General(*, type_map: List[str], mass_map: List[float], max_iters: int = 10)[source]#

Bases: BaseModel

mass_map: List[float]#
max_iters: int#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'mass_map': FieldInfo(annotation=List[float], required=True), 'max_iters': FieldInfo(annotation=int, required=False, default=10), 'type_map': FieldInfo(annotation=List[str], required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

type_map: List[str]#
class Update(*, walkthrough: CllWalkthroughUpdaterInputConfig)[source]#

Bases: BaseModel

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'walkthrough': FieldInfo(annotation=CllWalkthroughUpdaterInputConfig, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

walkthrough: CllWalkthroughUpdaterInputConfig#
general: General#
lammps: CllLammpsInputConfig#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'general': FieldInfo(annotation=WorkflowConfig.General, required=True), 'lammps': FieldInfo(annotation=CllLammpsInputConfig, required=True), 'neu': FieldInfo(annotation=WorkflowConfig.Branch, required=True), 'red': FieldInfo(annotation=WorkflowConfig.Branch, required=True), 'update': FieldInfo(annotation=WorkflowConfig.Update, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

neu: Branch#
red: Branch#
update: Update#
async ai2_kit.workflow.fep_mlp.cll_mlp_training_workflow(config: FepWorkflowConfig, resource_manager: ResourceManager, executor: str, path_prefix: str)[source]#
ai2_kit.workflow.fep_mlp.run_workflow(*config_files, executor: Optional[str] = None, path_prefix: Optional[str] = None, checkpoint: Optional[str] = None)[source]#

Training ML potential for FEP

Parameters:
  • config_files – path of config files, should be yaml files, can be multiple, support glob pattern

  • executor – name of executor, should be defined in config executors section

  • path_prefix – path prefix for output

  • checkpoint – checkpoint file