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

Add config file schema #1352

Closed
adamjstewart opened this issue May 20, 2023 · 2 comments · Fixed by #1559
Closed

Add config file schema #1352

adamjstewart opened this issue May 20, 2023 · 2 comments · Fixed by #1559
Assignees
Labels
scripts Training and evaluation scripts
Milestone

Comments

@adamjstewart
Copy link
Collaborator

Summary

We should add a schema for our config files.

Rationale

We recently changed our config file layout. However, all old scripts continue to run without error, even though most of the keys are being ignored. We should enforce valid config files to avoid this issue.

Implementation

Hydra has a way to do this: https://hydra.cc/docs/tutorials/structured_config/schema/

The tricky part is keys like pl.Trainer where the valid keys change frequently and we don't have easy access to them. We'll have to see if we can ignore them and let the object instantiation handle that. Maybe we only validate the top-level keys and skip all objects?

Alternatives

No response

Additional information

No response

@adamjstewart adamjstewart added the scripts Training and evaluation scripts label May 20, 2023
@mayeroa
Copy link

mayeroa commented May 30, 2023

Hi,

This is a great idea. Enforcing the config to be validated against some schema may help to reduce some errors.
I would also recommend using https://github.com/mit-ll-responsible-ai/hydra-zen which may help to handle dynamic creation of structured configs and reduce boilerplate. It could be an option as well. :)

@adamjstewart
Copy link
Collaborator Author

It isn't clear to me what hydra-zen offers. It seems like their goal is removing YAML files. But we already support both YAML and CLI and same hyperparameters.

@adamjstewart adamjstewart self-assigned this Sep 6, 2023
@adamjstewart adamjstewart added this to the 0.5.0 milestone Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scripts Training and evaluation scripts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants