-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
It seems that deepspeed doesn't use cuda installed in virtual environment.
To Reproduce
Steps to reproduce the behavior:
-
Remove your nvcc installed globally.
-
Create new virtual environment and activate it.
-
Install
deepspeed==0.14.2 -
Write codes below and run it.
source code
import deepspeed
error log
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/.venv/lib/python3.9/site-packages/deepspeed/__init__.py", line 25, in <module> from . import ops File "/.venv/lib/python3.9/site-packages/deepspeed/ops/__init__.py", line 15, in <module> from ..git_version_info import compatible_ops as __compatible_ops__ File "/.venv/lib/python3.9/site-packages/deepspeed/git_version_info.py", line 29, in <module> op_compatible = builder.is_compatible() File "/.venv/lib/python3.9/site-packages/deepspeed/ops/op_builder/fp_quantizer.py", line 29, in is_compatible sys_cuda_major, _ = installed_cuda_version() File "/.venv/lib/python3.9/site-packages/deepspeed/ops/op_builder/builder.py", line 50, in installed_cuda_version raise MissingCUDAException("CUDA_HOME does not exist, unable to compile CUDA op(s)") deepspeed.ops.op_builder.builder.MissingCUDAException: CUDA_HOME does not exist, unable to compile CUDA op(s)But cuda is located in virtual environment.
ls .venv/lib/python3.9/site-packages/nvidia | grep cuda cuda_cupti cuda_nvrtc cuda_runtime
Expected behavior
-
It might be better if deepspeed uses cuda installed in virtual environment.
Assume that cuda runtime is installed globally 11.6 and torch uses cuda runtime 12.1. In this case deepspeed and pytorch don't use same version of cuda. It can cause confusion.
deepspeed requires cuda installed globally and torch install cuda in virtual environment. It increases docker image size.
-
nvccmight be unnecessary to check cuda version.nvccis a compiler. To minimize docker images I don't want to installnvcc. But deepspeed uses it to check cuda version. We can use torch and printtorch.cuda.versionwithoutnvcc.
System info (please complete the following information):
- OS: centos 7
- GPU count and types single machine with x8 V100s each]
- Python 3.9.17