-
Notifications
You must be signed in to change notification settings - Fork 267
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
Make most dependencies optional #1327
Comments
I think we should keep From my perspective, I think the thing that mostly matters is to have a small number of things to install to get going with various use cases:
The thing I'm actually most worried about that would make HELM unwieldy is as the number of scenarios and metrics grows (especially with VHELM), that doing anything with a single scenario requires all the dependencies of all the scenarios (which can grow with the number of scenarios). |
It would be really great to have this. I'm finding it very difficult to sanely include the helm package in existing projects where I want it mostly as a replacement for the OpenAI python client (so I can use CRFM token quota)---there are just way too many dependency conflicts with what's already in my environment (e.g., setup.cfg specifies |
I'm planning on fixing it this month. Are there other conflicts or is it mainly torch? |
|
I've back-paddled on the PyPI splitting idea. I now think that that install extras / optional dependencies are the way to go, because:
|
Problem
Some users of crfm-helm are downloading the library only to use the CRFM proxy client. However, crfm-helm has too many dependencies because it contains all of HELM, not just the CRFM proxy client. This means that installing it takes a very long time due to downloading the dependencies. This also increases the chance of dependency conflicts (e.g. user's code uses a newer or older version of PyTorch than what HELM uses). Anecdotal feedback from a proxy client user:
Proposal
Package Splitting
We should split up HELM into three PyPI packages:
helm.common
andhelm.proxy
. It should should be a minimal number of dependencies, mostly for JSON handling and HTTP requests. CRFM proxy API users would only need to install this package.helm.services.server_service
andhelm.proxy.clients
(which is confusingly named; this is where the models are implemented, not where the CRFM proxy client API lives). This would contain both ML dependencies (e.g. Hugging Face, PyTorch) and HTTP server dependencies (e.g. Bottle). This would depend on crfm-proxy.helm.benchmark
. This would contain only ML dependencies (e.g. Hugging Face, PyTorch). This would depend on crfm-proxy and possibly crfm-proxy-server.Note that Python allows different packages under
helm
to live in different PyPI packages thanks to the namespace package functionality.Fortunately for us, the current dependency tree already allows this splitting to happen quite easily (e.g.
helm.common
mostly only depends on itself,helm.proxy
only dependshelm.common
,helm.benchmark
depends onhelm.proxy
andhelm.common
) with a few exceptions:ServerService
(which will live in crfm-proxy-server) from its interfaceService
(which will live in crfm-proxy).Package Renaming
Optionally, we could rename
helm.common
andhelm.proxy
tocrfm.common
andcrfm.proxy
in the process, if we want to reserve the HELM brand for just the benchmarking project itself.(Not) Repository Splitting
We should keep all packages in the same repository for now. The API is still experimental (i.e. semantic version v.0.x.x) and we making breaking changes fairly often. PRs will frequently need to modify more than one package. If the packages were in separate repositories, we would have to deal with version incompatibilities. If they're all in the same repository, we could simply pip install all the packages in edit mode, so we only need to ensure that the packages are compatible at the same git commit.
(Not) Install Extras
An alternative solution is to use install extras. This is more problematic than the above solution for a few reasons:
The text was updated successfully, but these errors were encountered: