Commit cce4ec63 authored by Shenggan's avatar Shenggan
Browse files

remove cuda ext option in setup.py

parent 53143f58
......@@ -35,7 +35,7 @@ You can get the FastFold source and install it with setuptools:
```shell
git clone https://github.com/hpcaitech/FastFold
cd FastFold
python setup.py install --cuda_ext
python setup.py install
```
## Usage
......
import os
import subprocess
import sys
import torch
from setuptools import setup, find_packages
......@@ -46,11 +45,6 @@ def append_nvcc_threads(nvcc_extra_args):
return nvcc_extra_args
def fetch_requirements(path):
with open(path, 'r') as fd:
return [r.strip() for r in fd.readlines()]
if not torch.cuda.is_available():
# https://github.com/NVIDIA/apex/issues/486
# Extension builds after https://github.com/pytorch/pytorch/pull/23408 attempt to query torch.cuda.get_device_capability(),
......@@ -88,14 +82,11 @@ ext_modules = []
# https://github.com/pytorch/pytorch/commit/eb7b39e02f7d75c26d8a795ea8c7fd911334da7e#diff-4632522f237f1e4e728cb824300403ac
version_dependent_macros = ['-DVERSION_GE_1_1', '-DVERSION_GE_1_3', '-DVERSION_GE_1_5']
if "--cuda_ext" in sys.argv:
sys.argv.remove("--cuda_ext")
if CUDA_HOME is None:
if CUDA_HOME is None:
raise RuntimeError(
"--cuda_ext was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc."
"Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc."
)
else:
else:
check_cuda_torch_binary_vs_bare_metal(CUDA_HOME)
def cuda_ext_helper(name, sources, extra_cuda_flags):
......@@ -105,7 +96,7 @@ if "--cuda_ext" in sys.argv:
os.path.join('fastfold/model/kernel/cuda_native/csrc', path) for path in sources
],
include_dirs=[
os.path.join(this_dir, 'fastfold/model/kernel/cuda_native/csrc')
os.path.join(this_dir, 'fastfold/model/kernel/cuda_native/csrc/include')
],
extra_compile_args={
'cxx': ['-O3'] + version_dependent_macros,
......@@ -136,22 +127,18 @@ if "--cuda_ext" in sys.argv:
cuda_ext_helper('fastfold_softmax_cuda', ['softmax_cuda.cpp', 'softmax_cuda_kernel.cu'],
extra_cuda_flags + cc_flag))
install_requires = fetch_requirements('./requirements.txt')
setup(
name='fastfold',
version='0.1.0-beta',
packages=find_packages(exclude=(
'assets',
'benchmark',
'notebooks',
'scripts',
'*.egg-info',
)),
description=
'Optimizing Protein Structure Prediction Model Training and Inference on GPU Clusters',
ext_modules=ext_modules,
package_data={'fastfold': ['model/kernel/cuda_native/csrc/*']},
cmdclass={'build_ext': BuildExtension} if ext_modules else {},
install_requires=install_requires,
install_requires=['einops', 'colossalai'],
)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment