diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc index 8d8cedf447a8b..4a4ee2ee6fc24 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc @@ -145,6 +145,26 @@ bool BceLoss_OpInferSymbolicShape( return BceLossOpInferSymbolicShape(op, infer_context); } +// bool BincountOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool BmmOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) { +// // pass +// return true; +// } + +// bool CholeskySolveOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool CtcAlignOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &input_shape = @@ -286,6 +306,12 @@ bool CrossOpInferSymbolicShape(pir::Operation *op, return true; } +// bool DotOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) { +// // pass +// return true; +// } + bool EmbeddingOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const std::vector &x_dims = @@ -378,6 +404,20 @@ bool FillDiagonalTensor_OpInferSymbolicShape( return FillDiagonalTensorOpInferSymbolicShape(op, infer_context); } +// bool FusedSoftmaxMaskOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool GridSampleOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool GatherOpInferSymbolicShape(pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &input_shape_or_data = @@ -500,6 +540,13 @@ bool GatherNdOpInferSymbolicShape( return true; } +// bool HistogramOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool IndexSampleOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const symbol::ShapeOrDataDimExprs &operand_shape_or_data = @@ -536,6 +583,20 @@ bool KronOpInferSymbolicShape(pir::Operation *op, return true; } +// bool LstsqOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) +// { +// // pass +// return true; +// } + +// bool MatrixRankTolOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool MaskedSelectOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const std::vector &out_dims = [&] { @@ -659,6 +720,27 @@ bool MatmulOpInferSymbolicShape(pir::Operation *op, return true; } +// bool PullBoxSparseOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool PullGpuPsSparseOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool PullSparseV2OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool SearchsortedOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { // The shape of output is the same as input `values` (op->operand_source(1)) @@ -670,6 +752,20 @@ bool SearchsortedOpInferSymbolicShape( return true; } +// bool SequenceMaskOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool SwigluOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool IscloseOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { // The shape of output is the same as input `values` (op->operand_source(1)) @@ -761,6 +857,55 @@ bool TopPSamplingOpInferSymbolicShape( return true; } +// bool TdmChildOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool UnpoolOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool YoloBoxOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool YoloBoxHeadOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool GammainccOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool HeavisideOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool NextafterOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + } // namespace paddle::dialect namespace cinn::dialect { diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.h b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.h index 0da35da694596..774007f51ef24 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.h +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.h @@ -22,28 +22,49 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Allclose) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Atan2) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BceLoss) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BceLoss_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Bincount) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Bmm) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(CholeskySolve) OP_DECLARE_INFER_SYMBOLIC_SHAPE(CtcAlign) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Conv2d) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Conv3d) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Cross) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Dot) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Embedding) OP_DECLARE_INFER_SYMBOLIC_SHAPE(EqualAll) OP_DECLARE_INFER_SYMBOLIC_SHAPE(SparseWeightEmbedding) OP_DECLARE_INFER_SYMBOLIC_SHAPE(ExpandAs) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FillDiagonalTensor) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FillDiagonalTensor_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(FusedSoftmaxMask) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(GridSample) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gammaincc) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gather) OP_DECLARE_INFER_SYMBOLIC_SHAPE(GatherNd) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Histogram) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Heaviside) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Isclose) OP_DECLARE_INFER_SYMBOLIC_SHAPE(AccuracyCheck) OP_DECLARE_INFER_SYMBOLIC_SHAPE(IndexSample) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Kron) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Lstsq) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MatrixRankTol) OP_DECLARE_INFER_SYMBOLIC_SHAPE(MaskedSelect) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Matmul) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Nextafter) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(PullBoxSparse) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(PullGpuPsSparse) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(PullSparseV2) OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReduceAs) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Searchsorted) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SequenceMask) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Swiglu) OP_DECLARE_INFER_SYMBOLIC_SHAPE(TakeAlongAxis) OP_DECLARE_INFER_SYMBOLIC_SHAPE(TopPSampling) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(TdmChild) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unpool) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(YoloBox) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(YoloBoxHead) } // namespace paddle::dialect diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc index fe36253d3f9d7..be5001c5c4ee6 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc @@ -228,6 +228,13 @@ bool AucOpInferSymbolicShape(pir::Operation *op, return true; } +// bool BatchFcOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool BatchNormOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &x_shape_or_data = @@ -608,11 +615,45 @@ bool BilinearOpInferSymbolicShape( return true; } +// bool AssignPosOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool BroadcastTensorsOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool BilinearInterpOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { return BicubicInterpOpInferSymbolicShape(op, infer_context); } +// bool CrfDecodingOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool CoalesceTensorOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool CoalesceTensor_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// return CoalesceTensorOpInferSymbolicShape(op, infer_context); +// } + bool CrossEntropyWithSoftmaxOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const symbol::ShapeOrDataDimExprs &input_shape = @@ -826,6 +867,47 @@ bool FlashAttnOpInferSymbolicShape( return true; } +// bool FlashAttnUnpaddedOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool FusedBatchNormActOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool FusedBnAddActivationOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool GenerateProposalsOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool GruOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) { +// // pass +// return true; +// } + +// bool GruUnitOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool GroupNormOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const symbol::ShapeOrDataDimExprs &x_shape = @@ -846,6 +928,13 @@ bool GroupNormOpInferSymbolicShape( return true; } +// bool InstanceNormOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool LerpOpInferSymbolicShape(pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &x_shape_or_data = @@ -1070,6 +1159,52 @@ bool RoiAlignOpInferSymbolicShape( return true; } +// bool LstmOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) +// { +// // pass +// return true; +// } + +// bool MergedAdamOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool MergedAdam_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// return MergedAdamOpInferSymbolicShape(op, infer_context); +// } + +// bool MergedMomentumOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool MergedMomentum_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// return MergedMomentumOpInferSymbolicShape(op, infer_context); +// } + +// bool MoeOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) { +// // pass +// return true; +// } + +// bool MulticlassNMS3OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool MeshgridOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const symbol::TensorListShapeOrDataDimExprs &shape_data_list = @@ -1102,6 +1237,33 @@ bool MeshgridOpInferSymbolicShape( return true; } +// bool NceOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) { +// // pass +// return true; +// } + +// bool PsroiPoolOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool RmsNormOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool RoiPoolOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool StackOpInferSymbolicShape(pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { pir::Value operand_source = op->operand_source(0); @@ -1170,6 +1332,40 @@ bool StackOpInferSymbolicShape(pir::Operation *op, return true; } +// bool SaveCombineOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool SigmoidCrossEntropyWithLogitsOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool SigmoidCrossEntropyWithLogits_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// return SigmoidCrossEntropyWithLogitsOpInferSymbolicShape(op, +// infer_context); +// } + +// bool SyncBatchNormOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool SyncBatchNorm_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// return SyncBatchNormOpInferSymbolicShape(op, infer_context); +// } + bool TrilinearInterpOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { return BicubicInterpOpInferSymbolicShape(op, infer_context); @@ -1231,4 +1427,18 @@ bool FakeChannelWiseDequantizeMaxAbsOpInferSymbolicShape( return true; } +// bool UpdateLossScaling_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool YoloBoxPostOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + } // namespace paddle::dialect diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.h b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.h index 6c21b3b69000a..a06c91cfde013 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.h +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.h @@ -23,31 +23,62 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Addmm) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Addmm_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(AddN) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Auc) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(AssignPos) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(BroadcastTensors) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(BatchFc) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BatchNorm) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BatchNorm_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BicubicInterp) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Bilinear) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BilinearInterp) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(CrfDecoding) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Concat) OP_DECLARE_INFER_SYMBOLIC_SHAPE(CrossEntropyWithSoftmax) OP_DECLARE_INFER_SYMBOLIC_SHAPE(CrossEntropyWithSoftmax_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(CoalesceTensor) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(CoalesceTensor_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FullWithTensor) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FlashAttn) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(FlashAttnUnpadded) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(FusedBatchNormAct) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(FusedBnAddActivation) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(GenerateProposals) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gru) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(GruUnit) OP_DECLARE_INFER_SYMBOLIC_SHAPE(GroupNorm) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(InstanceNorm) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Lerp) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Lerp_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(LayerNorm) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Linspace) OP_DECLARE_INFER_SYMBOLIC_SHAPE(LinearInterp) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Logspace) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Lstm) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MergedAdam) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MergedAdam_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MergedMomentum) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MergedMomentum_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Moe) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MulticlassNMS3) OP_DECLARE_INFER_SYMBOLIC_SHAPE(MemoryEfficientAttention) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Meshgrid) OP_DECLARE_INFER_SYMBOLIC_SHAPE(NearestInterp) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Nce) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(PsroiPool) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(RmsNorm) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(RoiPool) OP_DECLARE_INFER_SYMBOLIC_SHAPE(RoiAlign) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Stack) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SigmoidCrossEntropyWithLogits) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SigmoidCrossEntropyWithLogits_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SyncBatchNorm) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SyncBatchNorm_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SaveCombine) OP_DECLARE_INFER_SYMBOLIC_SHAPE(TrilinearInterp) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Where) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Where_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FakeChannelWiseDequantizeMaxAbs) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(UpdateLossScaling_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(YoloBoxPost) } // namespace paddle::dialect diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.cc index 611dbccf0d68b..323ad2a42ef0e 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.cc @@ -348,6 +348,13 @@ bool RandintOpInferSymbolicShape( } } +// bool ReadFileOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool TrilIndicesOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &attributes = op->attributes(); diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.h b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.h index a221eec936528..d618508e3f171 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.h +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/nullary_infer_sym.h @@ -27,6 +27,7 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Full) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FullIntArray) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gaussian) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Randint) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReadFile) OP_DECLARE_INFER_SYMBOLIC_SHAPE(TrilIndices) OP_DECLARE_INFER_SYMBOLIC_SHAPE(TriuIndices) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Uniform) diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.cc index 88aa7877ccb3c..a99f2dd7e1ae0 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.cc @@ -162,6 +162,17 @@ OP_SAME_OPERANDS_AND_RESULT(Polygamma) OP_SAME_OPERANDS_AND_RESULT(Polygamma_) OP_SAME_OPERANDS_AND_RESULT(EnableCheckModelNanInf) OP_SAME_OPERANDS_AND_RESULT(ViewShape) +OP_SAME_OPERANDS_AND_RESULT(FusedSoftmaxMaskUpperTriangle) +OP_SAME_OPERANDS_AND_RESULT(Gammaln) +OP_SAME_OPERANDS_AND_RESULT(Gammaln_) +OP_SAME_OPERANDS_AND_RESULT(GaussianInplace) +OP_SAME_OPERANDS_AND_RESULT(GaussianInplace_) +OP_SAME_OPERANDS_AND_RESULT(Hardshrink) +OP_SAME_OPERANDS_AND_RESULT(HardSigmoid) +OP_SAME_OPERANDS_AND_RESULT(MergeSelectedRows) +OP_SAME_OPERANDS_AND_RESULT(Renorm) +OP_SAME_OPERANDS_AND_RESULT(Renorm_) +OP_SAME_OPERANDS_AND_RESULT(TanhShrink) bool ScaleOpInferSymbolicShape(pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.h b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.h index d8ea8fda94947..0b171caffccb0 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.h +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/same_operands_result.h @@ -155,6 +155,17 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Polygamma) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Polygamma_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(EnableCheckModelNanInf) OP_DECLARE_INFER_SYMBOLIC_SHAPE(ViewShape) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(FusedSoftmaxMaskUpperTriangle) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gammaln) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gammaln_) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(GaussianInplace) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(GaussianInplace_) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(Hardshrink) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(HardSigmoid) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(MergeSelectedRows) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(Renorm) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(Renorm_) +OP_DECLARE_INFER_SYMBOLIC_SHAPE(TanhShrink) } // namespace paddle::dialect diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc index 36aecf07fcc73..b86f60780c783 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc @@ -85,6 +85,13 @@ std::vector GetRealPadding( return real_padding; } +// bool AffineGridOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + symbol::ShapeOrDataDimExprs Pool2dRawInferSymbolicShape( pir::Operation *op, const std::vector &kernel_size, @@ -356,6 +363,26 @@ bool AssignOpInferSymbolicShape(pir::Operation *op, return true; } +// bool AllReduceOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool AllReduce_OpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// return AllReduceOpInferSymbolicShape(op, infer_context); +// } + +// bool BarrierOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool Assign_OpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { return AssignOpInferSymbolicShape(op, infer_context); @@ -534,6 +561,27 @@ bool ChannelShuffleOpInferSymbolicShape( return true; } +// bool CropOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) +// { +// // pass +// return true; +// } + +// bool DecodeJpegOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool DiagOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) +// { +// // pass +// return true; +// } + bool DiagEmbedOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { pir::Value operand_source = op->operand_source(0); @@ -692,6 +740,20 @@ bool EigvalshOpInferSymbolicShape( return EighOpInferSymbolicShape(op, infer_context); } +// bool FractionalMaxPool2DOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool FractionalMaxPool3DOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + bool FakeChannelWiseQuantizeAbsMaxOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &x_shape_or_data = @@ -903,6 +965,12 @@ bool IdentityLossOpInferSymbolicShape( return true; } +// bool GumbelSoftmaxOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } bool IdentityLoss_OpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { @@ -1048,6 +1116,55 @@ bool MeanAllOpInferSymbolicShape( return true; } +// bool MatrixPowerOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool MatrixRankOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool MaxPool2DWithIndexOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool MaxPool3DWithIndexOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool MultinomialOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool NanmedianOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool NormOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) +// { +// // pass +// return true; +// } + bool NonzeroOpInferSymbolicShape( pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { const auto &x_shape_or_data = @@ -1081,6 +1198,19 @@ bool NumelOpInferSymbolicShape(pir::Operation *op, return true; } +// bool P_NormOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool PartialSumOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } bool PadOpInferSymbolicShape(pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { @@ -1597,6 +1727,19 @@ bool SumOpInferSymbolicShape(pir::Operation *op, return true; } +// bool SetValueWithTensorOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool TraceOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext *infer_context) +// { +// // pass +// return true; +// } bool TileOpInferSymbolicShape(pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { @@ -2117,4 +2260,18 @@ bool Unsqueeze_OpInferSymbolicShape( return UnsqueezeOpInferSymbolicShape(op, infer_context); } +// bool UnfoldOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + +// bool UnstackOpInferSymbolicShape(pir::Operation *op, +// pir::InferSymbolicShapeContext +// *infer_context) { +// // pass +// return true; +// } + } // namespace paddle::dialect diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.h b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.h index 8437418587353..9ffec0c4edb10 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.h +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.h @@ -17,6 +17,7 @@ #include "paddle/pir/include/dialect/shape/utils/shape_analysis.h" namespace paddle::dialect { +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(AffineGrid) OP_DECLARE_INFER_SYMBOLIC_SHAPE(All) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Amax) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Amin) @@ -27,6 +28,9 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(AsComplex) OP_DECLARE_INFER_SYMBOLIC_SHAPE(AsReal) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Assign) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Assign_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(AllReduce) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(AllReduce_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Barrier) OP_DECLARE_INFER_SYMBOLIC_SHAPE(BipartiteMatch) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Cast) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Cast_) @@ -40,11 +44,16 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Cumprod_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Cumsum) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Cumsum_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(ChannelShuffle) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Crop) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(DecodeJpeg) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Diag) OP_DECLARE_INFER_SYMBOLIC_SHAPE(DiagEmbed) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Diagonal) OP_DECLARE_INFER_SYMBOLIC_SHAPE(DistributeFpnProposals) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Eigh) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Eigvalsh) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(FractionalMaxPool2D) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(FractionalMaxPool3D) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FakeChannelWiseQuantizeAbsMax) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FftC2c) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FftC2r) @@ -53,6 +62,7 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(FillDiagonal) OP_DECLARE_INFER_SYMBOLIC_SHAPE(FillDiagonal_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Flatten) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Flatten_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(GumbelSoftmax) OP_DECLARE_INFER_SYMBOLIC_SHAPE(IdentityLoss) OP_DECLARE_INFER_SYMBOLIC_SHAPE(IdentityLoss_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Kthvalue) @@ -63,8 +73,17 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Max) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Maxout) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Min) OP_DECLARE_INFER_SYMBOLIC_SHAPE(MeanAll) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MatrixPower) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MatrixRank) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MaxPool2DWithIndex) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MaxPool3DWithIndex) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Multinomial) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Nanmedian) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Norm) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Nonzero) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Numel) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(P_Norm) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(PartialSum) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Pad) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Pad3d) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Pool2d) @@ -80,6 +99,8 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(SplitWithNum) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Squeeze) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Squeeze_) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Sum) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SetValueWithTensor) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Trace) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Tile) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Topk) OP_DECLARE_INFER_SYMBOLIC_SHAPE(TopkV1) @@ -90,5 +111,7 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unique) OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniqueConsecutive) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unsqueeze) OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unsqueeze_) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unfold) +// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unstack) } // namespace paddle::dialect diff --git a/paddle/phi/ops/yaml/ops.yaml b/paddle/phi/ops/yaml/ops.yaml index 6cf58a9d08b69..868317918a179 100755 --- a/paddle/phi/ops/yaml/ops.yaml +++ b/paddle/phi/ops/yaml/ops.yaml @@ -2112,6 +2112,7 @@ kernel: func : fused_softmax_mask_upper_triangle backward: fused_softmax_mask_upper_triangle_grad + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : gammaincc args : (Tensor x, Tensor y) @@ -2133,6 +2134,7 @@ func : gammaln inplace: (x -> out) backward : gammaln_grad + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : gather args : (Tensor x, Tensor index, Scalar axis=0) @@ -2192,6 +2194,7 @@ backend : x inplace: (x -> out) backward: gaussian_inplace_grad + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : gelu args : (Tensor x, bool approximate = false) @@ -2300,6 +2303,7 @@ kernel : func : hard_shrink backward : hardshrink_grad + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : hardsigmoid args : (Tensor x, float slope = 0.2, float offset = 0.5) @@ -3149,6 +3153,7 @@ func : UnchangedInferMeta kernel : func : merge_selected_rows {selected_rows -> selected_rows} + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : merged_adam_ args : (Tensor[] param, Tensor[] grad, Tensor[] learning_rate, Tensor[] moment1, Tensor[] moment2, Tensor[] beta1_pow, Tensor[] beta2_pow, Tensor[] master_param, Scalar beta1 = 0.9f, Scalar beta2 = 0.999f, Scalar epsilon = 1.0e-8f, bool multi_precision = false, bool use_global_beta_pow = false) @@ -3777,6 +3782,7 @@ func : renorm inplace: (x -> out) backward : renorm_grad + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : repeat_interleave args : (Tensor x, int repeats, int axis) @@ -4511,6 +4517,7 @@ kernel : func : tanh_shrink backward : tanh_shrink_grad + interfaces : paddle::dialect::InferSymbolicShapeInterface - op : tdm_child args: (Tensor x, Tensor tree_info, int child_nums, DataType dtype = DataType::INT32)