Skip to content
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

feature: fast initializer for conda environments #2226

Merged
merged 10 commits into from
Jan 30, 2025
Merged

Conversation

saikonen
Copy link
Collaborator

@saikonen saikonen commented Jan 24, 2025

adds a feature flag to switch between regular micromamba and a custom binary for bootstrapping of environments when executing remotely.

also adds deferring of micromamba install until the binary location is actually requested.

some benchmarking results with @pypi

@pypi(python="3.10", packages={"torch": "2.5.1"})

Time taken for fast_setup_environment: 11.00 seconds
Time taken for setup_environment: 28.31 seconds
@pypi(python="3.10", packages={"matplotlib": "3.9.2"})

Time taken for fast_setup_environment: 5.29 seconds
Time taken for setup_environment: 13.53 seconds
@pypi(python="3.11", packages={
    "seaborn": "0.12",
    "fastapi": "0.103.1",
    "scikit-learn": "1.6.1",
    }
)

Time taken for fast_setup_environment: 6.02 seconds
Time taken for setup_environment: 10.04 seconds

@saikonen saikonen requested a review from savingoyal January 24, 2025 18:54
@saikonen saikonen marked this pull request as ready for review January 27, 2025 10:34
@@ -433,6 +433,12 @@
# should result in an appreciable speedup in flow environment initialization.
CONDA_DEPENDENCY_RESOLVER = from_conf("CONDA_DEPENDENCY_RESOLVER", "conda")

# Conda Fast init binary url
CONDA_FAST_INIT_BIN_URL = from_conf("CONDA_FAST_INIT_BINARY_URL", None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove this config and introduce the path to actual binary in the install_fast_initializer method instead? also, if you can note some latency improvements in the PR, that will be great!

@savingoyal
Copy link
Collaborator

looks good! can you verify that this works with dev-gcp and dev-azure too before merging?

@savingoyal savingoyal merged commit 279a136 into master Jan 30, 2025
29 checks passed
@savingoyal savingoyal deleted the fast-env-init2 branch January 30, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants