Skip to content

Commit 7e7a9e3

Browse files
【CUDA Kernel No.9】fused_softmax_mask_grad算子Kernel修复 -part (#75538)
1 parent 7fb1efb commit 7e7a9e3

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) 2025 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.
12+
13+
#pragma once
14+
15+
#include "paddle/phi/backends/gpu/gpu_context.h"
16+
#include "paddle/phi/core/dense_tensor.h"
17+
18+
namespace phi {
19+
namespace fusion {
20+
21+
template <typename T, typename Context>
22+
void FusedSoftmaxMaskGradKernel(const Context& dev_ctx,
23+
const DenseTensor& out,
24+
const DenseTensor& out_grad,
25+
DenseTensor* x_grad);
26+
27+
} // namespace fusion
28+
} // namespace phi

paddle/phi/kernels/fusion/cpu/fused_softmax_mask_grad_kernel.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "paddle/phi/kernels/fused_softmax_mask_grad_kernel.h"
1516
#include "paddle/phi/core/kernel_registry.h"
1617
#include "paddle/phi/kernels/softmax_grad_kernel.h"
1718

paddle/phi/kernels/fusion/gpu/fused_softmax_mask_grad_kernel.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "paddle/phi/core/kernel_registry.h"
1818
#include "paddle/phi/kernels/full_kernel.h"
19+
#include "paddle/phi/kernels/fused_softmax_mask_grad_kernel.h"
1920
#include "paddle/phi/kernels/fusion/gpu/fused_softmax_mask_utils.h"
2021

2122
namespace phi {

paddle/phi/kernels/fusion/xpu/fused_softmax_mask_grad_kernel.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "paddle/phi/kernels/fused_softmax_mask_grad_kernel.h"
1516
#include "paddle/phi/core/kernel_registry.h"
1617
#include "paddle/phi/kernels/softmax_grad_kernel.h"
1718

0 commit comments

Comments
 (0)