Skip to content

Commit fad434f

Browse files
[ILUVATAR_GPU] Add c_softmax_with_cross_entropy_grad_kernel (#1866)
1 parent fad3f8f commit fad434f

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- [飞桨自定义接入硬件后端(燧原GCU)](backends/gcu/README_cn.md)
2525
- [飞桨自定义接入硬件后端(太初SDAA)](backends/sdaa/README_cn.md)
2626
- [飞桨自定义接入硬件后端(沐曦METAX)](backends/metax_gpu/README_cn.md)
27+
- [飞桨自定义接入硬件后端(天数ILUVATAR)](backends/iluvatar_gpu/README_cn.md)
2728

2829
## 版权和许可证
2930

backends/iluvatar_gpu/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ file(
119119
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/c_embedding_grad_kernel.cu
120120
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/c_embedding_kernel.cu
121121
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/c_identity_kernel.cu
122+
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/c_softmax_with_cross_entropy_grad_kernel.cu
122123
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/cast_kernel.cu
123124
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/clip_grad_kernel.cu
124125
${PADDLE_SOURCE_DIR}/paddle/phi/kernels/gpu/clip_kernel.cu
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "paddle/phi/core/kernel_registry.h"
16+
#include "paddle/phi/kernels/gpu/c_softmax_with_cross_entropy_grad_kernel.cu" // NOLINT
17+
18+
PD_CUSTOM_KERNEL_REGISTER(c_softmax_with_cross_entropy_grad,
19+
iluvatar_gpu,
20+
ALL_LAYOUT,
21+
phi::CSoftmaxWithCrossEntropyGradKernel,
22+
float,
23+
phi::dtype::float16) {}

0 commit comments

Comments
 (0)