"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "e0e9fcaa24397900aafb5366fdca1d5f3580f5f9"
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: ...@@ -35,7 +35,7 @@ You can get the FastFold source and install it with setuptools:
```shell ```shell
git clone https://github.com/hpcaitech/FastFold git clone https://github.com/hpcaitech/FastFold
cd FastFold cd FastFold
python setup.py install --cuda_ext python setup.py install
``` ```
## Usage ## Usage
......
import os import os
import subprocess import subprocess
import sys
import torch import torch
from setuptools import setup, find_packages from setuptools import setup, find_packages
...@@ -46,11 +45,6 @@ def append_nvcc_threads(nvcc_extra_args): ...@@ -46,11 +45,6 @@ def append_nvcc_threads(nvcc_extra_args):
return 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(): if not torch.cuda.is_available():
# https://github.com/NVIDIA/apex/issues/486 # 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(), # Extension builds after https://github.com/pytorch/pytorch/pull/23408 attempt to query torch.cuda.get_device_capability(),
...@@ -88,14 +82,11 @@ ext_modules = [] ...@@ -88,14 +82,11 @@ ext_modules = []
# https://github.com/pytorch/pytorch/commit/eb7b39e02f7d75c26d8a795ea8c7fd911334da7e#diff-4632522f237f1e4e728cb824300403ac # https://github.com/pytorch/pytorch/commit/eb7b39e02f7d75c26d8a795ea8c7fd911334da7e#diff-4632522f237f1e4e728cb824300403ac
version_dependent_macros = ['-DVERSION_GE_1_1', '-DVERSION_GE_1_3', '-DVERSION_GE_1_5'] version_dependent_macros = ['-DVERSION_GE_1_1', '-DVERSION_GE_1_3', '-DVERSION_GE_1_5']
if "--cuda_ext" in sys.argv: if CUDA_HOME is None:
sys.argv.remove("--cuda_ext")
if CUDA_HOME is None:
raise RuntimeError( 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) check_cuda_torch_binary_vs_bare_metal(CUDA_HOME)
def cuda_ext_helper(name, sources, extra_cuda_flags): def cuda_ext_helper(name, sources, extra_cuda_flags):
...@@ -105,7 +96,7 @@ if "--cuda_ext" in sys.argv: ...@@ -105,7 +96,7 @@ if "--cuda_ext" in sys.argv:
os.path.join('fastfold/model/kernel/cuda_native/csrc', path) for path in sources os.path.join('fastfold/model/kernel/cuda_native/csrc', path) for path in sources
], ],
include_dirs=[ 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={ extra_compile_args={
'cxx': ['-O3'] + version_dependent_macros, 'cxx': ['-O3'] + version_dependent_macros,
...@@ -136,22 +127,18 @@ if "--cuda_ext" in sys.argv: ...@@ -136,22 +127,18 @@ if "--cuda_ext" in sys.argv:
cuda_ext_helper('fastfold_softmax_cuda', ['softmax_cuda.cpp', 'softmax_cuda_kernel.cu'], cuda_ext_helper('fastfold_softmax_cuda', ['softmax_cuda.cpp', 'softmax_cuda_kernel.cu'],
extra_cuda_flags + cc_flag)) extra_cuda_flags + cc_flag))
install_requires = fetch_requirements('./requirements.txt')
setup( setup(
name='fastfold', name='fastfold',
version='0.1.0-beta', version='0.1.0-beta',
packages=find_packages(exclude=( packages=find_packages(exclude=(
'assets', 'assets',
'benchmark', 'benchmark',
'notebooks',
'scripts',
'*.egg-info', '*.egg-info',
)), )),
description= description=
'Optimizing Protein Structure Prediction Model Training and Inference on GPU Clusters', 'Optimizing Protein Structure Prediction Model Training and Inference on GPU Clusters',
ext_modules=ext_modules, ext_modules=ext_modules,
package_data={'fastfold': ['model/kernel/cuda_native/csrc/*']},
cmdclass={'build_ext': BuildExtension} if ext_modules else {}, 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