Skip to content

Commit

Permalink
error handling for no torch
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitan Turok committed Aug 21, 2024
1 parent d94c0e6 commit 7cffe44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import os
from pathlib import Path

import torch
from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

try:
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
except ModuleNotFoundError as e:
raise ModuleNotFoundError("No module named 'torch'. `torch` is required to install `grouped_gemm`.",) from e

if os.environ.get("TORCH_CUDA_ARCH_LIST"):
# Let PyTorch builder to choose device to target for.
Expand Down

0 comments on commit 7cffe44

Please sign in to comment.