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
apex
Commits
8bdbb502
Commit
8bdbb502
authored
Oct 28, 2021
by
hubertlu-tw
Browse files
Hipify encdec_multihead_attn
parent
ba0e5fa5
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
427 additions
and
67 deletions
+427
-67
apex/contrib/csrc/multihead_attn/encdec_multihead_attn_cpp.cpp
...contrib/csrc/multihead_attn/encdec_multihead_attn_cpp.cpp
+4
-4
apex/contrib/csrc/multihead_attn/encdec_multihead_attn_cuda.cu
...contrib/csrc/multihead_attn/encdec_multihead_attn_cuda.cu
+423
-63
No files found.
apex/contrib/csrc/multihead_attn/encdec_multihead_attn_cpp.cpp
View file @
8bdbb502
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
multihead_attn
{
namespace
multihead_attn
{
namespace
encdec
{
namespace
encdec
{
namespace
c
u
blas_gemmex
{
namespace
ro
cblas_gemm
_
ex
{
std
::
vector
<
torch
::
Tensor
>
fwd_cuda
(
std
::
vector
<
torch
::
Tensor
>
fwd_cuda
(
bool
use_time_mask
,
bool
use_time_mask
,
...
@@ -146,11 +146,11 @@ std::vector<torch::Tensor> bwd(
...
@@ -146,11 +146,11 @@ std::vector<torch::Tensor> bwd(
);
);
}
}
}
// end namespace c
u
blas_gemmex
}
// end namespace
ro
cblas_gemm
_
ex
}
// end namespace encdec
}
// end namespace encdec
}
// end namespace multihead_attn
}
// end namespace multihead_attn
PYBIND11_MODULE
(
TORCH_EXTENSION_NAME
,
m
)
{
PYBIND11_MODULE
(
TORCH_EXTENSION_NAME
,
m
)
{
m
.
def
(
"forward"
,
&
multihead_attn
::
encdec
::
c
u
blas_gemmex
::
fwd
,
"Encdec Multihead Attention Forward."
);
m
.
def
(
"forward"
,
&
multihead_attn
::
encdec
::
ro
cblas_gemm
_
ex
::
fwd
,
"Encdec Multihead Attention Forward."
);
m
.
def
(
"backward"
,
&
multihead_attn
::
encdec
::
c
u
blas_gemmex
::
bwd
,
"Encdec Multihead Attention Backward."
);
m
.
def
(
"backward"
,
&
multihead_attn
::
encdec
::
ro
cblas_gemm
_
ex
::
bwd
,
"Encdec Multihead Attention Backward."
);
}
}
apex/contrib/csrc/multihead_attn/encdec_multihead_attn_cuda.cu
View file @
8bdbb502
This diff is collapsed.
Click to expand it.
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