-
Notifications
You must be signed in to change notification settings - Fork 448
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
[Lazy RFC] Rename utils/ directory #1414
Comments
wth is this spam |
Sorry I don't mean you @ebsmothers |
+++++1 to this. but also I do want to point out the the circular dependencies largely stems from |
Some thoughts on where files can go: training
generation
config
data
utils
|
Why should we do this?
utils
means nothing.. it is not informative. What is actually in our utils folder today? A sampling:In general, when naming Python modules, we should try to find a shared purpose for all the functionality in the module. My favorite refrain is "naming is hard". But in this case, I think we can do better.
There is a clear shared purpose for all of the above "utils"..
training
. OK well there isutils/_generation.py
.. sorecipe_components
. Orframework
. Honestly idc.. all of these are better thanutils
. My actual proposal is that we should renameutils
->training
because most any training framework (which ofc we are not) still needs to support inference in some capacity anyways. But if others who are more inclined to name things have strong opinions I am open to them.Why else should we do this?
Our dependency graph. Time and time again we have some internal util we want to write (version checks on PyTorch or ao, deprecation flags for features). Such functionality should be at the bottom of our dependency tree: I should be able to gate any module import in our library on a version check if I need to. But
utils
is at the top of our dependency tree: it relies on our modules, our data folder, etc. We should assess whether we need all those dependencies (I claim we don't need all of them). But honestly this is reasonable.. if our training utilities need to know about our PEFT components, or need to define custom sharding strategies based on module types, it's expected that they will take a dependency on ourmodules
folder. The point is, this makes it impossible for us to have actual utils.Why shouldn't we do this?
Renaming
utils
is probably the most BC-breaking thing we can do. All our recipes just haveimport utils
so by changing that we'll break pretty much everything. But the longer we wait to do it (and yes, we do need to do it) the more painful it will be. Not to pick on @RdoubleA but there is absolutely no reason our deprecation flag should live under thedata/
directory (see #1286). But again, this is where we will be until we make this change. Better to rip the bandaid off sooner rather than later.The text was updated successfully, but these errors were encountered: