forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MHA.h
51 lines (47 loc) · 1.02 KB
/
MHA.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <ATen/core/Tensor.h>
namespace at {
namespace native {
void run_cudnn_SDP_fprop(
int64_t b,
int64_t h,
int64_t s_q,
int64_t s_kv,
int64_t d_k,
int64_t d_v,
float scaling_factor,
bool isTraining,
bool is_causal,
double dropout_probability,
const Tensor& q,
const Tensor& k,
const Tensor& v,
const std::optional<Tensor>& attn_bias,
Tensor& softmaxstats,
Tensor& o,
Tensor& dropoutseed,
Tensor& dropoutoffset);
void run_cudnn_SDP_bprop(
int64_t b,
int64_t h,
int64_t s_q,
int64_t s_kv,
int64_t d_k,
int64_t d_v,
float scaling_factor,
bool is_causal,
float dropout_probability,
const Tensor& q,
const Tensor& k,
const Tensor& v,
const std::optional<Tensor>& attn_bias,
const Tensor& o,
const Tensor& dO,
const Tensor& softmaxstats,
Tensor& dQ,
Tensor& dK,
Tensor& dV,
const Tensor& dropoutseed,
const Tensor& dropoutoffset);
} // namespace native
} // namespace at