Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
f2c96bc2
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f2c96bc2
编写于
3月 29, 2023
作者:
S
sneaxiy
提交者:
GitHub
3月 29, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix generate_kernels.py in CUDA 12.0 (#52232)
* fix generate_kernels.py in CUDA 12.0 * fix attrs bug
上级
2e9fd5e4
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
4 deletion
+14
-4
cmake/cuda.cmake
cmake/cuda.cmake
+1
-1
paddle/phi/kernels/CMakeLists.txt
paddle/phi/kernels/CMakeLists.txt
+10
-1
paddle/phi/kernels/fusion/cutlass/memory_efficient_attention/generate_kernels.py
...on/cutlass/memory_efficient_attention/generate_kernels.py
+2
-1
python/paddle/incubate/nn/memory_efficient_attention.py
python/paddle/incubate/nn/memory_efficient_attention.py
+1
-1
未找到文件。
cmake/cuda.cmake
浏览文件 @
f2c96bc2
...
@@ -171,7 +171,7 @@ function(select_nvcc_arch_flags out_variable out_arch_bin)
...
@@ -171,7 +171,7 @@ function(select_nvcc_arch_flags out_variable out_arch_bin)
else
()
else
()
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 11.1
)
# CUDA 11.0
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 11.1
)
# CUDA 11.0
set
(
cuda_arch_bin
"80"
)
set
(
cuda_arch_bin
"80"
)
else
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0
)
# CUDA 11.1+
else
()
set
(
cuda_arch_bin
"80 86"
)
set
(
cuda_arch_bin
"80 86"
)
endif
()
endif
()
endif
()
endif
()
...
...
paddle/phi/kernels/CMakeLists.txt
浏览文件 @
f2c96bc2
...
@@ -129,7 +129,16 @@ if(WITH_CUTLASS)
...
@@ -129,7 +129,16 @@ if(WITH_CUTLASS)
COMMAND
COMMAND
${
PYTHON_EXECUTABLE
}
${
PYTHON_EXECUTABLE
}
${
PADDLE_SOURCE_DIR
}
/paddle/phi/kernels/fusion/cutlass/memory_efficient_attention/generate_kernels.py
${
PADDLE_SOURCE_DIR
}
/paddle/phi/kernels/fusion/cutlass/memory_efficient_attention/generate_kernels.py
--cuda_arch
"
${
NVCC_ARCH_BIN
}
"
)
--cuda_arch
"
${
NVCC_ARCH_BIN
}
"
RESULT_VARIABLE memory_efficient_attention_gen_res
)
if
(
NOT memory_efficient_attention_gen_res EQUAL 0
)
message
(
FATAL_ERROR
"The memory efficient attention kernel generation errors with NVCC_ARCH_BIN=
${
NVCC_ARCH_BIN
}
"
)
endif
()
file
(
GLOB cutlass_cu
"fusion/cutlass/conv2d/generated/*.cu"
file
(
GLOB cutlass_cu
"fusion/cutlass/conv2d/generated/*.cu"
"fusion/cutlass/conv2d/*.cu"
"fusion/cutlass/*.cu"
"fusion/cutlass/conv2d/*.cu"
"fusion/cutlass/*.cu"
"fusion/cutlass/memory_efficient_attention/autogen/impl/*.cu"
)
"fusion/cutlass/memory_efficient_attention/autogen/impl/*.cu"
)
...
...
paddle/phi/kernels/fusion/cutlass/memory_efficient_attention/generate_kernels.py
浏览文件 @
f2c96bc2
...
@@ -44,7 +44,7 @@ def find_arch_range(min_arch, max_arch):
...
@@ -44,7 +44,7 @@ def find_arch_range(min_arch, max_arch):
assert
min_arch
<=
max_arch
assert
min_arch
<=
max_arch
n
=
len
(
DEFAULT_ARCH
)
n
=
len
(
DEFAULT_ARCH
)
start_idx
=
0
start_idx
=
n
-
1
for
i
in
range
(
n
-
1
):
for
i
in
range
(
n
-
1
):
if
DEFAULT_ARCH
[
i
]
<=
min_arch
and
min_arch
<
DEFAULT_ARCH
[
i
+
1
]:
if
DEFAULT_ARCH
[
i
]
<=
min_arch
and
min_arch
<
DEFAULT_ARCH
[
i
+
1
]:
start_idx
=
i
start_idx
=
i
...
@@ -54,6 +54,7 @@ def find_arch_range(min_arch, max_arch):
...
@@ -54,6 +54,7 @@ def find_arch_range(min_arch, max_arch):
for
i
in
range
(
n
-
1
):
for
i
in
range
(
n
-
1
):
if
DEFAULT_ARCH
[
i
]
<=
max_arch
and
max_arch
<
DEFAULT_ARCH
[
i
+
1
]:
if
DEFAULT_ARCH
[
i
]
<=
max_arch
and
max_arch
<
DEFAULT_ARCH
[
i
+
1
]:
end_idx
=
i
+
1
end_idx
=
i
+
1
return
DEFAULT_ARCH
[
start_idx
:
end_idx
]
return
DEFAULT_ARCH
[
start_idx
:
end_idx
]
...
...
python/paddle/incubate/nn/memory_efficient_attention.py
浏览文件 @
f2c96bc2
...
@@ -134,7 +134,7 @@ def memory_efficient_attention(
...
@@ -134,7 +134,7 @@ def memory_efficient_attention(
"causal_diagonal"
:
causal_diagonal
,
"causal_diagonal"
:
causal_diagonal
,
"seqlen_k"
:
seqlen_k
,
"seqlen_k"
:
seqlen_k
,
},
},
a
rg
s
=
{
a
ttr
s
=
{
"max_seqlen_q"
:
max_seqlen_q
,
"max_seqlen_q"
:
max_seqlen_q
,
"max_seqlen_k"
:
max_seqlen_k
,
"max_seqlen_k"
:
max_seqlen_k
,
"causal"
:
causal
,
"causal"
:
causal
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录