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

Make torch an optional dependency #789

Closed
demetd opened this issue Sep 3, 2024 · 1 comment · Fixed by #790
Closed

Make torch an optional dependency #789

demetd opened this issue Sep 3, 2024 · 1 comment · Fixed by #790
Assignees
Labels
enhancement New feature or request

Comments

@demetd
Copy link

demetd commented Sep 3, 2024

Is your feature request related to a problem? Please describe.

The torch package, which is currently a required dependency for causalml, requires presence of CUDA libraries like libcublas.so.*[0-9]. This causes installation issues, especially in environments where these libraries are not pre-installed or compatible, leading to errors such as ValueError: libcublas.so.*[0-9] not found in the system path. However, within causalml, torch is only used for the Causal Effect VAE model, which relies on neural networks.

torch is also a large package, would be good to not have to install it by default.

Describe the solution you'd like
To resolve this, I propose making torch an optional dependency within causalml via pip install causalml[torch]. This would be similar to the previously implemented approach with TensorFlow in #343, where it was made optional and only installed when needed via pip install causalml[tf].

Describe alternatives you've considered

  • A workaround for envs with no GPUs is to specify the following in your Pipfile when you want to add causalml:
[[source]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu"
verify_ssl = true

torch = {version = "==2.1.2", index = "pytorch"}
@demetd
Copy link
Author

demetd commented Sep 24, 2024

Thank you for the great and super fast work on this, @jeongyoonlee! Do you have an ETA for causalml's next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants