-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Consider pydantic config classes #274
Comments
yea i can take this on, maybe when i have some spare time next weekend and can get into software engineering mode |
We should probably let the dust settle on the major PRs being added right now, see what their demands will be in terms of train code and modelling structure before embarking on a new config system. I don't think we've hit the tipping point yet where moving to config vs plain ol argparse makes sense, it's getting close, but no config system comes without tradeoffs. Supporting a more diverse set of train methods / tasks will quickly push to the point where we need a better system, but I'd like to see what those demands are before having yet another change in flight... |
ahh ok, yeah, I'll let you all decide what is best it is low priority for sure |
@lucidrains thinking about possible config designs, curious if you have a full example of what the pydantic based scheme would look like? Does it allow easy interaction with human readable config files (json or yaml), allow easy override / interaction with cmd line flags? Or is it closer to using something like Python dataclasses for .py based config? I've hummed and hawed much about Python config options but often end up just sticking with argparse and very basic yaml (just serialized args as dict) for config file capture. Dabbled my toes in mlcollections and hydra (or just base omega) but never entirely satisfied with any of the solutions... I feel things either get too invasive (ie hydra works its way pretty deep into your whole app and becomes hard to remove later if you're not careful), or there's always some awkwardness in the the interplay between config files vs args vs in app representation / typing / etc... |
In the past I found gin-config quite helpful for handling configs. It's based on dependency injection, and it makes it easy to edit parameters inside arbitrary functions in the code (or even overriding entire functions) inside a readable config file. Could be something to consider |
I used (and built) https://fromconfig.github.io/#/ in the past which is like hydra but less invasive and compared it with various frameworks there https://fromconfig.github.io/#/getting-started/why-fromconfig and it works but imo the main conclusion is writing python files also works declarative config is nice if it's less than 30 lines and 2 level of depth. And no macro / variable |
So some google folks had the same thought that "actually python is not so bad" and built http://fiddle.readthedocs.io/ |
Recommended by @lucidrains
The text was updated successfully, but these errors were encountered: