【Hackathon 7th No.26】add lu_solve
api for paddle
#70078
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Operator Mechanism
PR Types
New features
Description
RFC: api_design_for_lu_solve.md
This pull request introduces a new feature to support LU solve operations in both CPU and GPU contexts. The most important changes include adding new kernel functions for LU solve and its gradient, updating symbolic shape inference, and integrating new LAPACK and cuSOLVER routines.
New kernel functions:
paddle/phi/kernels/cpu/lu_solve_kernel.cc
: AddedLuSolveKernel
function to perform LU solve operations on CPU.paddle/phi/kernels/cpu/lu_solve_grad_kernel.cc
: AddedLuSolveGradKernel
function to compute gradients for LU solve operations on CPU.paddle/phi/kernels/gpu/lu_solve_kernel.cu
: AddedLuSolveKernel
function to perform LU solve operations on GPU using cuSOLVER.paddle/phi/kernels/gpu/lu_solve_grad_kernel.cu
: AddedLuSolveGradKernel
function to compute gradients for LU solve operations on GPU.Symbolic shape inference:
paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc
: AddedLuSolveOpInferSymbolicShape
function to infer the symbolic shape for LU solve operations.paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.h
: DeclaredLuSolve
in the symbolic shape inference interface.Integration of new routines:
paddle/phi/backends/dynload/cusolver.h
: Added dynamic loading forcusolverDnSgetrs
andcusolverDnDgetrs
routines.paddle/phi/backends/dynload/lapack.h
: Added declarations and macro definitions forsgetrs_
anddgetrs_
LAPACK routines. [1] [2]InferMeta function:
paddle/phi/infermeta/ternary.cc
: AddedLuSolveInferMeta
function to infer metadata for LU solve operations.paddle/phi/infermeta/ternary.h
: DeclaredLuSolveInferMeta
function.