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
ba0e5fa5
Commit
ba0e5fa5
authored
Oct 28, 2021
by
hubertlu-tw
Browse files
Hipify self_multihead_attn_bias_additive_mask.
parent
c3ec9351
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
352 additions
and
69 deletions
+352
-69
apex/contrib/csrc/multihead_attn/self_multihead_attn_bias_additive_mask_cpp.cpp
...ihead_attn/self_multihead_attn_bias_additive_mask_cpp.cpp
+4
-4
apex/contrib/csrc/multihead_attn/self_multihead_attn_bias_additive_mask_cuda.cu
...ihead_attn/self_multihead_attn_bias_additive_mask_cuda.cu
+348
-65
No files found.
apex/contrib/csrc/multihead_attn/self_multihead_attn_bias_additive_mask_cpp.cpp
View file @
ba0e5fa5
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
namespace
multihead_attn
{
namespace
multihead_attn
{
namespace
self_bias_additive_mask
{
namespace
self_bias_additive_mask
{
namespace
c
u
blas_gemmex
{
namespace
ro
cblas_gemmex
{
std
::
vector
<
torch
::
Tensor
>
fwd_cuda
(
std
::
vector
<
torch
::
Tensor
>
fwd_cuda
(
bool
use_time_mask
,
bool
use_time_mask
,
...
@@ -132,12 +132,12 @@ std::vector<torch::Tensor> bwd(
...
@@ -132,12 +132,12 @@ std::vector<torch::Tensor> bwd(
);
);
}
}
}
// end namespace c
u
blas_gemmex
}
// end namespace
ro
cblas_gemmex
}
// end namespace self
}
// end namespace self
}
// 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
::
self_bias_additive_mask
::
c
u
blas_gemmex
::
fwd
,
"Self Multihead Attention with Bias -- Forward."
);
m
.
def
(
"forward"
,
&
multihead_attn
::
self_bias_additive_mask
::
ro
cblas_gemmex
::
fwd
,
"Self Multihead Attention with Bias -- Forward."
);
m
.
def
(
"backward"
,
&
multihead_attn
::
self_bias_additive_mask
::
c
u
blas_gemmex
::
bwd
,
"Self Multihead Attention with Bias -- Backward."
);
m
.
def
(
"backward"
,
&
multihead_attn
::
self_bias_additive_mask
::
ro
cblas_gemmex
::
bwd
,
"Self Multihead Attention with Bias -- Backward."
);
}
}
apex/contrib/csrc/multihead_attn/self_multihead_attn_bias_additive_mask_cuda.cu
View file @
ba0e5fa5
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