[Env] Reduce the size of default deps to speed up the installation.#959
Open
[Env] Reduce the size of default deps to speed up the installation.#959
Conversation
* turn off monitor in default
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements a comprehensive lazy loading strategy to optimize startup performance and manage optional dependencies. It introduces a post_import hook in the LazyLoader utility, moves heavy libraries like matplotlib, spacy, librosa, and av to optional dependency groups in pyproject.toml, and replaces direct imports with lazy alternatives across the codebase. Additionally, it refactors Ray-based deduplicators to delay actor registration, fixes regex string literals, and disables the resource monitor by default. Feedback recommends moving LazyLoader class imports to the module level for better PEP 8 compliance and consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As the title says. Move 15 default deps to other optional sets and import them with
LazyLoader.Tested on mac based on the pip source from aliyun with python 3.12,
uv, and--no-cache: