Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
d6e44e84
Commit
d6e44e84
authored
Mar 06, 2026
by
wooway777
Browse files
issue/1033 - fix nv lua for default backend
parent
05d05fd7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
xmake/nvidia.lua
xmake/nvidia.lua
+8
-6
No files found.
xmake/nvidia.lua
View file @
d6e44e84
...
...
@@ -145,8 +145,8 @@ target("flash-attn-nvidia")
add_links
(
"cudart"
)
add_cugencodes
(
"native"
)
if
FLASH_ATTN_ROOT
and
FLASH_ATTN_ROOT
~=
false
and
FLASH_ATTN_ROOT
~=
""
then
before_build
(
function
(
target
)
if
FLASH_ATTN_ROOT
~=
nil
then
local
TORCH_DIR
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import torch, os; print(os.path.dirname(torch.__file__))"
}):
trim
()
local
PYTHON_INCLUDE
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig; print(sysconfig.get_paths()['include'])"
}):
trim
()
local
PYTHON_LIB_DIR
=
os
.
iorunv
(
"python"
,
{
"-c"
,
"import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
}):
trim
()
...
...
@@ -163,11 +163,8 @@ target("flash-attn-nvidia")
-- Link libraries
target
:
add
(
"linkdirs"
,
TORCH_DIR
..
"/lib"
,
PYTHON_LIB_DIR
)
target
:
add
(
"links"
,
"torch"
,
"torch_cuda"
,
"torch_cpu"
,
"c10"
,
"c10_cuda"
,
"torch_python"
,
LIB_PYTHON
)
end
end
)
if
FLASH_ATTN_ROOT
~=
nil
then
add_files
(
FLASH_ATTN_ROOT
..
"/csrc/flash_attn/flash_api.cpp"
)
add_files
(
FLASH_ATTN_ROOT
..
"/csrc/flash_attn/src/*.cu"
)
...
...
@@ -179,6 +176,11 @@ target("flash-attn-nvidia")
add_cuflags
(
"-Xcompiler=-fPIC"
)
add_cuflags
(
"--forward-unknown-to-host-compiler --expt-relaxed-constexpr --use_fast_math"
,
{
force
=
true
})
set_values
(
"cuda.rdc"
,
false
)
else
-- If flash-attn is not available, just create an empty target
before_build
(
function
(
target
)
print
(
"Flash Attention not available, skipping flash-attn-nvidia build"
)
end
)
end
on_install
(
function
(
target
)
end
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment