Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: workspace dir when no GPU is available (#579)
When GPU is not available (e.g., `CUDA_VISIBLE_DEVICES=-1`), `_get_cuda_arch_flags()` raises IndexError. ``` /opt/venv/lib/python3.10/site-packages/flashinfer/__init__.py:17: in <module> from .activation import ( /opt/venv/lib/python3.10/site-packages/flashinfer/activation.py:21: in <module> from .jit import ( /opt/venv/lib/python3.10/site-packages/flashinfer/jit/__init__.py:27: in <module> from .activation import ( /opt/venv/lib/python3.10/site-packages/flashinfer/jit/activation.py:19: in <module> from .env import FLASHINFER_GEN_SRC_DIR /opt/venv/lib/python3.10/site-packages/flashinfer/jit/env.py:31: in <module> FLASHINFER_WORKSPACE_DIR = _get_workspace_dir_name() /opt/venv/lib/python3.10/site-packages/flashinfer/jit/env.py:24: in _get_workspace_dir_name flags = _get_cuda_arch_flags() /opt/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py:1984: in _get_cuda_arch_flags arch_list[-1] += '+PTX' E IndexError: list index out of range ``` Although FlashInfer is not useful in this case, we still don't want to crash user program when importing flashinfer. This PR fixes this issue. Another change is to hide the warning of `TORCH_CUDA_ARCH_LIST` not set when importing flashinfer. This can be annoying when using AOT wheels.
- Loading branch information