ai2_kit.workflow.cll_mlp module

ai2_kit.workflow.cll_mlp module#

class ai2_kit.workflow.cll_mlp.CllWorkflowConfig(*, executors: Dict[str, CllWorkflowExecutorConfig], artifacts: Mapping[str, Artifact], workflow: Any)[source]#

Bases: BaseModel

artifacts: Mapping[str, Artifact]#
executors: Dict[str, CllWorkflowExecutorConfig]#
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]] = {'artifacts': FieldInfo(annotation=Mapping[str, ai2_kit.core.artifact.Artifact], required=True), 'executors': FieldInfo(annotation=Dict[str, ai2_kit.workflow.cll_mlp.CllWorkflowExecutorConfig], 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.cll_mlp.CllWorkflowExecutorConfig(*, ssh: Optional[SshConfig] = None, queue_system: QueueSystemConfig, work_dir: str, python_cmd: str = 'python', context: Context)[source]#

Bases: BaseExecutorConfig

class Context(*, train: Train, explore: Explore, label: Label)[source]#

Bases: BaseModel

class Explore(*, lammps: Optional[CllLammpsContextConfig] = None, lasp: Optional[CllLaspContextConfig] = None, anyware: Optional[AnywareContextConfig] = None)[source]#

Bases: BaseModel

anyware: Optional[AnywareContextConfig]#
lammps: Optional[CllLammpsContextConfig]#
lasp: Optional[CllLaspContextConfig]#
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]] = {'anyware': FieldInfo(annotation=Union[AnywareContextConfig, NoneType], required=False, default=None), 'lammps': FieldInfo(annotation=Union[CllLammpsContextConfig, NoneType], required=False, default=None), 'lasp': FieldInfo(annotation=Union[CllLaspContextConfig, NoneType], required=False, default=None)}#

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 Label(*, cp2k: Optional[CllCp2kContextConfig] = None, vasp: Optional[CllVaspContextConfig] = None)[source]#

Bases: BaseModel

cp2k: Optional[CllCp2kContextConfig]#
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]] = {'cp2k': FieldInfo(annotation=Union[CllCp2kContextConfig, NoneType], required=False, default=None), 'vasp': FieldInfo(annotation=Union[CllVaspContextConfig, NoneType], required=False, default=None)}#

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

This replaces Model.__fields__ from Pydantic V1.

vasp: Optional[CllVaspContextConfig]#
class Train(*, deepmd: CllDeepmdContextConfig)[source]#

Bases: BaseModel

deepmd: CllDeepmdContextConfig#
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]] = {'deepmd': FieldInfo(annotation=CllDeepmdContextConfig, 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.

explore: Explore#
label: Label#
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]] = {'explore': FieldInfo(annotation=CllWorkflowExecutorConfig.Context.Explore, required=True), 'label': FieldInfo(annotation=CllWorkflowExecutorConfig.Context.Label, required=True), 'train': FieldInfo(annotation=CllWorkflowExecutorConfig.Context.Train, 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.

train: Train#
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=CllWorkflowExecutorConfig.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.cll_mlp.SharedVars(dp_modifier: Optional[dict] = None, dp_sel_type: Optional[List[int]] = None)[source]#

Bases: object

dp_modifier: Optional[dict] = None#
dp_sel_type: Optional[List[int]] = None#
class ai2_kit.workflow.cll_mlp.WorkflowConfig(*, general: General, train: Train, explore: Explore, select: Select, label: Label, update: Update)[source]#

Bases: BaseModel

class Explore(*, lammps: Optional[CllLammpsInputConfig] = None, lasp: Optional[CllLaspInputConfig] = None, anyware: Optional[AnywareConfig] = None)[source]#

Bases: BaseModel

anyware: Optional[AnywareConfig]#
lammps: Optional[CllLammpsInputConfig]#
lasp: Optional[CllLaspInputConfig]#
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]] = {'anyware': FieldInfo(annotation=Union[AnywareConfig, NoneType], required=False, default=None), 'lammps': FieldInfo(annotation=Union[CllLammpsInputConfig, NoneType], required=False, default=None), 'lasp': FieldInfo(annotation=Union[CllLaspInputConfig, NoneType], required=False, default=None)}#

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 General(*, type_map: List[str], mass_map: List[float], sel_type: Optional[List[str]] = None, max_iters: int = 1, mode: Literal['default', 'dpff', 'fep-redox', 'fep-pka'] = 'default', update_explore_systems: bool = False)[source]#

Bases: BaseModel

mass_map: List[float]#
max_iters: int#
mode: Literal['default', 'dpff', 'fep-redox', 'fep-pka']#
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]] = {'mass_map': FieldInfo(annotation=List[float], required=True), 'max_iters': FieldInfo(annotation=int, required=False, default=1), 'mode': FieldInfo(annotation=Literal['default', 'dpff', 'fep-redox', 'fep-pka'], required=False, default='default'), 'sel_type': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'type_map': FieldInfo(annotation=List[str], required=True), 'update_explore_systems': FieldInfo(annotation=bool, required=False, default=False)}#

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

This replaces Model.__fields__ from Pydantic V1.

sel_type: Optional[List[str]]#
type_map: List[str]#
update_explore_systems: bool#
class Label(*, cp2k: Optional[CllCp2kInputConfig] = None, vasp: Optional[CllVaspInputConfig] = None)[source]#

Bases: BaseModel

cp2k: Optional[CllCp2kInputConfig]#
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]] = {'cp2k': FieldInfo(annotation=Union[CllCp2kInputConfig, NoneType], required=False, default=None), 'vasp': FieldInfo(annotation=Union[CllVaspInputConfig, NoneType], required=False, default=None)}#

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

This replaces Model.__fields__ from Pydantic V1.

vasp: Optional[CllVaspInputConfig]#
class Select(*, model_devi: CllModelDeviSelectorInputConfig)[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] = {'extra': 'forbid'}#

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

model_devi: CllModelDeviSelectorInputConfig#
model_fields: ClassVar[dict[str, FieldInfo]] = {'model_devi': 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.

class Train(*, deepmd: CllDeepmdInputConfig)[source]#

Bases: BaseModel

deepmd: CllDeepmdInputConfig#
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]] = {'deepmd': FieldInfo(annotation=CllDeepmdInputConfig, 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 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] = {'extra': 'forbid'}#

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#
explore: Explore#
general: General#
label: Label#
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]] = {'explore': FieldInfo(annotation=WorkflowConfig.Explore, required=True), 'general': FieldInfo(annotation=WorkflowConfig.General, required=True), 'label': FieldInfo(annotation=WorkflowConfig.Label, required=True), 'select': FieldInfo(annotation=WorkflowConfig.Select, required=True), 'train': FieldInfo(annotation=WorkflowConfig.Train, 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.

select: Select#
train: Train#
update: Update#
async ai2_kit.workflow.cll_mlp.cll_mlp_training_workflow(config: CllWorkflowConfig, resource_manager: ResourceManager, executor: str, path_prefix: str)[source]#
ai2_kit.workflow.cll_mlp.precondition(workflow_cfg: WorkflowConfig) SharedVars[source]#

precondition of workflow config to raise error early, and extra variables that may shared by multiple steps

The known shared variables are:

dp_modifier, which include vars sys_charge_map, model_charge_map, ewald_h, ewald_beta sel_type, which is suppose to be used in dplr/dpff mode

ai2_kit.workflow.cll_mlp.run_workflow(*config_files, executor: Optional[str] = None, path_prefix: Optional[str] = None, checkpoint: Optional[str] = None)[source]#

Run Closed-Loop Learning (CLL) workflow to train Machine Learning Potential (MLP) models.

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