Skip to content

Commit

Permalink
Check for _is_cuda() in compute_num_jobs (vllm-project#3481)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnellnm authored Mar 20, 2024
1 parent fd39980 commit 9f5b645
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def compute_num_jobs(self):
except AttributeError:
num_jobs = os.cpu_count()

nvcc_cuda_version = get_nvcc_cuda_version()
if nvcc_cuda_version >= Version("11.2"):
nvcc_threads = int(os.getenv("NVCC_THREADS", 8))
num_jobs = max(1, round(num_jobs / (nvcc_threads / 4)))
else:
nvcc_threads = None
nvcc_threads = None
if _is_cuda():
nvcc_cuda_version = get_nvcc_cuda_version()
if nvcc_cuda_version >= Version("11.2"):
nvcc_threads = int(os.getenv("NVCC_THREADS", 8))
num_jobs = max(1, round(num_jobs / (nvcc_threads / 4)))

return num_jobs, nvcc_threads

Expand Down

0 comments on commit 9f5b645

Please sign in to comment.