Remove dependency from config to utils #2034
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have some code which constructs and writes out to YAML files configs which are used to queue up litgpt training jobs on remote machines. Unfortunately this code starts up really slowly because importing the
litgpt.config
submodule pulls in a ton of transitive dependencies due to itsfrom litgpt.utils import find_multiple
line (eventually torch, triton, etc. are imported). This causes as much as a 30+ second delay to any script I write that manipulates litgpt config objects.I noticed that
find_multiple
is actually only ever used inlitgpt.config
anyhow, so I was wondering if it would be okay to scoot this function over and remove the dependency fromconfig
onutils
. With this change, it is possible to write code which imports the config submodule alone and thus runs very quickly (not pulling in any of the heavy deps that current come into the Python interpreter).Is this change something y'all might be amenable to?