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

Dynamically link arguments in LightningCLI? #19858

Closed
EthanMarx opened this issue May 9, 2024 · 2 comments
Closed

Dynamically link arguments in LightningCLI? #19858

EthanMarx opened this issue May 9, 2024 · 2 comments
Labels
feature Is an improvement or enhancement lightningcli pl.cli.LightningCLI

Comments

@EthanMarx
Copy link

EthanMarx commented May 9, 2024

Description & Motivation

Is it possible to dynamically link arguments in the LightningCLI, say, depending on the module or datamodule subclass that is specified in a config file or at the command line?

Pitch

No response

Alternatives

No response

Additional context

No response

cc @Borda @carmocca @mauvilsa

@EthanMarx EthanMarx added feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers labels May 9, 2024
@carmocca carmocca added lightningcli pl.cli.LightningCLI and removed needs triage Waiting to be triaged by maintainers labels May 13, 2024
@mauvilsa
Copy link
Contributor

Maybe more details are needed, since dynamically is a rather general term. Some dynamic linking that already work:

  • When the target of a link is a parameter in a subclass, the link is only applied if the selected subclass have such parameter, otherwise the link is ignored.
  • A link can have as source an entire subclass block. And links can have a compute_fn, see link_arguments. Thus, it is possible to implement a compute_fn that depending on the selected subclass returns particular values, which would then be set to the target.

@EthanMarx
Copy link
Author

Ah. That first point is what I'm looking for! Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement lightningcli pl.cli.LightningCLI
Projects
None yet
Development

No branches or pull requests

3 participants