-
Notifications
You must be signed in to change notification settings - Fork 5
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
Defining generic wrapper decorators #69
Comments
Interesting! I agree this could provide major performance benefits for minimal cost - could you outline a few places this might be useful specifically? I haven't personally used this in projects but have heard good things about hydra https://hydra.cc/docs/intro/ - might be too much here I'm a bit hesitant to introduce state for config into libtilt as it can make it harder to help anyone debug things, let's move cautiously here |
The perfect example is in the circle() function to create masks or where you initialize things based on the shape, that will probably be the same many times. I will provide a list of all the functions that I have spotted next week.
Same. The closer I use is the pytorch lightning cli, that uses config files and command line arguments, but so far we don't really need a lot of config stuff, so probably we do not need something that advanced.
That is understandable. I guess that, for the moment we may just have a plain config.py that is meant to contain "constants" not to be touched. What would you think of this? |
@alisterburt these are the places where I used lru_cache. The idea is to cache everything that depends only on the image shape, as it is very unlikely that you used two different image sizes
|
I have been doing some experiments using different decorators to speed the code (e.g.,
functools.lru_cache
,torch.compile
...), and I think that we should consider a generic mechanism to let the user to optionally activate and deactivate this kind of decorators. Something like thisBy doing in that way, the programmer can choose what are the potentially useful decorators for a given function, but the user can disable those that are not useful for them.
What do you think?
Do you already have some way of defining/modifying config variables?
The text was updated successfully, but these errors were encountered: