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

Leveraging hydra-zen for auto-generated and validated Hydra configs #7

Open
rsokl opened this issue Dec 9, 2021 · 2 comments
Open

Comments

@rsokl
Copy link

rsokl commented Dec 9, 2021

Hello! Thanks for creating this repo -- it looks like it will be very useful. Hydra + PyTorch Lightning is definitely a killer one-two punch!

I wanted to bring your attention to hydra-zen, which is a library that adds functionality to Hydra and simplifies the process of writing configs. I think that this could be very handy for recipes.

Rather than hand-write YAML configs, you can auto-generate configs for objects using hydra_zen.builds. Furthermore, these config-generating functions provide strict runtime and static checking of the configs, making it trivial to validate all of recipes configs during nightly builds.

Another perk of leveraging hydra-zen is that it can make recipes less dependent on the specific directory layout of your directory structure; e.g. you could avoid having users be required to add a file specifically to torchrecipes/launcher/.

I could go on and on, but I'll leave it at that. I would be happy to provide more details, answer questions, etc. I hope that you find this to be useful 😄

Here are our docs: https://mit-ll-responsible-ai.github.io/hydra-zen/
Our code (our project is very well-tested!): https://github.com/mit-ll-responsible-ai/hydra-zen
And a quick example of using hydra-zen + PyTorch lightning: https://mit-ll-responsible-ai.github.io/hydra-zen/how_to/pytorch_lightning.html

@kandluis
Copy link
Contributor

kandluis commented Dec 9, 2021

Hi @rsokl! Thank so much for taking a look at this repo, and for the feedback you're providing! This is exactly the sort of input we're looking to get from the community as we co-develop our recipes vision with the PyTorch (and associated) communities!

@tangbinh, given you've been spending a bit of time looking into how we can further improve our integration with hydra and our config-system, if you haven't already, it might be worth taking into account hydra-zen and what that might look like if we take this approach.

From a quick glance at what @rsokl shared, it certainly appears to address at least a subset of the concerns we've heard from our Meta users regarding the existing recipes!

@rsokl
Copy link
Author

rsokl commented Dec 9, 2021

Wonderful! I think it is likely that my colleagues and I hit a lot of the same issues that you are alluding to. Using hydra-zen ended up being quite transformational in terms of removing the repetitiveness and hotspots for mistakes that made Hydra taxing for us to use at-scale across PyTorch-based projects. Ultimately it makes using Hydra more Python-centric (and a bit more intuitive), rather than requiring users to effectively learn a new DSL based on yamls.

We are finally mature enough, both in terms the stability of our code and the quality of our docs, to start putting hydra-zen on peoples' radars (you are the first we reached out to!). That being said, we have been collaborating with a core-dev from omegaconf/Hydra for a while now, to help ensure we maintain broad compatibility and synergy with Hydra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants