diff --git a/build_tools/ci/build_posix.sh b/build_tools/ci/build_posix.sh index dad19067d71c..b18efd2f09f6 100755 --- a/build_tools/ci/build_posix.sh +++ b/build_tools/ci/build_posix.sh @@ -50,6 +50,7 @@ cmake -S "$repo_root/externals/llvm-project/llvm" -B "$build_dir" \ -DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$repo_root" \ -DLLVM_TARGETS_TO_BUILD=host \ -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ + -DTORCH_MLIR_ENABLE_LTC=OFF \ -DTORCH_MLIR_ENABLE_STABLEHLO=OFF \ -DTORCH_MLIR_ENABLE_PYTORCH_EXTENSIONS=ON echo "::endgroup::" diff --git a/build_tools/ci/test_posix.sh b/build_tools/ci/test_posix.sh index 4be7a3a43918..a0b5a0340381 100755 --- a/build_tools/ci/test_posix.sh +++ b/build_tools/ci/test_posix.sh @@ -8,16 +8,8 @@ torch_version="${1:-unknown}" export PYTHONPATH="$repo_root/build/tools/torch-mlir/python_packages/torch_mlir:$repo_root/projects/pt1" -echo "::group::Run Linalg e2e integration tests" -python -m e2e_testing.main --config=linalg -v -echo "::endgroup::" - -echo "::group::Run make_fx + TOSA e2e integration tests" -python -m e2e_testing.main --config=make_fx_tosa -v -echo "::endgroup::" - -echo "::group::Run TOSA e2e integration tests" -python -m e2e_testing.main --config=tosa -v +echo "::group::Run fx_importer_tosa e2e integration tests" +python -m e2e_testing.main --config=fx_importer_tosa -v echo "::endgroup::" echo "::group::Run ONNX e2e integration tests" @@ -45,6 +37,9 @@ case $torch_version in # echo "::endgroup::" ;; stable) + echo "::group::Run FxImporter e2e integration tests" + python -m e2e_testing.main --config=fx_importer -v + echo "::endgroup::" ;; *) echo "Unrecognized torch version '$torch_version' (specify 'nightly' or 'stable' with cl arg)" diff --git a/projects/pt1/e2e_testing/xfail_sets.py b/projects/pt1/e2e_testing/xfail_sets.py index fa4f4d68e990..1c4603420891 100644 --- a/projects/pt1/e2e_testing/xfail_sets.py +++ b/projects/pt1/e2e_testing/xfail_sets.py @@ -561,6 +561,23 @@ "SplitWithSizes_Module_basic", } +if torch_version_for_comparison() < version.parse("2.6.0.dev"): + FX_IMPORTER_XFAIL_SET -= { + "ChunkListUnpackDynamic_Module_basic", + "ChunkListUnpackUnevenDynamic_Module_basic", + "ChunkListUnpackUneven_Module_basic", + "ChunkListUnpack_Module_basic", + "SplitTensorGetItem_Module_basic", + "SplitTensorLastSmallerModule_basic", + "SplitTensorListUnpackModule_basic", + "SplitTensorNegativeDimModule_basic", + "SplitWithSizesListUnpackModule_basic", + "SplitWithSizes_Module_basic", + "TensorsSplitTensorLastSmallerModule_basic", + "TensorsSplitTensorModule_basic", + "TensorsSplitTensorNegativeDimModule_basic", + } + FX_IMPORTER_CRASHING_SET = LINALG_CRASHING_SET | { "HBC_basic", # Runtime op verification: out-of-bounds access @@ -1716,6 +1733,12 @@ "UpSampleNearest2dDynamicSize_basic", "UpSampleNearest2dDynamicFactor_basic", "UpSampleNearest2dStaticFactor_basic", + # Runtime op verification: size mismatch of dim 0 + "HBC_basic", + # Runtime op verification: subview is out-of-bounds of the base memref + "RollModule_basic", + # Assertion `succeeded(range) && "element type cannot be iterated"' failed. + "TriuModule_basic", } # Write the TOSA set as a "passing" set as it is very early in development @@ -3465,9 +3488,6 @@ "AtenPolarDoubleModule_basic", "AtenPolarFloatModule_basic", "HstackBasicComplexModule_basic", - "HstackBasicFloatModule_basic", - "HstackBasicIntFloatModule_basic", - "HstackBasicIntModule_basic", "Rot90BasicModule_basic", "Rot90DynamicDimsModule_basic", "Rot90MultipleRotationsModule_basic", @@ -3506,13 +3526,6 @@ "TensorsConcatComplex128IntModule_basic", "TensorsConcatComplex64FloatModule_basic", "TimeOutModule_basic", - "TrilIndicesAllZerosModule_basic", - "TrilIndicesModule_basic", - "TrilIndicesNegativeOffsetModule_basic", - "TrilIndicesOfssetGreaterThanRowModule_basic", - "TriuIndicesAllZerosModule_basic", - "TriuIndicesModule_basic", - "TriuIndicesNegativeOffsetModule_basic", "TypeConversionUint8ToF32Module_basic", "WeightNormInterfaceModule_basic", "AdaptiveAvgPool3dDynamicNoBatch_basic", @@ -3548,8 +3561,6 @@ "AtenDiagEmbedRevDimDiag_basic", "AtenEmbeddingBagStaticModule_basic", "AtenEmbeddingBagSumExample_basic", - "AtenEyeMModuleInt2D_basic", - "AtenEyeModuleInt2D_basic", "AtenFloatScalarModule_basic", "AtenIntBoolOpConstFalseModule_basic", "AtenIntBoolOpConstTrueModule_basic", @@ -3591,6 +3602,11 @@ "AvgPool2dFloatModule_basic", "AvgPool2dIntModule_basic", "AvgPool2dStaticModule_basic", + "BatchMlpLayerModule_basic", + "BatchNorm1DModule_basic", + "BatchNorm1DWith2DInputModule_basic", + "BatchNorm2DModule_basic", + "BatchNorm3DModule_basic", "BernoulliFloatModule_basic", "BernoulliModule_basic", "BernoulliOnesModule_basic", @@ -3608,7 +3624,6 @@ "BoolIntFalseModule_basic", "BoolIntTrueModule_basic", "BroadcastDynamicDimModule_basic", - "BroadcastToModule_basic", "CeilFloatModule_basic", "CollapseAllDimensionsModule_basic", "CollapseFullDynamicModule_basic", @@ -3618,7 +3633,14 @@ "ConstantBoolParameterModule_basic", "ContainsIntList_False", "ContainsIntList_True", - "Conv1dModule_basic", + "Conv1dNoPaddingTransposeModule_basic", + "Conv2dBiasNoPaddingModule_basic", + "Conv2dNoPaddingModule_basic", + "Conv2dWithPaddingDilationStrideModule_basic", + "Conv2dWithPaddingDilationStrideStaticModule_basic", + "Conv2dWithPaddingDilationStrideStaticModule_depthwise", + "Conv2dWithPaddingDilationStrideStaticModule_depthwise_multiplier", + "Conv2dWithPaddingModule_basic", "Conv2dQInt8Module_basic", "Conv2dQInt8Module_depthwise", "Conv2dQInt8Module_grouped", @@ -3636,13 +3658,11 @@ "ConvolutionBackwardModule2DStatic_basic", "ConvolutionBackwardModule2DStrided_basic", "ConvolutionBackwardModule2D_basic", - "ConvolutionModule2DGroups_basic", "ConvolutionModule2DTransposeNonUnitOutputPadding_basic", "ConvolutionModule2DTransposeStridedStatic_basic", "ConvolutionModule2DTransposeStrided_basic", "ConvolutionModule2DTranspose_basic", "CopyWithDifferentDTypesModule_basic", - "CosineSimilarityStaticBroadcastModule_basic", "CumsumInputDtypeInt32Module_basic", "CumsumModule_basic", "CumsumStaticModule_basic", @@ -3660,11 +3680,16 @@ "DropoutTrainModule_basic", "DropoutTrainStaticShapeModule_basic", "ElementwiseAcosIntModule_basic", + "ElementwiseAcosTensorFloatModule_basic", + "ElementwiseAcosTensorIntModule_basic", "ElementwiseAcosModule_basic", "ElementwiseAcoshIntModule_basic", "ElementwiseAcoshModule_basic", "ElementwiseAddScalar_NumToTensorFloat_Module_basic", + "ElementwiseAddScalarInt8Module_basic", "ElementwiseAsinIntModule_basic", + "ElementwiseAsinTensorFloatModule_basic", + "ElementwiseAsinTensorIntModule_basic", "ElementwiseAsinModule_basic", "ElementwiseAsinhIntModule_basic", "ElementwiseAsinhModule_basic", @@ -3678,9 +3703,6 @@ "ElementwiseAtanTensorIntModule_basic", "ElementwiseAtanhIntModule_basic", "ElementwiseAtanhModule_basic", - "ElementwiseAtenLogicalAndOpModule_basic", - "ElementwiseAtenLogicalAndOpPromoteBroadcastModule_basic", - "ElementwiseAtenLogicalAndOpPromoteBroadcastStaticShapeModule_basic", "ElementwiseAtenLogicalNotOpPromoteModule_basic", "ElementwiseBitwiseAndScalarInt8Module_basic", "ElementwiseClampMinTensorFloatModule_basic", @@ -3690,6 +3712,7 @@ "ElementwiseCosIntModule_basic", "ElementwiseCoshIntModule_basic", "ElementwiseCoshModule_basic", + "ElementwiseCreateComplexModule_basic", "ElementwiseDequantizePerChannelModule_basic", "ElementwiseDequantizePerTensorModule_basic", "ElementwiseErfIntModule_basic", @@ -3721,22 +3744,13 @@ "ElementwiseToDtypeF32ToI64Module_basic", "ElementwiseToDtypeI64ToUI8Module_basic", "ElementwiseUnaryIntModule_basic", - "ElementwiseWhereScalarOtherStaticModule_basic", - "EmptyLikeMemoryFormatModule_basic", - "EmptyLikeModule_defaultDtype", - "EmptyLikeModule_falsePinMemory", - "EmptyLikeModule_float", - "EmptyLikeModule_int", - "EmptyModule_contiguous", - "EmptyModule_defaultDtype", - "EmptyModule_falsePinMemory", - "EmptyModule_float", + "EmbeddingModule1DIndices_basic", + "EmbeddingModuleF16_basic", + "EmbeddingModuleI32Static_basic", + "EmbeddingModuleI32_basic", + "EmbeddingModuleI64_basic", "EmptyModule_int", - "EmptyModule_uint8", - "EmptyStridedModule_basic", - "EmptyStridedSizeIntStrideModule_basic", "EqIntModule_basic", - "ExpandModule_basic", "ExponentialModule_basic", "FakeQuantizePerTensorAffineDynamicShapeModule_basic", "FakeQuantizePerTensorAffineModule_basic", @@ -3744,37 +3758,22 @@ "Fill_TensorFloat32WithFloat32_basic", "Fill_TensorFloat32WithFloat64_basic", "Fill_TensorFloat32WithInt64_basic", - "Fill_TensorFloat64WithFloat32Static_basic", - "Fill_TensorFloat64WithFloat32_basic", - "Fill_TensorFloat64WithFloat64_basic", - "Fill_TensorFloat64WithInt64Static_basic", - "Fill_TensorFloat64WithInt64_basic", "FlipModuleStaticShape_basic", "FlipModule_basic", "FlipNegativeIndexModule_basic", "FloatImplicitModule_basic", - "FullLikeModuleInt2D_basic", - "FullLikeModuleInt3D_basic", - "FullModuleDefaultDtype_basic", "FullModuleFalsePinMemory_basic", - "FullModuleFloat2D_basic", - "FullModuleFloat3D_basic", "FullModuleInt2D_basic", "FullModuleInt3D_basic", "GeFloatIntModule_basic", "GeFloatModule_basic", "GeIntModule_basic", - "GridSamplerBasic1_basic", - "GridSamplerBasic2_basic", - "GridSamplerBasic3_basic", "GridSamplerBasic4_basic", "GtFloatIntModule_basic", "GtIntModule_basic", "HBC_basic", "IndexPut1DFloatAccumulateModule_basic", - "IndexPut1DFloatNonAccumulateModule_basic", "IndexPut1DIntAccumulateModule_basic", - "IndexPut1DIntNonAccumulateModule_basic", "IndexPut2DFloatAccumulateModule_basic", "IndexPut2DFloatNonAccumulateModule_basic", "IndexPut2DIntAccumulateModule_basic", @@ -3784,9 +3783,7 @@ "IndexPut3DIntAccumulateModule_basic", "IndexPut3DIntNonAccumulateModule_basic", "IndexPutHackedTwin1DFloatAccumulateModule_basic", - "IndexPutHackedTwin1DFloatNonAccumulateModule_basic", "IndexPutHackedTwin1DIntAccumulateModule_basic", - "IndexPutHackedTwin1DIntNonAccumulateModule_basic", "IndexPutHackedTwin2DFloatAccumulateModule_basic", "IndexPutHackedTwin2DFloatNonAccumulateModule_basic", "IndexPutHackedTwin2DIntAccumulateModule_basic", @@ -3796,13 +3793,12 @@ "IndexPutHackedTwin3DIntAccumulateModule_basic", "IndexPutHackedTwin3DIntNonAccumulateModule_basic", "IndexPutImpl1DFloatAccumulateModule_basic", - "IndexPutImpl1DFloatNonAccumulateModule_basic", "IndexPutImpl1DIntAccumulateModule_basic", - "IndexPutImpl1DIntNonAccumulateModule_basic", "IndexPutImpl2DFloatAccumulateModule_basic", "IndexPutImpl2DFloatNonAccumulateModule_basic", "IndexPutImpl2DImplicitModule_basic", "IndexPutImpl2DIndexModule_basic", + "IndexPutImpl2DNoneIndexBroadcastStaticModule_basic", "IndexPutImpl2DNoneIndexStaticModule_basic", "IndexPutImpl3DFloatAccumulateModule_basic", "IndexPutImpl3DFloatNonAccumulateModule_basic", @@ -3813,6 +3809,7 @@ "IndexSelectNegativeDimModule_basic", "IndexSelectRank0IdxModule_basic", "IndexSelectSingleIdxModule_basic", + "IndexSelectStaticModule_basic", "IndexSelectTwoIdxModule_basic", "IndexSelectWholeDimensionModule_basic", "IndexSelectWholeTensorModule_basic", @@ -3825,15 +3822,13 @@ "IntImplicitModule_basic", "IsFloatingPointFloat_True", "IsFloatingPointInt_False", + "LayerNormLastDimModule_basic", + "LayerNormModule_basic", + "LayerNormNormalizeOverAllDimsModule_basic", "LenStrModule_basic", "LinalgNormKeepDimComplexModule_basic", "LinalgVectorNormComplexModule_basic", "LinspaceDtypeModule_basic", - "LinspaceEmptyModule_basic", - "LinspaceOneSizeModule_basic", - "MaskedFillTensorFloatValueModule_basic", - "MatmulBroadcastBatchDim_basic", - "MatmulStaticBroadcast_basic", "MaxPool1dCeilModeTrueModule_basic", "MaxPool1dModule_basic", "MaxPool2dCeilModeTrueModule_basic", @@ -3871,8 +3866,12 @@ "MaxPool3dWithIndicesStaticModule_basic", "MeanDimEmptyDimModule_basic", "MeanDimNoneDimModule_basic", + "Mlp1LayerModule_basic", + "Mlp2LayerModuleNoBias_basic", + "Mlp2LayerModule_basic", "MseLossMeanReductionModule_basic", "MseLossSumReductionWithDifferentElemTypeModule_basic", + "MobilenetV3Module_basic", "MulFloatModule_basic", "MulIntModule_basic", "NativeBatchNorm1DModule_basic", @@ -3884,18 +3883,8 @@ "NativeGroupNormBackwardModule_basic", "NeFloatIntModule_basic", "NeIntModule_basic", - "NewEmptyModuleDefaultDtype_basic", - "NewEmptyModuleFalsePinMemory_basic", - "NewEmptyModuleFloat2D_basic", - "NewEmptyModuleFloat3D_basic", "NewEmptyModuleInt2D_basic", "NewEmptyModuleInt3D_basic", - "NewEmptyModuleLayoutIntDtype_basic", - "NewEmptyModuleNonDefaultFloatDtype_basic", - "NewEmptyModuleNonDefaultIntDtype_basic", - "NewEmptyStridedModuleDefaultDtype_basic", - "NewFullModuleInt2D_basic", - "NewFullModuleInt3D_basic", "NllLossModuleBackward1DMeanWeight_basic", "NllLossModuleBackward1DMean_basic", "NllLossModuleBackward1DSumWeight_basic", @@ -3917,12 +3906,13 @@ "NumToTensorIntModule_basic", "NumelModule_basic", "NumelZeroRankModule_basic", - "OnesLikeModule_falsePinMemory", "PixelShuffleModuleFullDynamic_basic", "PixelShuffleModuleSpatiallyDynamic_basic", "PixelShuffleModuleSpatiallyStatic_basic", "PixelShuffleModuleStaticRank3Int64_basic", "PixelShuffleModuleStaticRank4Float32_basic", + "PowIntFloatModule_basic", + "PowIntIntModule_basic", "PrimMaxIntModule_basic", "PrimMinIntDynamicModule_basic", "PrimMinIntModule_basic", @@ -3972,14 +3962,17 @@ "ReflectionPad2dModule_Right", "ReflectionPad2dModule_Top", "ReflectionPad2dModule_basic", + "RepeatInterleaveFillModule_basic", + "RepeatInterleaveModule_basic", "ReplicationPad2dModule_basic", "ReplicationPad2dModule_bottom0", "ReplicationPad2dModule_left0", "ReplicationPad2dModule_right0", "ReplicationPad2dModule_top0", "RollModule_basic", + "ResNet18Module_basic", + "ResNet18StaticModule_basic", "RsubInt0d_NumToTensor_Module_basic", - "RsubIntModule_noalpha_basic", "ScalarConstantTupleModule_basic", "ScalarImplicitFloatModule_basic", "ScalarImplicitIntModule_basic", @@ -4013,13 +4006,12 @@ "SignAndLogarithmOfDeterminantBatchedModule_F32", "SignAndLogarithmOfDeterminantDynamicModule_F32", "SliceCopyEndGreaterThanDimSize_Module_basic", + "SliceCopyMax_Module_basic", "SliceCopyNegative_Module_basic", "SliceCopyNonZeroDim_Module_basic", "SliceCopyStartGreaterThanDimSize_Module_basic", "SliceCopy_Module_basic", - "SliceEndSleStartModule_basic", "SliceOutOfLowerBoundEndIndexModule_basic", - "SliceOutOfLowerBoundStartIndexModule_basic", "SliceScatterModule_basic", "SliceScatterNegativeDimModule_basic", "SliceScatterNegativeEndModule_basic", @@ -4048,8 +4040,6 @@ "TensorToFloat_basic", "TensorToIntZeroRank_basic", "TensorToInt_basic", - "TensorsConcatPromoteDTypeModule_basic", - "TensorsStackPromoteDTypeModule_basic", "TestMultipleTensorAndPrimitiveTypesReturn_basic", "Threshold1dIntModule_basic", "Threshold2dIntModule_basic", @@ -4069,12 +4059,9 @@ "TorchPrimLoopWhileLikeModule_basic", "TraceModule_empty", "TraceUnsignedIntModule_empty", - "TypeConversionI1ToF64Module_basic", - "TypeConversionI1ToI32Module_basic", "UniformModule_basic", "UniformNoCorrelationModule_basic", "UniformStaticShapeModule_basic", - "UnsafeIndexPutHackedTwin1DFloatNonAccumulateModule_basic", "UnsafeViewCollapseDynamicWithAtenSizeIntModule_basic", "UpSampleNearest2dBackwardScalesNone_basic", "UpSampleNearest2dBackward_basic", @@ -4088,12 +4075,25 @@ "VarMeanUnbiasedModule_basic", "ViewCollapseDynamicWithAtenSizeIntModule_basic", "ViewSizeFromOtherTensor_basic", - "ZeroFloat32Module_basic", - "ZeroInt32Module_basic", - "ZeroInt64Module_basic", - "ZerosLikeModule_falsePinMemory", } +if torch_version_for_comparison() >= version.parse("2.6.0.dev"): + FX_IMPORTER_TOSA_XFAIL_SET |= { + "ChunkListUnpackDynamic_Module_basic", + "ChunkListUnpackUnevenDynamic_Module_basic", + "ChunkListUnpackUneven_Module_basic", + "ChunkListUnpack_Module_basic", + "SplitTensorGetItem_Module_basic", + "SplitTensorLastSmallerModule_basic", + "SplitTensorListUnpackModule_basic", + "SplitTensorNegativeDimModule_basic", + "SplitWithSizesListUnpackModule_basic", + "SplitWithSizes_Module_basic", + "TensorsSplitTensorLastSmallerModule_basic", + "TensorsSplitTensorModule_basic", + "TensorsSplitTensorNegativeDimModule_basic", + } + ONNX_TOSA_CRASHING_SET = { "StdCorrectionEmptyDimModule_basic", "StdDimEmptyDimModule_basic", @@ -4604,9 +4604,7 @@ "IndexPutHackedTwin3DIntAccumulateModule_basic", "IndexPutHackedTwin3DIntNonAccumulateModule_basic", "IndexPutImpl1DFloatAccumulateModule_basic", - "IndexPutImpl1DFloatNonAccumulateModule_basic", "IndexPutImpl1DIntAccumulateModule_basic", - "IndexPutImpl1DIntNonAccumulateModule_basic", "IndexPutImpl2DFloatAccumulateModule_basic", "IndexPutImpl2DFloatNonAccumulateModule_basic", "IndexPutImpl2DImplicitModule_basic",