已合并
[feat] support lstm grad a5 #8768
nextyale创建于 8月17日
[feat] support lstm grad a5 #8768
已合并
共 6 个文件变更+512-28
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | | 产品 | 是否支持 | | 5 | | 产品 | 是否支持 | |
| 6 | | :------------------------------------------------------------------------------ | :------: | | 6 | | :------------------------------------------------------------------------------ | :------: | |
| 7 | -| <term>Ascend 950PR/Ascend 950DT</term> | × | | 7 | +| <term>Ascend 950PR/Ascend 950DT</term> | √ | |
| 8 | | <term>Atlas A3 训练系列产品/Atlas A3 推理系列产品</term> | √ | | 8 | | <term>Atlas A3 训练系列产品/Atlas A3 推理系列产品</term> | √ | |
| 9 | | <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term> | √ | | 9 | | <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term> | √ | |
| 10 | | <term>Atlas 200I/500 A2 推理产品</term> | × | | 10 | | <term>Atlas 200I/500 A2 推理产品</term> | × | |
| @@ -55,89 +55,89 @@ $$ | |||
| 55 | ### 循环 $t = T - 1$ 到 $0$ | 55 | ### 循环 $t = T - 1$ 到 $0$ |
| 56 | 56 | ||
| 57 | 1. **当前隐藏状态梯度** | 57 | 1. **当前隐藏状态梯度** |
| 58 | - | 58 | + |
| 59 | $$ | 59 | $$ |
| 60 | \delta\mathbf{h}_t = \frac{\partial L_t}{\partial \mathbf{h}_t} + \delta\mathbf{h}_{\text{next}} | 60 | \delta\mathbf{h}_t = \frac{\partial L_t}{\partial \mathbf{h}_t} + \delta\mathbf{h}_{\text{next}} |
| 61 | $$ | 61 | $$ |
| 62 | 2. **当前细胞状态梯度** | 62 | 2. **当前细胞状态梯度** |
| 63 | - | 63 | + |
| 64 | $$ | 64 | $$ |
| 65 | \delta\mathbf{c}_t = \delta\mathbf{h}_t \odot \mathbf{o}_t \odot (1 - \tanh^2(\mathbf{c}_t)) + \delta\mathbf{c}_{\text{next}} \odot \mathbf{f}_{\text{next}} | 65 | \delta\mathbf{c}_t = \delta\mathbf{h}_t \odot \mathbf{o}_t \odot (1 - \tanh^2(\mathbf{c}_t)) + \delta\mathbf{c}_{\text{next}} \odot \mathbf{f}_{\text{next}} |
| 66 | $$ | 66 | $$ |
| 67 | 3. **门控梯度计算** | 67 | 3. **门控梯度计算** |
| 68 | - | 68 | + |
| 69 | $$ | 69 | $$ |
| 70 | \delta\mathbf{o}_t = \delta\mathbf{h}_t \odot \tanh(\mathbf{c}_t) \odot \mathbf{o}_t \odot (1 - \mathbf{o}_t) | 70 | \delta\mathbf{o}_t = \delta\mathbf{h}_t \odot \tanh(\mathbf{c}_t) \odot \mathbf{o}_t \odot (1 - \mathbf{o}_t) |
| 71 | $$ | 71 | $$ |
| 72 | - | 72 | + |
| 73 | $$ | 73 | $$ |
| 74 | \delta\mathbf{g}_t = \delta\mathbf{c}_t \odot \mathbf{i}_t \odot (1 - \mathbf{g}_t^2) | 74 | \delta\mathbf{g}_t = \delta\mathbf{c}_t \odot \mathbf{i}_t \odot (1 - \mathbf{g}_t^2) |
| 75 | $$ | 75 | $$ |
| 76 | - | 76 | + |
| 77 | $$ | 77 | $$ |
| 78 | \delta\mathbf{i}_t = \delta\mathbf{c}_t \odot \mathbf{g}_t \odot \mathbf{i}_t \odot (1 - \mathbf{i}_t) | 78 | \delta\mathbf{i}_t = \delta\mathbf{c}_t \odot \mathbf{g}_t \odot \mathbf{i}_t \odot (1 - \mathbf{i}_t) |
| 79 | $$ | 79 | $$ |
| 80 | - | 80 | + |
| 81 | $$ | 81 | $$ |
| 82 | \delta\mathbf{f}_t = \delta\mathbf{c}_t \odot \mathbf{c}_{t-1} \odot \mathbf{f}_t \odot (1 - \mathbf{f}_t) | 82 | \delta\mathbf{f}_t = \delta\mathbf{c}_t \odot \mathbf{c}_{t-1} \odot \mathbf{f}_t \odot (1 - \mathbf{f}_t) |
| 83 | $$ | 83 | $$ |
| 84 | 4. **参数梯度累加** | 84 | 4. **参数梯度累加** |
| 85 | - | 85 | + |
| 86 | $$ | 86 | $$ |
| 87 | \frac{\partial L}{\partial \mathbf{W}_f} \mathrel{+}= \delta\mathbf{f}_t \mathbf{z}_t^\top | 87 | \frac{\partial L}{\partial \mathbf{W}_f} \mathrel{+}= \delta\mathbf{f}_t \mathbf{z}_t^\top |
| 88 | $$ | 88 | $$ |
| 89 | - | 89 | + |
| 90 | $$ | 90 | $$ |
| 91 | \frac{\partial L}{\partial \mathbf{b}_f} \mathrel{+}= \delta\mathbf{f}_t | 91 | \frac{\partial L}{\partial \mathbf{b}_f} \mathrel{+}= \delta\mathbf{f}_t |
| 92 | $$ | 92 | $$ |
| 93 | - | 93 | + |
| 94 | $$ | 94 | $$ |
| 95 | \frac{\partial L}{\partial \mathbf{W}_i} \mathrel{+}= \delta\mathbf{i}_t \mathbf{z}_t^\top | 95 | \frac{\partial L}{\partial \mathbf{W}_i} \mathrel{+}= \delta\mathbf{i}_t \mathbf{z}_t^\top |
| 96 | $$ | 96 | $$ |
| 97 | - | 97 | + |
| 98 | $$ | 98 | $$ |
| 99 | \frac{\partial L}{\partial \mathbf{b}_i} \mathrel{+}= \delta\mathbf{i}_t | 99 | \frac{\partial L}{\partial \mathbf{b}_i} \mathrel{+}= \delta\mathbf{i}_t |
| 100 | $$ | 100 | $$ |
| 101 | - | 101 | + |
| 102 | $$ | 102 | $$ |
| 103 | \frac{\partial L}{\partial \mathbf{W}_g} \mathrel{+}= \delta\mathbf{g}_t \mathbf{z}_t^\top | 103 | \frac{\partial L}{\partial \mathbf{W}_g} \mathrel{+}= \delta\mathbf{g}_t \mathbf{z}_t^\top |
| 104 | $$ | 104 | $$ |
| 105 | - | 105 | + |
| 106 | $$ | 106 | $$ |
| 107 | \frac{\partial L}{\partial \mathbf{b}_g} \mathrel{+}= \delta\mathbf{g}_t | 107 | \frac{\partial L}{\partial \mathbf{b}_g} \mathrel{+}= \delta\mathbf{g}_t |
| 108 | $$ | 108 | $$ |
| 109 | - | 109 | + |
| 110 | $$ | 110 | $$ |
| 111 | \frac{\partial L}{\partial \mathbf{W}_o} \mathrel{+}= \delta\mathbf{o}_t \mathbf{z}_t^\top | 111 | \frac{\partial L}{\partial \mathbf{W}_o} \mathrel{+}= \delta\mathbf{o}_t \mathbf{z}_t^\top |
| 112 | $$ | 112 | $$ |
| 113 | - | 113 | + |
| 114 | $$ | 114 | $$ |
| 115 | \frac{\partial L}{\partial \mathbf{b}_o} \mathrel{+}= \delta\mathbf{o}_t | 115 | \frac{\partial L}{\partial \mathbf{b}_o} \mathrel{+}= \delta\mathbf{o}_t |
| 116 | $$ | 116 | $$ |
| 117 | 5. **传播到前一时刻** | 117 | 5. **传播到前一时刻** |
| 118 | - | 118 | + |
| 119 | $$ | 119 | $$ |
| 120 | - | 120 | + |
| 121 | \delta\mathbf{z}_t = \mathbf{W}_f^\top \delta\mathbf{f}_t + \mathbf{W}_i^\top \delta\mathbf{i}_t + \mathbf{W}_g^\top \delta\mathbf{g}_t + \mathbf{W}_o^\top \delta\mathbf{o}_t | 121 | \delta\mathbf{z}_t = \mathbf{W}_f^\top \delta\mathbf{f}_t + \mathbf{W}_i^\top \delta\mathbf{i}_t + \mathbf{W}_g^\top \delta\mathbf{g}_t + \mathbf{W}_o^\top \delta\mathbf{o}_t |
| 122 | $$ | 122 | $$ |
| 123 | - | 123 | + |
| 124 | $$ | 124 | $$ |
| 125 | \delta\mathbf{h}_{\text{prev}} = \delta\mathbf{z}_t[1:\dim(\mathbf{h}_{t-1})] | 125 | \delta\mathbf{h}_{\text{prev}} = \delta\mathbf{z}_t[1:\dim(\mathbf{h}_{t-1})] |
| 126 | $$ | 126 | $$ |
| 127 | - | 127 | + |
| 128 | $$ | 128 | $$ |
| 129 | \delta\mathbf{c}_{\text{prev}} = \delta\mathbf{c}_t \odot \mathbf{f}_t | 129 | \delta\mathbf{c}_{\text{prev}} = \delta\mathbf{c}_t \odot \mathbf{f}_t |
| 130 | $$ | 130 | $$ |
| 131 | 6. **更新传播变量** | 131 | 6. **更新传播变量** |
| 132 | - | 132 | + |
| 133 | $$ | 133 | $$ |
| 134 | \delta\mathbf{h}_{\text{next}} \leftarrow \delta\mathbf{h}_{\text{prev}} | 134 | \delta\mathbf{h}_{\text{next}} \leftarrow \delta\mathbf{h}_{\text{prev}} |
| 135 | $$ | 135 | $$ |
| 136 | - | 136 | + |
| 137 | $$ | 137 | $$ |
| 138 | \delta\mathbf{c}_{\text{next}} \leftarrow \delta\mathbf{c}_{\text{prev}} | 138 | \delta\mathbf{c}_{\text{next}} \leftarrow \delta\mathbf{c}_{\text{prev}} |
| 139 | $$ | 139 | $$ |
| 140 | - | 140 | + |
| 141 | $$ | 141 | $$ |
| 142 | \mathbf{f}_{\text{next}} \leftarrow \mathbf{f}_t | 142 | \mathbf{f}_{\text{next}} \leftarrow \mathbf{f}_t |
| 143 | $$ | 143 | $$ |
| @@ -3,7 +3,7 @@ | |||
| 3 | ## 产品支持情况 | 3 | ## 产品支持情况 |
| 4 | 4 | ||
| 5 | <!-- npu="950" id1 --> | 5 | <!-- npu="950" id1 --> |
| 6 | -- <term>Ascend 950PR/Ascend 950DT</term>:不支持 | 6 | +- <term>Ascend 950PR/Ascend 950DT</term>:支持 |
| 7 | <!-- end id1 --> | 7 | <!-- end id1 --> |
| 8 | <!-- npu="A3" id2 --> | 8 | <!-- npu="A3" id2 --> |
| 9 | - <term>Atlas A3 训练系列产品/Atlas A3 推理系列产品</term>:支持 | 9 | - <term>Atlas A3 训练系列产品/Atlas A3 推理系列产品</term>:支持 |
| @@ -0,0 +1,483 @@ | |||
| 1 | +{ | ||
| 2 | + "op_type": "SingleLayerLstmGrad", | ||
| 3 | + "op_list": [ | ||
| 4 | + { | ||
| 5 | + "bin_filename": "SingleLayerLstmGrad_fp32", | ||
| 6 | + "inputs": [ | ||
| 7 | + { | ||
| 8 | + "name": "x", | ||
| 9 | + "index": 0, | ||
| 10 | + "dtype": "float32", | ||
| 11 | + "format": "ND", | ||
| 12 | + "paramType": "required", | ||
| 13 | + "shape": [ | ||
| 14 | + -2 | ||
| 15 | + ] | ||
| 16 | + }, | ||
| 17 | + { | ||
| 18 | + "name": "w", | ||
| 19 | + "index": 1, | ||
| 20 | + "dtype": "float32", | ||
| 21 | + "format": "ND", | ||
| 22 | + "paramType": "required", | ||
| 23 | + "shape": [ | ||
| 24 | + -2 | ||
| 25 | + ] | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + "name": "b", | ||
| 29 | + "index": 2, | ||
| 30 | + "dtype": "float32", | ||
| 31 | + "format": "ND", | ||
| 32 | + "paramType": "optional", | ||
| 33 | + "shape": [ | ||
| 34 | + -2 | ||
| 35 | + ] | ||
| 36 | + }, | ||
| 37 | + { | ||
| 38 | + "name": "y", | ||
| 39 | + "index": 3, | ||
| 40 | + "dtype": "float32", | ||
| 41 | + "format": "ND", | ||
| 42 | + "paramType": "optional", | ||
| 43 | + "shape": [ | ||
| 44 | + -2 | ||
| 45 | + ] | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + "name": "init_h", | ||
| 49 | + "index": 4, | ||
| 50 | + "dtype": "float32", | ||
| 51 | + "format": "ND", | ||
| 52 | + "paramType": "required", | ||
| 53 | + "shape": [ | ||
| 54 | + -2 | ||
| 55 | + ] | ||
| 56 | + }, | ||
| 57 | + { | ||
| 58 | + "name": "init_c", | ||
| 59 | + "index": 5, | ||
| 60 | + "dtype": "float32", | ||
| 61 | + "format": "ND", | ||
| 62 | + "paramType": "required", | ||
| 63 | + "shape": [ | ||
| 64 | + -2 | ||
| 65 | + ] | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + "name": "h", | ||
| 69 | + "index": 6, | ||
| 70 | + "dtype": "float32", | ||
| 71 | + "format": "ND", | ||
| 72 | + "paramType": "required", | ||
| 73 | + "shape": [ | ||
| 74 | + -2 | ||
| 75 | + ] | ||
| 76 | + }, | ||
| 77 | + { | ||
| 78 | + "name": "c", | ||
| 79 | + "index": 7, | ||
| 80 | + "dtype": "float32", | ||
| 81 | + "format": "ND", | ||
| 82 | + "paramType": "required", | ||
| 83 | + "shape": [ | ||
| 84 | + -2 | ||
| 85 | + ] | ||
| 86 | + }, | ||
| 87 | + { | ||
| 88 | + "name": "dy", | ||
| 89 | + "index": 8, | ||
| 90 | + "dtype": "float32", | ||
| 91 | + "format": "ND", | ||
| 92 | + "paramType": "required", | ||
| 93 | + "shape": [ | ||
| 94 | + -2 | ||
| 95 | + ] | ||
| 96 | + }, | ||
| 97 | + { | ||
| 98 | + "name": "dh", | ||
| 99 | + "index": 9, | ||
| 100 | + "dtype": "float32", | ||
| 101 | + "format": "ND", | ||
| 102 | + "paramType": "required", | ||
| 103 | + "shape": [ | ||
| 104 | + -2 | ||
| 105 | + ] | ||
| 106 | + }, | ||
| 107 | + { | ||
| 108 | + "name": "dc", | ||
| 109 | + "index": 10, | ||
| 110 | + "dtype": "float32", | ||
| 111 | + "format": "ND", | ||
| 112 | + "paramType": "optional", | ||
| 113 | + "shape": [ | ||
| 114 | + -2 | ||
| 115 | + ] | ||
| 116 | + }, | ||
| 117 | + { | ||
| 118 | + "name": "i", | ||
| 119 | + "index": 11, | ||
| 120 | + "dtype": "float32", | ||
| 121 | + "format": "ND", | ||
| 122 | + "paramType": "required", | ||
| 123 | + "shape": [ | ||
| 124 | + -2 | ||
| 125 | + ] | ||
| 126 | + }, | ||
| 127 | + { | ||
| 128 | + "name": "j", | ||
| 129 | + "index": 12, | ||
| 130 | + "dtype": "float32", | ||
| 131 | + "format": "ND", | ||
| 132 | + "paramType": "required", | ||
| 133 | + "shape": [ | ||
| 134 | + -2 | ||
| 135 | + ] | ||
| 136 | + }, | ||
| 137 | + { | ||
| 138 | + "name": "f", | ||
| 139 | + "index": 13, | ||
| 140 | + "dtype": "float32", | ||
| 141 | + "format": "ND", | ||
| 142 | + "paramType": "required", | ||
| 143 | + "shape": [ | ||
| 144 | + -2 | ||
| 145 | + ] | ||
| 146 | + }, | ||
| 147 | + { | ||
| 148 | + "name": "o", | ||
| 149 | + "index": 14, | ||
| 150 | + "dtype": "float32", | ||
| 151 | + "format": "ND", | ||
| 152 | + "paramType": "required", | ||
| 153 | + "shape": [ | ||
| 154 | + -2 | ||
| 155 | + ] | ||
| 156 | + }, | ||
| 157 | + { | ||
| 158 | + "name": "tanhct", | ||
| 159 | + "index": 15, | ||
| 160 | + "dtype": "float32", | ||
| 161 | + "format": "ND", | ||
| 162 | + "paramType": "required", | ||
| 163 | + "shape": [ | ||
| 164 | + -2 | ||
| 165 | + ] | ||
| 166 | + }, | ||
| 167 | + { | ||
| 168 | + "name": "seq_length", | ||
| 169 | + "index": 16, | ||
| 170 | + "dtype": "float32", | ||
| 171 | + "format": "ND", | ||
| 172 | + "paramType": "optional", | ||
| 173 | + "shape": [ | ||
| 174 | + -2 | ||
| 175 | + ] | ||
| 176 | + } | ||
| 177 | + ], | ||
| 178 | + "outputs": [ | ||
| 179 | + { | ||
| 180 | + "name": "dw", | ||
| 181 | + "index": 0, | ||
| 182 | + "dtype": "float32", | ||
| 183 | + "format": "ND", | ||
| 184 | + "paramType": "required", | ||
| 185 | + "shape": [ | ||
| 186 | + -2 | ||
| 187 | + ] | ||
| 188 | + }, | ||
| 189 | + { | ||
| 190 | + "name": "db", | ||
| 191 | + "index": 1, | ||
| 192 | + "dtype": "float32", | ||
| 193 | + "format": "ND", | ||
| 194 | + "paramType": "required", | ||
| 195 | + "shape": [ | ||
| 196 | + -2 | ||
| 197 | + ] | ||
| 198 | + }, | ||
| 199 | + { | ||
| 200 | + "name": "dx", | ||
| 201 | + "index": 2, | ||
| 202 | + "dtype": "float32", | ||
| 203 | + "format": "ND", | ||
| 204 | + "paramType": "required", | ||
| 205 | + "shape": [ | ||
| 206 | + -2 | ||
| 207 | + ] | ||
| 208 | + }, | ||
| 209 | + { | ||
| 210 | + "name": "dh_prev", | ||
| 211 | + "index": 3, | ||
| 212 | + "dtype": "float32", | ||
| 213 | + "format": "ND", | ||
| 214 | + "paramType": "required", | ||
| 215 | + "shape": [ | ||
| 216 | + -2 | ||
| 217 | + ] | ||
| 218 | + }, | ||
| 219 | + { | ||
| 220 | + "name": "dc_prev", | ||
| 221 | + "index": 4, | ||
| 222 | + "dtype": "float32", | ||
| 223 | + "format": "ND", | ||
| 224 | + "paramType": "required", | ||
| 225 | + "shape": [ | ||
| 226 | + -2 | ||
| 227 | + ] | ||
| 228 | + } | ||
| 229 | + ], | ||
| 230 | + "attrs": [ | ||
| 231 | + { | ||
| 232 | + "name": "direction", | ||
| 233 | + "dtype": "str", | ||
| 234 | + "value": "" | ||
| 235 | + }, | ||
| 236 | + { | ||
| 237 | + "name": "gate_order", | ||
| 238 | + "dtype": "str", | ||
| 239 | + "value": "" | ||
| 240 | + } | ||
| 241 | + ] | ||
| 242 | + }, | ||
| 243 | + { | ||
| 244 | + "bin_filename": "SingleLayerLstmGrad_fp16", | ||
| 245 | + "inputs": [ | ||
| 246 | + { | ||
| 247 | + "name": "x", | ||
| 248 | + "index": 0, | ||
| 249 | + "dtype": "float16", | ||
| 250 | + "format": "ND", | ||
| 251 | + "paramType": "required", | ||
| 252 | + "shape": [ | ||
| 253 | + -2 | ||
| 254 | + ] | ||
| 255 | + }, | ||
| 256 | + { | ||
| 257 | + "name": "w", | ||
| 258 | + "index": 1, | ||
| 259 | + "dtype": "float16", | ||
| 260 | + "format": "ND", | ||
| 261 | + "paramType": "required", | ||
| 262 | + "shape": [ | ||
| 263 | + -2 | ||
| 264 | + ] | ||
| 265 | + }, | ||
| 266 | + { | ||
| 267 | + "name": "b", | ||
| 268 | + "index": 2, | ||
| 269 | + "dtype": "float16", | ||
| 270 | + "format": "ND", | ||
| 271 | + "paramType": "optional", | ||
| 272 | + "shape": [ | ||
| 273 | + -2 | ||
| 274 | + ] | ||
| 275 | + }, | ||
| 276 | + { | ||
| 277 | + "name": "y", | ||
| 278 | + "index": 3, | ||
| 279 | + "dtype": "float16", | ||
| 280 | + "format": "ND", | ||
| 281 | + "paramType": "optional", | ||
| 282 | + "shape": [ | ||
| 283 | + -2 | ||
| 284 | + ] | ||
| 285 | + }, | ||
| 286 | + { | ||
| 287 | + "name": "init_h", | ||
| 288 | + "index": 4, | ||
| 289 | + "dtype": "float16", | ||
| 290 | + "format": "ND", | ||
| 291 | + "paramType": "required", | ||
| 292 | + "shape": [ | ||
| 293 | + -2 | ||
| 294 | + ] | ||
| 295 | + }, | ||
| 296 | + { | ||
| 297 | + "name": "init_c", | ||
| 298 | + "index": 5, | ||
| 299 | + "dtype": "float16", | ||
| 300 | + "format": "ND", | ||
| 301 | + "paramType": "required", | ||
| 302 | + "shape": [ | ||
| 303 | + -2 | ||
| 304 | + ] | ||
| 305 | + }, | ||
| 306 | + { | ||
| 307 | + "name": "h", | ||
| 308 | + "index": 6, | ||
| 309 | + "dtype": "float16", | ||
| 310 | + "format": "ND", | ||
| 311 | + "paramType": "required", | ||
| 312 | + "shape": [ | ||
| 313 | + -2 | ||
| 314 | + ] | ||
| 315 | + }, | ||
| 316 | + { | ||
| 317 | + "name": "c", | ||
| 318 | + "index": 7, | ||
| 319 | + "dtype": "float16", | ||
| 320 | + "format": "ND", | ||
| 321 | + "paramType": "required", | ||
| 322 | + "shape": [ | ||
| 323 | + -2 | ||
| 324 | + ] | ||
| 325 | + }, | ||
| 326 | + { | ||
| 327 | + "name": "dy", | ||
| 328 | + "index": 8, | ||
| 329 | + "dtype": "float16", | ||
| 330 | + "format": "ND", | ||
| 331 | + "paramType": "required", | ||
| 332 | + "shape": [ | ||
| 333 | + -2 | ||
| 334 | + ] | ||
| 335 | + }, | ||
| 336 | + { | ||
| 337 | + "name": "dh", | ||
| 338 | + "index": 9, | ||
| 339 | + "dtype": "float16", | ||
| 340 | + "format": "ND", | ||
| 341 | + "paramType": "required", | ||
| 342 | + "shape": [ | ||
| 343 | + -2 | ||
| 344 | + ] | ||
| 345 | + }, | ||
| 346 | + { | ||
| 347 | + "name": "dc", | ||
| 348 | + "index": 10, | ||
| 349 | + "dtype": "float16", | ||
| 350 | + "format": "ND", | ||
| 351 | + "paramType": "optional", | ||
| 352 | + "shape": [ | ||
| 353 | + -2 | ||
| 354 | + ] | ||
| 355 | + }, | ||
| 356 | + { | ||
| 357 | + "name": "i", | ||
| 358 | + "index": 11, | ||
| 359 | + "dtype": "float16", | ||
| 360 | + "format": "ND", | ||
| 361 | + "paramType": "required", | ||
| 362 | + "shape": [ | ||
| 363 | + -2 | ||
| 364 | + ] | ||
| 365 | + }, | ||
| 366 | + { | ||
| 367 | + "name": "j", | ||
| 368 | + "index": 12, | ||
| 369 | + "dtype": "float16", | ||
| 370 | + "format": "ND", | ||
| 371 | + "paramType": "required", | ||
| 372 | + "shape": [ | ||
| 373 | + -2 | ||
| 374 | + ] | ||
| 375 | + }, | ||
| 376 | + { | ||
| 377 | + "name": "f", | ||
| 378 | + "index": 13, | ||
| 379 | + "dtype": "float16", | ||
| 380 | + "format": "ND", | ||
| 381 | + "paramType": "required", | ||
| 382 | + "shape": [ | ||
| 383 | + -2 | ||
| 384 | + ] | ||
| 385 | + }, | ||
| 386 | + { | ||
| 387 | + "name": "o", | ||
| 388 | + "index": 14, | ||
| 389 | + "dtype": "float16", | ||
| 390 | + "format": "ND", | ||
| 391 | + "paramType": "required", | ||
| 392 | + "shape": [ | ||
| 393 | + -2 | ||
| 394 | + ] | ||
| 395 | + }, | ||
| 396 | + { | ||
| 397 | + "name": "tanhct", | ||
| 398 | + "index": 15, | ||
| 399 | + "dtype": "float16", | ||
| 400 | + "format": "ND", | ||
| 401 | + "paramType": "required", | ||
| 402 | + "shape": [ | ||
| 403 | + -2 | ||
| 404 | + ] | ||
| 405 | + }, | ||
| 406 | + { | ||
| 407 | + "name": "seq_length", | ||
| 408 | + "index": 16, | ||
| 409 | + "dtype": "float16", | ||
| 410 | + "format": "ND", | ||
| 411 | + "paramType": "optional", | ||
| 412 | + "shape": [ | ||
| 413 | + -2 | ||
| 414 | + ] | ||
| 415 | + } | ||
| 416 | + ], | ||
| 417 | + "outputs": [ | ||
| 418 | + { | ||
| 419 | + "name": "dw", | ||
| 420 | + "index": 0, | ||
| 421 | + "dtype": "float16", | ||
| 422 | + "format": "ND", | ||
| 423 | + "paramType": "required", | ||
| 424 | + "shape": [ | ||
| 425 | + -2 | ||
| 426 | + ] | ||
| 427 | + }, | ||
| 428 | + { | ||
| 429 | + "name": "db", | ||
| 430 | + "index": 1, | ||
| 431 | + "dtype": "float16", | ||
| 432 | + "format": "ND", | ||
| 433 | + "paramType": "required", | ||
| 434 | + "shape": [ | ||
| 435 | + -2 | ||
| 436 | + ] | ||
| 437 | + }, | ||
| 438 | + { | ||
| 439 | + "name": "dx", | ||
| 440 | + "index": 2, | ||
| 441 | + "dtype": "float16", | ||
| 442 | + "format": "ND", | ||
| 443 | + "paramType": "required", | ||
| 444 | + "shape": [ | ||
| 445 | + -2 | ||
| 446 | + ] | ||
| 447 | + }, | ||
| 448 | + { | ||
| 449 | + "name": "dh_prev", | ||
| 450 | + "index": 3, | ||
| 451 | + "dtype": "float16", | ||
| 452 | + "format": "ND", | ||
| 453 | + "paramType": "required", | ||
| 454 | + "shape": [ | ||
| 455 | + -2 | ||
| 456 | + ] | ||
| 457 | + }, | ||
| 458 | + { | ||
| 459 | + "name": "dc_prev", | ||
| 460 | + "index": 4, | ||
| 461 | + "dtype": "float16", | ||
| 462 | + "format": "ND", | ||
| 463 | + "paramType": "required", | ||
| 464 | + "shape": [ | ||
| 465 | + -2 | ||
| 466 | + ] | ||
| 467 | + } | ||
| 468 | + ], | ||
| 469 | + "attrs": [ | ||
| 470 | + { | ||
| 471 | + "name": "direction", | ||
| 472 | + "dtype": "str", | ||
| 473 | + "value": "" | ||
| 474 | + }, | ||
| 475 | + { | ||
| 476 | + "name": "gate_order", | ||
| 477 | + "dtype": "str", | ||
| 478 | + "value": "" | ||
| 479 | + } | ||
| 480 | + ] | ||
| 481 | + } | ||
| 482 | + ] | ||
| 483 | +} | ||
| @@ -137,8 +137,9 @@ public: | |||
| 137 | aicore_config.DynamicCompileStaticFlag(true).DynamicRankSupportFlag(true).DynamicShapeSupportFlag(true); | 137 | aicore_config.DynamicCompileStaticFlag(true).DynamicRankSupportFlag(true).DynamicShapeSupportFlag(true); |
| 138 | this->AICore().AddConfig("ascend910b"); | 138 | this->AICore().AddConfig("ascend910b"); |
| 139 | this->AICore().AddConfig("ascend910_93"); | 139 | this->AICore().AddConfig("ascend910_93"); |
| 140 | + this->AICore().AddConfig("ascend950"); | ||
| 140 | } | 141 | } |
| 141 | }; | 142 | }; |
| 142 | 143 | ||
| 143 | OP_ADD(SingleLayerLstmGrad); | 144 | OP_ADD(SingleLayerLstmGrad); |
| 144 | -} // namespace ops | 145 | +} // namespace ops |
| @@ -1,13 +1,13 @@ | |||
| 1 | # ---------------------------------------------------------------------------- | 1 | # ---------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2026 Huawei Technologies Co., Ltd. | 2 | # Copyright (c) 2026 Huawei Technologies Co., Ltd. |
| 3 | -# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | # CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | # CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | # Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | # Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | -# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | # INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | # INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | # See LICENSE in the root of the software repository for the full text of the License. | 8 | # See LICENSE in the root of the software repository for the full text of the License. |
| 9 | # ---------------------------------------------------------------------------- | 9 | # ---------------------------------------------------------------------------- |
| 10 | 10 | ||
| 11 | add_kernel_sources( | 11 | add_kernel_sources( |
| 12 | - COMPUTE_UNITS ascend910b ascend910_93 | 12 | + COMPUTE_UNITS ascend910b ascend910_93 ascend950 |
| 13 | ) | 13 | ) |
| @@ -663,7 +663,7 @@ | |||
| 663 | {"name": "SortedSparseSegmentMeanGrad", "compute_units": ["ascend950"], "auto_sync": false, "impl_mode": "", "compile_options": {"ascend950": ["--cce-no-dcache-flush"]}}, | 663 | {"name": "SortedSparseSegmentMeanGrad", "compute_units": ["ascend950"], "auto_sync": false, "impl_mode": "", "compile_options": {"ascend950": ["--cce-no-dcache-flush"]}}, |
| 664 | {"name":"QuantMax", "compute_units": ["ascend950"], "auto_sync": false}, | 664 | {"name":"QuantMax", "compute_units": ["ascend950"], "auto_sync": false}, |
| 665 | {"name": "GLU", "compute_units": ["ascend950", "ascend910b", "ascend910_93"], "auto_sync": false, "impl_mode": "", "compile_options": {"ascend950": ["-mllvm -cce-aicore-dcci-before-kernel-end=false"]}}, | 665 | {"name": "GLU", "compute_units": ["ascend950", "ascend910b", "ascend910_93"], "auto_sync": false, "impl_mode": "", "compile_options": {"ascend950": ["-mllvm -cce-aicore-dcci-before-kernel-end=false"]}}, |
| 666 | - {"name":"SingleLayerLstmGrad", "compute_units": ["ascend910b", "ascend910_93"], "auto_sync" : true}, | 666 | + {"name":"SingleLayerLstmGrad", "compute_units": ["ascend910b", "ascend910_93", "ascend950"], "auto_sync" : true}, |
| 667 | {"name":"HardSwishGrad", "compute_units": ["ascend950"], "auto_sync" : true}, | 667 | {"name":"HardSwishGrad", "compute_units": ["ascend950"], "auto_sync" : true}, |
| 668 | {"name":"PReluGradReduce", "compute_units": ["ascend910_95"], "auto_sync" : true}, | 668 | {"name":"PReluGradReduce", "compute_units": ["ascend910_95"], "auto_sync" : true}, |
| 669 | {"name":"PReluGradUpdate", "compute_units": ["ascend910_95"], "auto_sync" : true}, | 669 | {"name":"PReluGradUpdate", "compute_units": ["ascend910_95"], "auto_sync" : true}, |


缺少docs下的aclnnLstmBackward产品支持情况更新