Add submodule (#9385)

* add submodule

* add submodule
This commit is contained in:
risemeup1
2024-11-07 15:41:18 +08:00
committed by GitHub
parent d526be29d2
commit 140ea48e20
5 changed files with 17 additions and 13 deletions

2
.gitignore vendored
View File

@@ -131,4 +131,4 @@ dataset/
output/
# gen codes
autogen/
autogen/

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "csrc/third_party/cutlass"]
path = csrc/third_party/cutlass
url = https://github.com/NVIDIA/cutlass.git
[submodule "csrc/third_party/nlohmann_json"]
path = csrc/third_party/nlohmann_json
url = https://github.com/nlohmann/json.git

View File

@@ -17,7 +17,14 @@ import subprocess
import paddle
from paddle.utils.cpp_extension import CUDAExtension, setup
import subprocess
def update_git_submodule():
try:
subprocess.run(["git", "submodule", "update", "--init"], check=True)
except subprocess.CalledProcessError as e:
print(f"Error occurred while updating git submodule: {str(e)}")
raise
def clone_git_repo(version, repo_url, destination_path):
try:
@@ -121,18 +128,7 @@ sources += find_end_files("./gpu/append_attn/template_instantiation", ".cu")
cutlass_dir = "third_party/cutlass"
nvcc_compile_args = gencode_flags
if not os.path.exists(cutlass_dir) or not os.listdir(cutlass_dir):
if not os.path.exists(cutlass_dir):
os.makedirs(cutlass_dir)
clone_git_repo("v3.5.0", "https://github.com/NVIDIA/cutlass.git", cutlass_dir)
json_dir = "third_party/nlohmann_json"
if not os.path.exists(json_dir) or not os.listdir(json_dir):
if not os.path.exists(json_dir):
os.makedirs(json_dir)
clone_git_repo("v3.11.3", "https://github.com/nlohmann/json.git", json_dir)
update_git_submodule()
nvcc_compile_args += [
"-O3",
"-U__CUDA_NO_HALF_OPERATORS__",

1
csrc/third_party/cutlass vendored Submodule