Skip to content

Need to enhance the logic control of bundle config #4167

@Nic-Ma

Description

@Nic-Ma

Is your feature request related to a problem? Please describe.
There are 2 missing features of the logic control in bundle run script:

  1. Currently, we have key _requires_ to execute some logic before instantiation of the component, but if the component has other dependent components as args, we can't guarantee to run before the instantiation of other components.
  2. _requires_ can only run before the component, can't execute some code after the component.
    For example, can't run ddp_init before network instantiation, can't run destroy_ddp_group() after trainer.run():
"trainer": {
    "_target_": "SupervisedTrainer",
    "_requires_": ["@ddp_init", "@determinism", "@cudnn_opt"],
    "max_epochs": 100,
    "device": "@device",
    "train_data_loader": "@train#dataloader",
    "network": "@network",
    "loss_function": "@loss",
    "optimizer": "@optimizer",
    "inferer": "@train#inferer",
    "postprocessing": "@train#postprocessing",
    "key_train_metric": "@train#key_metric",
    "train_handlers": "@train#handlers",
    "amp": true
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions