-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathiluvatar.lua
More file actions
109 lines (88 loc) · 3.17 KB
/
iluvatar.lua
File metadata and controls
109 lines (88 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
toolchain("iluvatar.toolchain")
set_toolset("cc" , "clang" )
set_toolset("cxx" , "clang++")
set_toolset("cu" , "clang++")
set_toolset("culd", "clang++")
set_toolset("cu-ccbin", "$(env CXX)", "$(env CC)")
toolchain_end()
rule("iluvatar.env")
add_deps("cuda.env", {order = true})
after_load(function (target)
local old = target:get("syslinks")
local new = {}
for _, link in ipairs(old) do
if link ~= "cudadevrt" then
table.insert(new, link)
end
end
if #old > #new then
target:set("syslinks", new)
local log = "cudadevrt removed, syslinks = { "
for _, link in ipairs(new) do
log = log .. link .. ", "
end
log = log:sub(0, -3) .. " }"
print(log)
end
end)
rule_end()
target("infiniop-iluvatar")
set_kind("static")
add_deps("infini-utils")
on_install(function (target) end)
set_toolchains("iluvatar.toolchain")
add_rules("iluvatar.env")
set_values("cuda.rdc", false)
add_links("cudart", "cublas", "cudnn")
set_warnings("all", "error")
add_cuflags("-Wno-error=unused-private-field")
add_cuflags("-fPIC", "-x", "ivcore", "-std=c++17", "--cuda-gpu-arch=ivcore20", {force = true})
add_culdflags("-fPIC")
add_cxflags("-fPIC")
-- set_languages("cxx17") 天数似乎不能用这个配置
add_files("../src/infiniop/devices/nvidia/*.cu", "../src/infiniop/ops/*/nvidia/*.cu")
-- 天数平台不支持部分 NVIDIA PTX 指令,AWQ 反量化改用 CUDA C++ 实现
add_files("../src/infiniop/ops/dequantize_awq/iluvatar/*.cu")
if has_config("ninetoothed") then
add_files("../build/ninetoothed/*.c", {cxflags = {"-Wno-return-type"}})
end
target_end()
target("infinirt-iluvatar")
set_kind("static")
add_deps("infini-utils")
on_install(function (target) end)
set_toolchains("iluvatar.toolchain")
add_rules("iluvatar.env")
set_values("cuda.rdc", false)
add_links("cudart")
set_warnings("all", "error")
add_cuflags("-fPIC", "-x", "ivcore", "-std=c++17", {force = true})
add_culdflags("-fPIC")
add_cxflags("-fPIC")
-- set_languages("cxx17") 天数似乎不能用这个配置
add_files("../src/infinirt/cuda/*.cu")
target_end()
target("infiniccl-iluvatar")
set_kind("static")
add_deps("infinirt")
on_install(function (target) end)
if has_config("ccl") then
set_toolchains("iluvatar.toolchain")
add_rules("iluvatar.env")
set_values("cuda.rdc", false)
add_links("cudart")
set_warnings("all", "error")
add_cuflags("-fPIC", "-x", "ivcore", "-std=c++17", {force = true})
add_culdflags("-fPIC")
add_cxflags("-fPIC")
local nccl_root = os.getenv("NCCL_ROOT")
if nccl_root then
add_includedirs(nccl_root .. "/include")
add_links(nccl_root .. "/lib/libnccl.so")
else
add_links("nccl") -- Fall back to default nccl linking
end
-- set_languages("cxx17") 天数似乎不能用这个配置
add_files("../src/infiniccl/cuda/*.cu")
end
target_end()