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
OpenDAS
FastFold
Commits
f44557ed
Commit
f44557ed
authored
Jul 25, 2022
by
shenggan
Browse files
refactor softmax kernel
parent
a65d5009
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
471 additions
and
137 deletions
+471
-137
fastfold/model/fastnn/kernel/cuda_native/csrc/softmax_cuda_kernel.cu
...del/fastnn/kernel/cuda_native/csrc/softmax_cuda_kernel.cu
+468
-134
setup.py
setup.py
+1
-1
tests/test_fastnn/test_softmax.py
tests/test_fastnn/test_softmax.py
+2
-2
No files found.
fastfold/model/fastnn/kernel/cuda_native/csrc/softmax_cuda_kernel.cu
View file @
f44557ed
This diff is collapsed.
Click to expand it.
setup.py
View file @
f44557ed
...
...
@@ -87,7 +87,7 @@ if CUDA_HOME is None:
"Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc."
)
else
:
check_cuda_torch_binary_vs_bare_metal
(
CUDA_HOME
)
#
check_cuda_torch_binary_vs_bare_metal(CUDA_HOME)
def
cuda_ext_helper
(
name
,
sources
,
extra_cuda_flags
):
return
CUDAExtension
(
...
...
tests/test_fastnn/test_softmax.py
View file @
f44557ed
...
...
@@ -5,11 +5,11 @@ from fastfold.model.fastnn.kernel import softmax
def
test_softmax
():
# [batch, dim]
test_shape
=
[[
64
,
64
],
[
64
,
128
],
[
64
,
129
],
[
64
,
1024
]]
test_shape
=
[[
64
,
64
],
[
64
,
128
],
[
64
,
129
],
[
64
,
2000
]]
test_dtype
=
[
torch
.
float32
,
torch
.
float16
,
torch
.
bfloat16
]
test_device
=
torch
.
device
(
"cuda"
)
tolerance_eps
=
{
torch
.
float32
:
10e-
5
,
torch
.
float16
:
10e-2
,
torch
.
bfloat16
:
10e-2
}
tolerance_eps
=
{
torch
.
float32
:
10e-
4
,
torch
.
float16
:
10e-2
,
torch
.
bfloat16
:
10e-2
}
for
shape
in
test_shape
:
for
dtype
in
test_dtype
:
...
...
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