[builder] reconfig op_builder for pypi install (#2314)

This commit is contained in:
Jiarui Fang
2023-01-04 16:32:32 +08:00
committed by GitHub
parent a9b27b9265
commit db6eea3583
17 changed files with 13 additions and 332 deletions

View File

@@ -25,10 +25,12 @@ def get_cuda_cc_flag() -> List:
class Builder(object):
def colossalai_src_path(self, code_path):
if os.path.isabs(code_path):
return code_path
current_file_path = Path(__file__)
if os.path.islink(current_file_path.parent):
# symbolic link
return os.path.join(current_file_path.parent.parent.absolute(), code_path)
else:
return os.path.join(Path(__file__).parent.parent.absolute(), code_path)
return os.path.join(current_file_path.parent.parent.absolute(), "colossalai", "kernel", code_path)
def get_cuda_home_include(self):
"""

View File

@@ -6,7 +6,7 @@ from .utils import append_nvcc_threads
class CPUAdamBuilder(Builder):
NAME = "cpu_adam"
BASE_DIR = "colossalai/kernel/cuda_native"
BASE_DIR = "cuda_native"
def __init__(self):
self.name = CPUAdamBuilder.NAME

View File

@@ -5,7 +5,7 @@ from .builder import Builder, get_cuda_cc_flag
class FusedOptimBuilder(Builder):
NAME = 'fused_optim'
BASE_DIR = "colossalai/kernel/cuda_native/csrc"
BASE_DIR = "cuda_native/csrc"
def __init__(self):
self.name = FusedOptimBuilder.NAME

View File

@@ -6,7 +6,7 @@ from .builder import Builder, get_cuda_cc_flag
class MOEBuilder(Builder):
def __init__(self):
self.base_dir = "colossalai/kernel/cuda_native/csrc"
self.base_dir = "cuda_native/csrc"
self.name = 'moe'
super().__init__()

View File

@@ -6,7 +6,7 @@ from .builder import Builder, get_cuda_cc_flag
class MultiHeadAttnBuilder(Builder):
def __init__(self):
self.base_dir = "colossalai/kernel/cuda_native/csrc"
self.base_dir = "cuda_native/csrc"
self.name = 'multihead_attention'
super().__init__()

View File

@@ -6,7 +6,7 @@ from .builder import Builder, get_cuda_cc_flag
class ScaledSoftmaxBuilder(Builder):
def __init__(self):
self.base_dir = "colossalai/kernel/cuda_native/csrc"
self.base_dir = "cuda_native/csrc"
self.name = 'scaled_upper_triang_masked_softmax'
super().__init__()