/
sparse_api.yaml
188 lines (166 loc) · 4.91 KB
/
sparse_api.yaml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
- api : add
args : (Tensor x, Tensor y)
output : Tensor(out)
kernel :
func : add_coo_coo{sparse_coo -> sparse_coo},
add_csr_csr{sparse_csr -> sparse_csr}
layout : x
backward : add_grad
- api : conv3d
args : (Tensor x, Tensor kernel, int[] paddings, int[] dilations, int[] strides, int groups, bool subm)
output : Tensor(out), Tensor(rulebook)
kernel :
func : sparse_conv3d{sparse_coo, dense -> sparse_coo, dense}
layout : x
intermediate : rulebook
backward : conv3d_grad
- api : coo_to_dense
args : (Tensor x)
output : Tensor(out)
invoke : to_dense_impl(x)
backward : coo_to_dense_grad
- api : create_sparse_coo_tensor
args : (Tensor values, Tensor indices, IntArray dense_shape)
output : Tensor(out)
kernel :
func : sparse_coo_tensor{dense, dense -> sparse_coo}
layout : values
data_type : values
backward : create_sparse_coo_tensor_grad
- api : dense_to_coo
args : (Tensor x, int64_t sparse_dim)
output : Tensor(out)
invoke : to_sparse_coo_impl(x, sparse_dim)
backward : dense_to_coo_grad
- api : divide
args : (Tensor x, Tensor y)
output : Tensor(out)
kernel :
func : divide_coo_coo{sparse_coo -> sparse_coo},
divide_csr_csr{sparse_csr -> sparse_csr}
layout : x
backward : divide_grad
- api : multiply
args : (Tensor x, Tensor y)
output : Tensor(out)
kernel :
func : multiply_coo_coo{sparse_coo -> sparse_coo},
multiply_csr_csr{sparse_csr -> sparse_csr}
layout : x
backward : multiply_grad
- api : relu
args : (Tensor x)
output : Tensor(out)
kernel :
func : sparse_coo_relu{sparse_coo -> sparse_coo},
sparse_csr_relu{sparse_csr -> sparse_csr}
layout : x
backward : relu_grad
- api : sin
args : (Tensor x)
output : Tensor(out@SparseCooTensor)
kernel :
func : sparse_coo_sin {sparse_coo -> sparse_coo},
sparse_csr_sin {sparse_csr -> sparse_csr}
layout : x
backward : sin_grad
- api : softmax
args : (Tensor x, int axis=-1)
output : Tensor(out)
kernel :
func : softmax_csr{sparse_csr -> sparse_csr}
layout : x
backward : softmax_grad
- api : sqrt
args : (Tensor x)
output : Tensor(out)
kernel :
func : sparse_coo_sqrt{sparse_coo -> sparse_coo},
sparse_csr_sqrt{sparse_csr -> sparse_csr}
layout : x
backward : sqrt_grad
- api : subtract
args : (Tensor x, Tensor y)
output : Tensor(out)
kernel :
func : subtract_coo_coo{sparse_coo -> sparse_coo},
subtract_csr_csr{sparse_csr -> sparse_csr}
layout : x
backward : subtract_grad
- api : tanh
args : (Tensor x)
output : Tensor(out)
kernel :
func : sparse_coo_tanh{sparse_coo -> sparse_coo},
sparse_csr_tanh{sparse_csr -> sparse_csr}
layout : x
backward : tanh_grad
- api : to_dense
args : (Tensor x)
output : Tensor(out)
invoke : to_dense_impl(x)
- api : to_sparse_coo
args : (Tensor x, int64_t sparse_dim)
output : Tensor(out)
invoke : to_sparse_coo_impl(x, sparse_dim)
- api : to_sparse_csr
args : (Tensor x)
output : Tensor(out)
invoke : to_sparse_csr_impl(x)
- api : values
args : (Tensor x)
output : Tensor(out)
kernel :
func : coo_values{sparse_coo -> dense},
csr_values{sparse_csr -> dense}
layout : x
backward : values_grad
- api: full_like
args : (Tensor x, Scalar value, DataType dtype=DataType::UNDEFINED)
output : Tensor(out)
kernel :
func : coo_full_like{sparse_coo -> sparse_coo},
csr_full_like{sparse_csr -> sparse_csr}
layout : x
data_type : dtype
- api: fused_attention
args : (Tensor query, Tensor key, Tensor value, Tensor sparse_mask, Tensor key_padding_mask, Tensor attn_mask)
output : Tensor(out), Tensor(softmax)
kernel :
func : fused_attention_csr{dense, dense, dense, sparse_csr, dense, dense -> dense, sparse_csr}
layout : sparse_mask
intermediate : softmax
backward: fused_attention_grad
- api: masked_matmul
args : (Tensor x, Tensor y, Tensor mask)
output : Tensor(out)
kernel :
func : csr_masked_matmul{dense, dense, sparse_csr -> sparse_csr}
layout : x
backward: masked_matmul_grad
- api: matmul
args : (Tensor x, Tensor y)
output : Tensor(out)
kernel :
func : csr_dense_matmul{sparse_csr, dense -> dense},
csr_csr_matmul{sparse_csr, sparse_csr -> sparse_csr},
coo_dense_matmul{sparse_coo, dense -> dense},
coo_coo_matmul{sparse_coo, sparse_coo -> sparse_coo}
layout : x
backward: matmul_grad
- api: maxpool
args : (Tensor x, int[] kernel_sizes, int[] paddings, int[] dilations, int[] strides)
output : Tensor(out), Tensor(rulebook)
kernel :
func : sparse_maxpool{sparse_coo -> sparse_coo, dense}
layout : x
intermediate : rulebook
backward : sparse_maxpool_grad
- api: mv
args : (Tensor x, Tensor vec)
output : Tensor(out)
kernel :
func : mv_coo{sparse_coo, dense -> dense},
mv_csr{sparse_csr, dense -> dense}
layout : x
backward: mv_grad