From cba91a9b960fa28fed6883033df267b01602f2b5 Mon Sep 17 00:00:00 2001 From: Suraj Sudhir Date: Thu, 16 May 2024 21:44:26 -0700 Subject: [PATCH] [ONNX][TOSA] Adds ONNX to TOSA e2e tests (#3358) - Refactors OnnxBackend to be generic and consume any Torch backend. --------- Signed-off-by: Suraj Sudhir --- projects/pt1/e2e_testing/main.py | 12 +- projects/pt1/e2e_testing/xfail_sets.py | 979 ++++++++++++++++++ .../configs/onnx_backend.py | 57 +- .../onnx_backends/__init__.py | 0 .../torch_mlir_e2e_test/onnx_backends/abc.py | 50 - .../onnx_backends/linalg_on_tensors.py | 80 -- 6 files changed, 1040 insertions(+), 138 deletions(-) delete mode 100644 projects/pt1/python/torch_mlir_e2e_test/onnx_backends/__init__.py delete mode 100644 projects/pt1/python/torch_mlir_e2e_test/onnx_backends/abc.py delete mode 100644 projects/pt1/python/torch_mlir_e2e_test/onnx_backends/linalg_on_tensors.py diff --git a/projects/pt1/e2e_testing/main.py b/projects/pt1/e2e_testing/main.py index 01811a1a5d34..e9468ee919da 100644 --- a/projects/pt1/e2e_testing/main.py +++ b/projects/pt1/e2e_testing/main.py @@ -28,9 +28,6 @@ from torch_mlir_e2e_test.linalg_on_tensors_backends.refbackend import ( RefBackendLinalgOnTensorsBackend, ) -from torch_mlir_e2e_test.onnx_backends.linalg_on_tensors import ( - LinalgOnTensorsOnnxBackend, -) from torch_mlir_e2e_test.tosa_backends.linalg_on_tensors import ( LinalgOnTensorsTosaBackend, ) @@ -56,6 +53,7 @@ FX_IMPORTER_STABLEHLO_XFAIL_SET, FX_IMPORTER_STABLEHLO_CRASHING_SET, FX_IMPORTER_TOSA_XFAIL_SET, + ONNX_TOSA_XFAIL_SET, ) # Import tests to register them in the global registry. @@ -75,6 +73,7 @@ def _get_argparse(): "lazy_tensor_core", "torchdynamo", "onnx", + "onnx_tosa", "fx_importer", "fx_importer_stablehlo", "fx_importer_tosa", @@ -98,6 +97,7 @@ def _get_argparse(): "fx_importer": run the model through the fx importer frontend and execute the graph using Linalg-on-Tensors. "fx_importer_stablehlo": run the model through the fx importer frontend and execute the graph using Stablehlo backend. "fx_importer_tosa": run the model through the fx importer frontend and execute the graph using the TOSA backend. +"onnx_tosa": Import ONNX to Torch via the torch-onnx-to-torch path and execute the graph using the TOSA backend. """, ) parser.add_argument( @@ -191,9 +191,13 @@ def main(): xfail_set = TORCHDYNAMO_XFAIL_SET crashing_set = TORCHDYNAMO_CRASHING_SET elif args.config == "onnx": - config = OnnxBackendTestConfig(LinalgOnTensorsOnnxBackend()) + config = OnnxBackendTestConfig(RefBackendLinalgOnTensorsBackend()) xfail_set = ONNX_XFAIL_SET crashing_set = ONNX_CRASHING_SET + elif args.config == "onnx_tosa": + config = OnnxBackendTestConfig(LinalgOnTensorsTosaBackend(), output_type="tosa") + xfail_set = ONNX_TOSA_XFAIL_SET + crashing_set = set() do_not_attempt = set( args.crashing_tests_to_not_attempt_to_run_and_a_bug_is_filed or [] diff --git a/projects/pt1/e2e_testing/xfail_sets.py b/projects/pt1/e2e_testing/xfail_sets.py index fb6a09fa0606..f7904fc7f85c 100644 --- a/projects/pt1/e2e_testing/xfail_sets.py +++ b/projects/pt1/e2e_testing/xfail_sets.py @@ -3438,3 +3438,982 @@ "ZeroInt64Module_basic", "ZerosLikeModule_falsePinMemory", } + +ONNX_TOSA_XFAIL_SET = { + "AdaptiveAvgPool1dGeneralDynamicNoBatches_basic", + "AdaptiveAvgPool1dGeneralDynamic_basic", + "AdaptiveAvgPool1dNonUnitOutputSizeDynamicModule_basic", + "AdaptiveAvgPool1dNonUnitOutputSizeStaticModule_basic", + "AdaptiveAvgPool1dStaticEvenMultiple_basic", + "AdaptiveAvgPool1dStaticLargerOutput_basic", + "AdaptiveAvgPool1dUnitOutputSizeDynamicModule_basic", + "AdaptiveAvgPool1dUnitOutputSizeStaticModule_basic", + "AdaptiveAvgPool2dDynamicNoBatch_basic", + "AdaptiveAvgPool2dDynamic_basic", + "AdaptiveAvgPool2dNonUnitOutputSizeDynamicModule_basic", + "AdaptiveAvgPool2dOutputSizeDivisibleByInputDynamicModule_basic", + "AdaptiveAvgPool2dUnitOutputSizeDynamicModule_basic", + "AdaptiveAvgPool3dDynamicNoBatch_basic", + "AdaptiveAvgPool3dDynamic_basic", + "AdaptiveMaxPool1dDynamicNoBatch_basic", + "AdaptiveMaxPool1dDynamic_basic", + "AdaptiveMaxPool1dStatic_basic", + "AdaptiveMaxPool2dDynamicNoBatch_basic", + "AdaptiveMaxPool2dDynamicWithIndices_basic", + "AdaptiveMaxPool2dDynamic_basic", + "AdaptiveMaxPool2dStaticWithIndices_basic", + "AdaptiveMaxPool2dStatic_basic", + "AdaptiveMaxPool3dDynamicNoBatch_basic", + "AdaptiveMaxPool3dDynamicWithIndices_basic", + "AdaptiveMaxPool3dDynamic_basic", + "AdaptiveMaxPool3dStaticWithIndices_basic", + "AdaptiveMaxPool3dStatic_basic", + "AddCDivModule_basic", + "AddIntModule_basic", + "AddSizeIntModule_basic", + "AddSizeIntNegDimModule_basic", + "Add_MixPModule_basic", + "Add_Module_basic", + "AddmmModuleFloat_basic", + "AddmmModule_broadcastable", + "AddmmModule_differentRankBroadcastable", + "AllBoolFalseModule_basic", + "AllBoolTrueModule_basic", + "AnyBoolFalseModule_basic", + "AnyBoolTrueModule_basic", + "ArangeStartOutDtypeModule_basic", + "ArangeStartOutViewModule_basic", + "ArgmaxIntModule_basic", + "ArgmaxIntModule_multiple_maxs", + "ArgmaxModule_basic", + "ArgmaxModule_with_dim", + "ArgminIntModule_basic", + "ArgminIntModule_multiple_mins", + "ArgminModule_basic", + "ArgminModule_keepDim", + "ArgminModule_with_dim", + "AtenComplex64Module_basic", + "AtenComplexImagModule_basic", + "AtenComplexRealModule_basic", + "AtenComplexViewModule_basic", + "AtenDiagEmbedDefaultDiag_basic", + "AtenDiagEmbedDimDiag_basic", + "AtenDiagEmbedNegOffsetDiag_basic", + "AtenDiagEmbedNonDefault4DDiag_basic", + "AtenDiagEmbedOffsetDiag_basic", + "AtenDiagEmbedRevDimDiag_basic", + "AtenEmbeddingBagStaticModule_basic", + "AtenEmbeddingBagSumExample_basic", + "AtenFloatScalarModule_basic", + "AtenIntBoolOpConstFalseModule_basic", + "AtenIntBoolOpConstTrueModule_basic", + "AtenIntBoolOpModule_basic", + "AtenIntTensorByteDtypeModule_basic", + "AtenIntTensorCharDtypeModule_basic", + "AtenItemFpOpModule_basic", + "AtenItemIntOpModule_basic", + "AtenLinalgCrossDynamic_basic", + "AtenMatmulQMixedSigni8Transpose_basic", + "AtenMatmulQMixedSigni8_basic", + "AtenMatmulQint8MV_basic", + "AtenMatmulQint8VM_basic", + "AtenMatmulQint8VV_basic", + "AtenMatmulQint8_basic", + "AtenMmFloatTypes_basic", + "AtenMmIntTypes_basic", + "AtenMmQMixedSigni8_basic", + "AtenMmQint8_basic", + "AtenMmQuint8_basic", + "AtenRealView128Module_basic", + "AtenRealView64Module_basic", + "AtenRoundFloatHalfToEvenModule_basic", + "AtenRoundFloatModule_basic", + "AtenSubFloatModule_basic", + "AtenTopKModule_basic", + "AtenTopKSmallestModule_basic", + "AtenTrilModule_basic", + "AtenTrilWithNegDiagonalModule_basic", + "AtenTrilWithPosDiagonalModule_basic", + "AtenTriuModule_basic", + "AtenTriuWithNegDiagonalModule_basic", + "AtenTriuWithPosDiagonalModule_basic", + "Aten_CastLongModule_basic", + "Aten_EmbeddingBagExample_basic", + "AvgPool1dFloatModule_basic", + "AvgPool1dIntModule_basic", + "AvgPool1dStaticModule_basic", + "AvgPool2dCeilModeTrueModule_basic", + "AvgPool2dDivisorOverrideModule_basic", + "AvgPool2dFloatModule_basic", + "AvgPool2dIntModule_basic", + "AvgPool2dStaticModule_basic", + "AvgPool2dWithoutPadModule_basic", + "BatchMlpLayerModule_basic", + "BernoulliFloatModule_basic", + "BernoulliModule_basic", + "BernoulliOnesModule_basic", + "BernoulliPModule_basic", + "BernoulliTensorModule_basic", + "BernoulliZerosModule_basic", + "BincountMinlengthModule_basic", + "BincountModule_basic", + "BincountStaticSizeModule_basic", + "BmmIntModule_basic", + "BoolFloatConstantModule_basic", + "BoolFloatFalseModule_basic", + "BoolFloatTrueModule_basic", + "BoolIntConstantModule_basic", + "BoolIntFalseModule_basic", + "BoolIntTrueModule_basic", + "BoolTensorHandleSignless_basic", + "BroadcastDynamicDimModule_basic", + "BroadcastToModule_basic", + "BucketizeTensorFloatModule_basic", + "BucketizeTensorModule_basic", + "BucketizeTensorOutInt32RightModule_basic", + "BucketizeTensorStaticFloatModule_basic", + "BucketizeTensorStaticModule_basic", + "CeilFloatModule_basic", + "ChunkListUnpackDynamic_Module_basic", + "ChunkListUnpackUnevenDynamic_Module_basic", + "ChunkListUnpackUneven_Module_basic", + "ChunkListUnpack_Module_basic", + "CollapseAllDimensionsModule_basic", + "CollapseFullDynamicModule_basic", + "CollapsePartialDynamicModule_basic", + "CollapseRank1DynamicModule_basic", + "CollapseStaticModule_basic", + "ConstantBoolParameterModule_basic", + "ConstantPad2dStaticModule_basic", + "ConstantPadNdModule_basic", + "ConstantPadNdPartialStaticModule_basic", + "ConstantPadNdStaticModule_basic", + "ContainsIntList_False", + "ContainsIntList_True", + "Conv1dModule_basic", + "Conv2dBiasNoPaddingModule_basic", + "Conv2dModule_basic", + "Conv2dNoPaddingModule_basic", + "Conv2dQInt8Module_basic", + "Conv2dWithPaddingDilationStrideModule_basic", + "Conv2dWithPaddingDilationStrideStaticModule_grouped", + "Conv2dWithPaddingDilationStrideStaticModule_grouped_multiplier", + "Conv2dWithPaddingModule_basic", + "Conv3dModule_basic", + "ConvTbcModule_basic", + "ConvTranspose2DQInt8_basic", + "Conv_Transpose2dModule_basic", + "Convolution2DModule_basic", + "Convolution2DStridedModule_basic", + "ConvolutionBackwardModule2DPadded_basic", + "ConvolutionBackwardModule2DStatic_basic", + "ConvolutionBackwardModule2DStrided_basic", + "ConvolutionBackwardModule2D_basic", + "ConvolutionModule2DGroups_basic", + "ConvolutionModule2DTransposeNonUnitOutputPadding_basic", + "ConvolutionModule2DTransposeStridedStatic_basic", + "ConvolutionModule2DTransposeStrided_basic", + "ConvolutionModule2DTranspose_basic", + "CopyModule_basic", + "CopyWithDifferentDTypesAndSizesModule_basic", + "CopyWithDifferentDTypesModule_basic", + "CopyWithDifferentSizesModule_basic", + "CosineSimilarityStaticBroadcastModule_basic", + "CrossEntropyLossModule_basic", + "CrossEntropyLossNoReductionModule_basic", + "CumsumInputDtypeInt32Module_basic", + "CumsumModule_basic", + "CumsumStaticModule_basic", + "CumsumStaticNegativeDimModule_basic", + "DiagonalModule_basic", + "DiagonalModule_nonsquare", + "DiagonalModule_transposed", + "DiagonalModule_with_dims", + "DiagonalModule_with_dims_and_offset", + "DiagonalModule_with_negative_dims", + "DiagonalModule_with_offset", + "DiagonalWithStaticShapeModule_basic", + "DivFloatModule_basic", + "DivIntModule_basic", + "DropoutTrainModule_basic", + "DropoutTrainStaticShapeModule_basic", + "ElementwiseAcosIntModule_basic", + "ElementwiseAcosModule_basic", + "ElementwiseAcoshIntModule_basic", + "ElementwiseAcoshModule_basic", + "ElementwiseAddScalarInt64Module_basic", + "ElementwiseAddScalarIntModule_basic", + "ElementwiseAndScalarModule_basic", + "ElementwiseAndScalarStaticShapeModule_basic", + "ElementwiseAsinIntModule_basic", + "ElementwiseAsinModule_basic", + "ElementwiseAsinhIntModule_basic", + "ElementwiseAsinhModule_basic", + "ElementwiseAtan2FloatIntModule_basic", + "ElementwiseAtan2FloatIntStaticModule_basic", + "ElementwiseAtan2TensorFloatModule_basic", + "ElementwiseAtan2TensorFloatStaticModule_basic", + "ElementwiseAtan2TensorIntModule_basic", + "ElementwiseAtan2TensorIntStaticModule_basic", + "ElementwiseAtanTensorFloatModule_basic", + "ElementwiseAtanTensorIntModule_basic", + "ElementwiseAtanhIntModule_basic", + "ElementwiseAtanhModule_basic", + "ElementwiseAtenDivIntScalarModule_basic", + "ElementwiseAtenFloorDivideBroadcastModule_basic", + "ElementwiseAtenFloorDivideScalarModule_basic", + "ElementwiseAtenFloorDivideScalarNegativeModule_basic", + "ElementwiseAtenFloorDivideTensorNegativeModule_basic", + "ElementwiseAtenFloorDivideTensorPositiveModule_basic", + "ElementwiseAtenIsinfOpModule_basic", + "ElementwiseAtenIsneginfOpModule_basic", + "ElementwiseAtenIsposinfOpModule_basic", + "ElementwiseAtenLogicalAndOpModule_basic", + "ElementwiseAtenLogicalAndOpPromoteBroadcastModule_basic", + "ElementwiseAtenLogicalAndOpPromoteBroadcastStaticShapeModule_basic", + "ElementwiseAtenLogicalNotOpPromoteModule_basic", + "ElementwiseAtenLogicalOrOpBrodcastModule_basic", + "ElementwiseAtenLogicalOrOpDiffArgs1Module_basic", + "ElementwiseAtenLogicalOrOpDiffArgs2Module_basic", + "ElementwiseAtenLogicalOrOpDiffArgs3Module_basic", + "ElementwiseAtenLogicalOrOpNegativeModule_basic", + "ElementwiseAtenLogicalOrOpRandomFloatModule_basic", + "ElementwiseAtenLogicalOrOpRandomModule_basic", + "ElementwiseAtenLogicalXorOpModule_basic", + "ElementwiseAtenLogicalXorOpPromoteBroadcastModule_basic", + "ElementwiseAtenLogicalXorOpPromoteBroadcastStaticShapeModule_basic", + "ElementwiseBitwiseAndModule_basic", + "ElementwiseBitwiseAndScalarInt32Module_basic", + "ElementwiseBitwiseAndScalarInt64Module_basic", + "ElementwiseBitwiseAndScalarInt8Module_basic", + "ElementwiseBitwiseAndStaticShapeModule_basic", + "ElementwiseBitwiseLeftShiftInt32Module_basic", + "ElementwiseBitwiseLeftShiftInt64Module_basic", + "ElementwiseBitwiseLeftShiftInt8Module_basic", + "ElementwiseBitwiseNotInt32Module_basic", + "ElementwiseBitwiseNotInt64Module_basic", + "ElementwiseBitwiseOrModule_basic", + "ElementwiseBitwiseOrStaticShapeModule_basic", + "ElementwiseBitwiseRightShiftInt32Module_basic", + "ElementwiseBitwiseRightShiftInt64Module_basic", + "ElementwiseBitwiseRightShiftInt8Module_basic", + "ElementwiseBitwiseXorModule_basic", + "ElementwiseBitwiseXorStaticShapeModule_basic", + "ElementwiseClampMaxModule_basic", + "ElementwiseClampMinModule_basic", + "ElementwiseClampMinTensorFloatModule_basic", + "ElementwiseClampMinTensorIntModule_basic", + "ElementwiseClampModule_basic", + "ElementwiseClampTensorFloatModule_basic", + "ElementwiseClampTensorInt8Module_basic", + "ElementwiseClampTensorIntModule_basic", + "ElementwiseCosIntModule_basic", + "ElementwiseCosModule_basic", + "ElementwiseCoshIntModule_basic", + "ElementwiseCoshModule_basic", + "ElementwiseDequantizePerChannelModule_basic", + "ElementwiseDequantizePerTensorModule_basic", + "ElementwiseDivScalarRoundingModeFloorIntStaticModule_basic", + "ElementwiseDivScalarRoundingModeTruncModule_basic", + "ElementwiseDivScalarRoundingModeTruncStaticModule_basic", + "ElementwiseDivTensorFloatModule_basic", + "ElementwiseDivTensorIntegerModule_basic", + "ElementwiseDivTensorRoundingModeFloorIntStaticModule_basic", + "ElementwiseDivTensorRoundingModeFloorModule_basic", + "ElementwiseDivTensorRoundingModeFloorStaticModule_basic", + "ElementwiseDivTensorRoundingModeTruncIntStaticModule_basic", + "ElementwiseDivTensorRoundingModeTruncModule_basic", + "ElementwiseDivTensorRoundingModeTruncStaticModule_basic", + "ElementwiseDivTensorUnsignedIntegerModule_basic", + "ElementwiseEluNonDefaultModule_basic", + "ElementwiseEqBoolScalarModule_basic", + "ElementwiseEqDiffWidthScalarModule_basic", + "ElementwiseErfIntModule_basic", + "ElementwiseErfModule_basic", + "ElementwiseExpIntModule_basic", + "ElementwiseExpm1IntModule_basic", + "ElementwiseExpm1Module_basic", + "ElementwiseFlattenBroadcastModule_basic", + "ElementwiseFmodTensor_Float_basic", + "ElementwiseFmodTensor_Int_Float_basic", + "ElementwiseFmodTensor_Int_basic", + "ElementwiseGeFloatIntScalarModule_basic", + "ElementwiseGeFloatScalarModule_basic", + "ElementwiseGeFloatTensorModule_basic", + "ElementwiseGeIntScalarModule_basic", + "ElementwiseGeIntTensorModule_basic", + "ElementwiseGeMixedIntScalarModule_basic", + "ElementwiseGeluModule_basic", + "ElementwiseGtMixed2ScalarModule_basic", + "ElementwiseIntTensorLtFloatScalarModule_basic", + "ElementwiseIsinfModule_basic", + "ElementwiseLeFloatTensorNanModule_basic", + "ElementwiseLeMixedIntScalarModule_basic", + "ElementwiseLog10IntModule_basic", + "ElementwiseLog2IntModule_basic", + "ElementwiseLogIntModule_basic", + "ElementwiseLtDiffWidthScalarModule_basic", + "ElementwiseMishModule_basic", + "ElementwiseMulScalarModule_basic", + "ElementwiseMulTensorComplexDiffModule_basic", + "ElementwiseMulTensorComplexModule_basic", + "ElementwiseMulTensorFloatModule_basic", + "ElementwiseMulTensorIntModule_basic", + "ElementwiseNanToNumModule_Basic", + "ElementwiseOrTensorModule_basic", + "ElementwiseOrTensorStaticShapeModule_basic", + "ElementwisePowModule_basic", + "ElementwisePowScalarModule_basic", + "ElementwisePowTensorBroadcastModule_basic", + "ElementwisePowTensorBroadcastStaticModule_basic", + "ElementwisePowTensorModule_basic", + "ElementwisePowTensorStaticModule_basic", + "ElementwiseQuantizePerTensorModule_basic", + "ElementwiseQuantizePerTensorUIntModule_basic", + "ElementwiseReciprocalIntModule_basic", + "ElementwiseRelu6Module_basic", + "ElementwiseRemainderScalarModule_Bool_basic", + "ElementwiseRemainderScalarModule_Int_Float_basic", + "ElementwiseRemainderScalarModule_Int_basic", + "ElementwiseRemainderTensorModule_Int_Float_basic", + "ElementwiseRemainderTensorModule_Int_basic", + "ElementwiseRsqrtIntModule_basic", + "ElementwiseSgnModule_basic", + "ElementwiseSigmoidIntModule_basic", + "ElementwiseSinIntModule_basic", + "ElementwiseSinModule_basic", + "ElementwiseSinhIntModule_basic", + "ElementwiseSinhModule_basic", + "ElementwiseSqrtIntModule_basic", + "ElementwiseSubScalarIntModule_basic", + "ElementwiseTanIntModule_basic", + "ElementwiseTanModule_basic", + "ElementwiseTernaryModule_basic", + "ElementwiseToDtypeF32ToI64Module_basic", + "ElementwiseToDtypeI64ToI8Module_basic", + "ElementwiseToDtypeI64ToUI8Module_basic", + "ElementwiseTruncIntModule_basic", + "ElementwiseTruncModule_basic", + "ElementwiseUnaryIntModule_basic", + "ElementwiseUnsqueezeNegDimsModule_basic", + "ElementwiseWhereScalarOtherModule_basic", + "ElementwiseWhereScalarOtherStaticModule_basic", + "ElementwiseWhereScalarSelfModule_basic", + "ElementwiseWhereScalarSelfStaticModule_basic", + "ElementwiseWhereSelfModule_basic", + "EmbeddingModule1DIndices_basic", + "EmbeddingModuleF16_basic", + "EmbeddingModuleI32Static_basic", + "EmbeddingModuleI32_basic", + "EmbeddingModuleI64_basic", + "EmptyLikeMemoryFormatModule_basic", + "EmptyLikeModule_defaultDtype", + "EmptyLikeModule_falsePinMemory", + "EmptyLikeModule_float", + "EmptyLikeModule_int", + "EmptyStridedModule_basic", + "EmptyStridedSizeIntStrideModule_basic", + "EqIntModule_basic", + "ExpandAsFloatModule_basic", + "ExpandAsIntModule_basic", + "ExpandModule_basic", + "ExponentialModule_basic", + "FakeQuantizePerTensorAffineDynamicShapeModule_basic", + "FakeQuantizePerTensorAffineModule_basic", + "FakeQuantizePerTensorAffineRoundToEvenModule_basic", + "Fill_TensorFloat32WithFloat32_basic", + "Fill_TensorFloat32WithFloat64_basic", + "Fill_TensorFloat32WithInt64_basic", + "Fill_TensorFloat64WithFloat32_basic", + "Fill_TensorFloat64WithFloat64_basic", + "Fill_TensorFloat64WithInt64_basic", + "FlattenDynamicModuleCollapseAll_basic", + "FlattenDynamicModule_basic", + "FlattenRank0Module_basic", + "FlipModuleStaticShape_basic", + "FlipModule_basic", + "FlipNegativeIndexModule_basic", + "FloatImplicitModule_basic", + "FullLikeModuleDefaultDtype_basic", + "FullLikeModuleFalsePinMemory_basic", + "FullLikeModuleFloat2D_basic", + "FullLikeModuleFloat3D_basic", + "FullLikeModuleInt2D_basic", + "FullLikeModuleInt3D_basic", + "Gather2DInputModdule_basic", + "GatherModule_basic", + "GatherNegativeDimModule_basic", + "GatherRandomIndexModule_basic", + "GeFloatIntModule_basic", + "GeFloatModule_basic", + "GeIntModule_basic", + "GeluBackwardModule_basic", + "GridSamplerBasic1_basic", + "GridSamplerBasic2_basic", + "GridSamplerBasic3_basic", + "GridSamplerBasic4_basic", + "GtFloatIntModule_basic", + "GtIntModule_basic", + "HBC_basic", + "HardTanhIntModule_basic", + "HardTanhModule_basic", + "HardsigmoidModule_basic", + "HardsigmoidRandomModule_basic", + "HardtanhBackward_basic", + "IndexPut1DFloatAccumulateModule_basic", + "IndexPut1DFloatNonAccumulateModule_basic", + "IndexPut1DIntAccumulateModule_basic", + "IndexPut1DIntNonAccumulateModule_basic", + "IndexPut2DFloatAccumulateModule_basic", + "IndexPut2DFloatNonAccumulateModule_basic", + "IndexPut2DIntAccumulateModule_basic", + "IndexPut2DIntNonAccumulateModule_basic", + "IndexPut3DFloatAccumulateModule_basic", + "IndexPut3DFloatNonAccumulateModule_basic", + "IndexPut3DIntAccumulateModule_basic", + "IndexPut3DIntNonAccumulateModule_basic", + "IndexPutHackedTwin1DFloatAccumulateModule_basic", + "IndexPutHackedTwin1DFloatNonAccumulateModule_basic", + "IndexPutHackedTwin1DIntAccumulateModule_basic", + "IndexPutHackedTwin1DIntNonAccumulateModule_basic", + "IndexPutHackedTwin2DFloatAccumulateModule_basic", + "IndexPutHackedTwin2DFloatNonAccumulateModule_basic", + "IndexPutHackedTwin2DIntAccumulateModule_basic", + "IndexPutHackedTwin2DIntNonAccumulateModule_basic", + "IndexPutHackedTwin3DFloatAccumulateModule_basic", + "IndexPutHackedTwin3DFloatNonAccumulateModule_basic", + "IndexPutHackedTwin3DIntAccumulateModule_basic", + "IndexPutHackedTwin3DIntNonAccumulateModule_basic", + "IndexPutImpl1DFloatAccumulateModule_basic", + "IndexPutImpl1DFloatNonAccumulateModule_basic", + "IndexPutImpl1DIntAccumulateModule_basic", + "IndexPutImpl1DIntNonAccumulateModule_basic", + "IndexPutImpl2DFloatAccumulateModule_basic", + "IndexPutImpl2DFloatNonAccumulateModule_basic", + "IndexPutImpl2DImplicitModule_basic", + "IndexPutImpl2DIndexModule_basic", + "IndexPutImpl2DNoneIndexStaticModule_basic", + "IndexPutImpl3DFloatAccumulateModule_basic", + "IndexPutImpl3DFloatNonAccumulateModule_basic", + "IndexPutImplIndexWithNoneModule_basic", + "IndexSelectDynamicIndexSizeModule_basic", + "IndexSelectDynamicInputSizeModule_basic", + "IndexSelectDynamicModulebasic", + "IndexSelectNegativeDimModule_basic", + "IndexSelectRank0IdxModule_basic", + "IndexSelectSingleIdxModule_basic", + "IndexSelectTwoIdxModule_basic", + "IndexSelectWholeDimensionModule_basic", + "IndexSelectWholeTensorModule_basic", + "IndexTensorDyanmicInputContiguousWithNoneModule_basic", + "IndexTensorDyanmicInputNonContiguousWithNoneModule_basic", + "IndexTensorHackedTwinModule3dInput_basic", + "IndexTensorHackedTwinModule_basic", + "IndexTensorHackedTwinMultiInputNonContiguousMultipleStaticDims_basic", + "IndexTensorModule3dInput_basic", + "IndexTensorModule_basic", + "IndexTensorMultiIndexStaticModule_basic", + "IndexTensorMultiInputContiguousCenter_basic", + "IndexTensorMultiInputContiguousOneDimDynamic_basic", + "IndexTensorMultiInputNonContiguousDynamic_basic", + "IndexTensorMultiInputNonContiguousMultipleStaticDims_basic", + "IndexTensorMultiInputNonContiguousOneDimDynamic_basic", + "IndexTensorMultiInputNonContiguous_basic", + "IndexTensorMultiInputOneDim_basic", + "IndexTensorMultiInputThreeIndexers_basic", + "IndexTensorMultiInput_basic", + "IndexTensorNegativeIndexModule_basic", + "IndexTensorSelectDimModule_basic", + "IndexTensorStaticContiguousWithNoneModule_basic", + "IndexTensorStaticModule_basic", + "IndexTensorStaticNonContiguousWithNoneModule_basic", + "IntFloatModule_basic", + "IntImplicitModule_basic", + "IouOfModule_basic", + "IsFloatingPointFloat_True", + "IsFloatingPointInt_False", + "IscloseStaticModuleTrue_basic", + "IscloseStaticModule_basic", + "LeakyReluBackwardModule_basic", + "LeakyReluBackwardStaticModule_basic", + "LenStrModule_basic", + "LiftFreshCopyModule_basic", + "LinalgNormKeepDimComplexModule_basic", + "LinalgNormModule_basic", + "LinalgVectorNormComplexModule_basic", + "LinalgVectorNormKeepDimModule_basic", + "LinalgVectorNormModule_basic", + "LogSoftmaxBackwardModule_basic", + "LogSoftmaxIntModule_basic", + "MaskedFillTensorFloatValueModule_basic", + "MatmulBroadcastBatchDim_basic", + "MatmulSingleDynamicBatchDim_basic", + "Matmul_2d", + "Matmul_4d", + "Matmul_matvec", + "Matmul_vecmat", + "MaxPool1dCeilModeTrueModule_basic", + "MaxPool1dEmptyStrideStaticModule_basic", + "MaxPool1dModule_basic", + "MaxPool1dStaticCeilModeTrueModule_basic", + "MaxPool1dStaticModule_basic", + "MaxPool2dCeilModeTrueModule_basic", + "MaxPool2dModule_basic", + "MaxPool2dWithIndicesAllNegativeValuesModule_basic", + "MaxPool2dWithIndicesAllOnesModule_basic", + "MaxPool2dWithIndicesBackwardDynamic3DModule_basic", + "MaxPool2dWithIndicesBackwardDynamic4DModule_basic", + "MaxPool2dWithIndicesBackwardStatic3DModule_basic", + "MaxPool2dWithIndicesBackwardStatic4DModule_basic", + "MaxPool2dWithIndicesCeilModeTrueModule_basic", + "MaxPool2dWithIndicesFullSizeKernelModule_basic", + "MaxPool2dWithIndicesModule_basic", + "MaxPool2dWithIndicesNonDefaultDilationModule_basic", + "MaxPool2dWithIndicesNonDefaultPaddingModule_basic", + "MaxPool2dWithIndicesNonDefaultParamsModule_basic", + "MaxPool2dWithIndicesNonDefaultStrideModule_basic", + "MaxPool2dWithIndicesStaticModule_basic", + "MaxPool3dCeilModeTrueModule_basic", + "MaxPool3dEmptyStrideStaticModule_basic", + "MaxPool3dLargeDatadModule_basic", + "MaxPool3dModuleRandomSimple_basic", + "MaxPool3dModule_basic", + "MaxPool3dStaticCeilModeTrueModule_basic", + "MaxPool3dStaticModule_basic", + "MeanDimAllReduceKeepdimModule_basic", + "MeanDimAllReduceModule_basic", + "MeanDimDtypeModule_basic", + "MeanDimEmptyDimModule_basic", + "MeanDimKeepdimModule_basic", + "MeanDimModule_basic", + "MeanDimNegativeModule_basic", + "MeanDimNoneDimModule_basic", + "MeanDtypeModule_basic", + "MeanDynamicSizesModule_basic", + "MeanModule_basic", + "Mlp1LayerModule_basic", + "Mlp2LayerModuleNoBias_basic", + "Mlp2LayerModule_basic", + "MmModule_basic", + "MmModule_chained", + "MmTanhModule_basic", + "MobilenetV3Module_basic", + "MoveDimIntNegativeIndexModule_basic", + "MseLossMeanReductionModule_basic", + "MseLossSumReductionWithDifferentElemTypeModule_basic", + "MulFloatModule_basic", + "MulIntModule_basic", + "Mv_basic", + "NarrowHorizontalTest2_basic", + "NarrowHorizontalTest_basic", + "NarrowTensorHorizontalModule_basic", + "NarrowTensorVerticalModule_basic", + "NarrowVerticalTest2_basic", + "NarrowVerticalTest_basic", + "NativeBatchNorm1DModule_basic", + "NativeBatchNorm2DModule_basic", + "NativeBatchNorm3DModule_basic", + "NativeBatchNormNoneWeightModule_basic", + "NativeDropoutEvalFloatModule_basic", + "NativeDropoutTrainModule_basic", + "NativeDropoutTrainStaticShapeModule_basic", + "NativeGroupNormBackwardModule_basic", + "NativeGroupNormModule_basic", + "NativeLayerNormDynamicModule_basic", + "NativeLayerNormModule4D_basic", + "NativeLayerNormModule_basic", + "NeFloatIntModule_basic", + "NeIntModule_basic", + "NewEmptyStridedModuleDefaultDtype_basic", + "NllLossModuleBackward1DMeanWeight_basic", + "NllLossModuleBackward1DMean_basic", + "NllLossModuleBackward1DSumWeight_basic", + "NllLossModuleBackward1DSum_basic", + "NllLossModuleBackward1DWeight_basic", + "NllLossModuleBackward1D_basic", + "NllLossModuleBackwardMeanWeight_basic", + "NllLossModuleBackwardMean_basic", + "NllLossModuleBackwardSumWeight_basic", + "NllLossModuleBackwardSum_basic", + "NllLossModuleBackwardWeight_basic", + "NllLossModuleBackward_basic", + "NllLossModuleBackward_ignore_index", + "NllLossModule_1D_basic", + "NllLossModule_basic", + "NllLossModule_ignore_index_out_of_bounds_basic", + "NllLossModule_mean_basic", + "NllLossModule_sum_basic", + "NormScalarComplexModule_basic", + "NormScalarModule_basic", + "NormScalarOptDimKeepDimComplexModule_basic", + "NormScalarOptDimKeepDimModule_basic", + "NormScalarOptDimModule_basic", + "NormalFunctionalModule_basic", + "NormalizeModule_basic", + "NumToTensorFloatModule_basic", + "NumToTensorIntModule_basic", + "NumelModule_basic", + "NumelZeroRankModule_basic", + "OneHotModule_basic", + "OnesLikeModule_defaultDtype", + "OnesLikeModule_falsePinMemory", + "OnesLikeModule_float", + "OnesLikeModule_int", + "PadModule_basic", + "PadWithNoneValModule_basic", + "PermuteNegativeIndexModule_basic", + "PixelShuffleModuleFullDynamic_basic", + "PixelShuffleModuleSpatiallyDynamic_basic", + "PixelShuffleModuleSpatiallyStatic_basic", + "PixelShuffleModuleStaticRank3Int64_basic", + "PixelShuffleModuleStaticRank4Float32_basic", + "PowIntFloatModule_basic", + "PrimMaxIntModule_basic", + "PrimMinIntDynamicModule_basic", + "PrimMinIntModule_basic", + "PrimsConvertElementTypeModule_basic", + "PrimsIotaModule_basic", + "PrimsSqueezeEmptyDimensionsModule_basic", + "PrimsSqueezeModule_basic", + "PrimsViewOfModule_basic", + "PrimsViewOfZeroRankModule_basic", + "QuantizedBatchedInputSingleLayer_basic", + "QuantizedMLP_basic", + "QuantizedNoLayer_basic", + "QuantizedReluInt32_basic", + "QuantizedReluInt8_basic", + "QuantizedReluUint8_basic", + "QuantizedSingleLayer_basic", + "RandIntDtypeModule_basic", + "RandIntLowDtypeModule_basic", + "RandIntLowModule_basic", + "RandIntModule_basic", + "RandIntPinMemoryModule_basic", + "RandLikeDtypeModule_basic", + "RandLikeModule_basic", + "RandModule_basic", + "RandnDtypeDeviceModule_basic", + "RandnGeneratorF64Module_basic", + "RandnGeneratorModule_basic", + "RandnLikeDtypeModule_basic", + "RandnLikeModule_basic", + "RandnModule_basic", + "ReduceAllBoolModule_basic", + "ReduceAllDimBool_basic", + "ReduceAllDimEmpty_basic", + "ReduceAllDimFloat_basic", + "ReduceAllDimInt_basic", + "ReduceAllFloatModule_basic", + "ReduceAllIntModule_basic", + "ReduceAmaxKeepDim_basic", + "ReduceAmaxMultiDim_basic", + "ReduceAmaxOutOfOrderDim_basic", + "ReduceAmaxSingleDim_basic", + "ReduceAnyBoolModule_basic", + "ReduceAnyFloatModule_basic", + "ReduceAnyIntModule_basic", + "ReduceFrobeniusNormComplexModule_basic", + "ReduceL1NormComplexModule_basic", + "ReduceL1NormModule_basic", + "ReduceL1NormWithDTypeModule_basic", + "ReduceL2NormComplexModule_basic", + "ReduceL2NormModule_basic", + "ReduceL3NormAllDimsModule_basic", + "ReduceL3NormKeepDimComplexModule_basic", + "ReduceL3NormKeepDimModule_basic", + "ReduceLN3NormModule_basic", + "ReduceMaxAllDims_basic", + "ReduceMaxAlongDimNegative_basic", + "ReduceMaxAlongDimSignedInt_basic", + "ReduceMaxAlongDimUnsignedInt_basic", + "ReduceMaxAlongDim_basic", + "ReduceMaxFloatModule_basic", + "ReduceMaxKeepDimReturnBoth_basic", + "ReduceMaxKeepDim_basic", + "ReduceMaxNegativeDim_basic", + "ReduceMaxSignedIntModule_basic", + "ReduceMaxUnsignedIntModule_basic", + "ReduceMinAlongDimNegative_basic", + "ReduceMinAlongDimSignedInt_basic", + "ReduceMinAlongDimUnsignedInt_basic", + "ReduceMinAlongDim_basic", + "ReduceMinFloatModule_basic", + "ReduceMinKeepDimReturnBoth_basic", + "ReduceMinKeepDim_basic", + "ReduceMinSignedIntModule_basic", + "ReduceMinUnsignedIntModule_basic", + "ReduceProdDimIntFloatModule_basic", + "ReduceProdDtypeFloatModule_basic", + "ReduceProdDtypeIntModule_basic", + "ReduceProdElementTypeBoolModule_basic", + "ReduceProdFloatModule_basic", + "ReduceProdSignedIntModule_basic", + "ReduceProdUnsignedIntModule_basic", + "ReduceSumDimIntListDtypeFloatModule_basic", + "ReduceSumDimIntListDtypeIntModule_basic", + "ReduceSumDimIntListElementTypeBoolModule_basic", + "ReduceSumDimIntListEmptyDimModule_basic", + "ReduceSumDtypeFloatModule_basic", + "ReduceSumDtypeIntModule_basic", + "ReduceSumElementTypeBoolModule_basic", + "ReduceSumFloatModule_basic", + "ReduceSumSignedIntModule_basic", + "ReduceSumUnsignedIntModule_basic", + "ReflectionPad1dModule2dInput_Right", + "ReflectionPad1dModule2dInput_basic", + "ReflectionPad1dModule3dInput_Left", + "ReflectionPad1dModule3dInput_basic", + "ReflectionPad2dModule_Bottom", + "ReflectionPad2dModule_Left", + "ReflectionPad2dModule_Right", + "ReflectionPad2dModule_Top", + "ReflectionPad2dModule_basic", + "RepeatModule_basic", + "ReplicationPad2dModule_basic", + "ReplicationPad2dModule_bottom0", + "ReplicationPad2dModule_left0", + "ReplicationPad2dModule_right0", + "ReplicationPad2dModule_top0", + "ResNet18Module_basic", + "ResNet18StaticModule_basic", + "ReshapeAliasCollapseModule_basic", + "ReshapeAliasExpandModule_basic", + "ReshapeCollapseModule_basic", + "ReshapeDynamicModule_basic", + "ReshapeExpandModule_basic", + "RollModule_basic", + "RsubIntModule_noalpha_basic", + "ScalarConstantTupleModule_basic", + "ScalarImplicitFloatModule_basic", + "ScalarImplicitIntModule_basic", + "ScaledDotProductAttentionSameModule_basic", + "ScatterReduceFloatMaxModule", + "ScatterReduceFloatMaxModuleIncludeSelf", + "ScatterReduceFloatMeanModule", + "ScatterReduceFloatMeanModuleIncludeSelf", + "ScatterReduceFloatMinModule", + "ScatterReduceFloatMinModuleIncludeSelf", + "ScatterReduceFloatProdModule", + "ScatterReduceFloatProdModuleIncludeSelf", + "ScatterReduceFloatSumModule", + "ScatterReduceFloatSumModuleIncludeSelf", + "ScatterReduceIntMaxModule", + "ScatterReduceIntMaxModuleIncludeSelf", + "ScatterReduceIntMeanModule", + "ScatterReduceIntMeanModuleIncludeSelf", + "ScatterReduceIntMinModule", + "ScatterReduceIntMinModuleIncludeSelf", + "ScatterReduceIntProdModule", + "ScatterReduceIntProdModuleIncludeSelf", + "ScatterReduceIntSumModule", + "ScatterReduceIntSumModuleIncludeSelf", + "ScatterSrcModule_basic", + "ScatterSrcStaticModule_basic", + "ScatterValueFloatModule_basic", + "ScatterValueIntModule_basic", + "SelectIntModule_basic", + "SelectIntNegativeDimAndIndexStaticModule_basic", + "SelectScattertModule_basic", + "SelectScattertStaticModule_basic", + "SliceCopyEndGreaterThanDimSize_Module_basic", + "SliceCopyNegative_Module_basic", + "SliceCopyNonZeroDim_Module_basic", + "SliceCopy_Module_basic", + "SliceEndSleStartModule_basic", + "SliceModule_basic", + "SliceNegIdxModule_basic", + "SliceOutOfLowerBoundEndIndexModule_basic", + "SliceOutOfLowerBoundStartIndexModule_basic", + "SliceOutOfUpperBoundIndexModule_basic", + "SliceScatterModule_basic", + "SliceScatterNegativeDimModule_basic", + "SliceScatterNegativeEndModule_basic", + "SliceScatterStaticModule_basic", + "SliceScatterStepVariationModule_basic", + "SliceScatterZeroDimModule_basic", + "SliceSingleIdxModule_basic", + "SliceSizeTwoStepModule_basic", + "SliceStartEqEndModule_basic", + "SoftmaxBackwardModule_basic", + "SoftmaxIntArgTypeF64Module_basic", + "SoftmaxIntModule_basic", + "SoftmaxIntNegDimModule_basic", + "SoftmaxIntNonNoneDtypeModule_basic", + "SoftplusModule_basic", + "SortIntListReverse_basic", + "SortIntList_basic", + "SortTensorDescending_basic", + "SortTensorInteger_basic", + "SortTensorNegativeDimension_basic", + "SortTensorSpecificDimension_basic", + "SortTensor_basic", + "SplitDimDynamicModule_basic", + "SplitDimStaticModule_basic", + "SplitWithSizes_Module_basic", + "SqrtIntConstantModule_basic", + "SqrtIntModule_basic", + "SqueezeDimModule_dynamic", + "SqueezeDimModule_negDim", + "StdBiasedModule_basic", + "StdCorrectionAllDimReduceModule_basic", + "StdCorrectionEmptyDimModule_basic", + "StdCorrectionKeepDimModule_basic", + "StdCorrectionLargeInputModule_basic", + "StdCorrectionModule_basic", + "StdCorrectionNoneModule_basic", + "StdCorrectionSingleDimReduceModule_basic", + "StdDimBiasedModule_basic", + "StdDimEmptyDimModule_basic", + "StdDimKeepDimFalseModule_basic", + "StdDimKeepDimTrueModule_basic", + "StdDimNoneDimModule_basic", + "StdUnbiasedModule_basic", + "SubFloatModule_basic", + "SubIntModule_basic", + "TanhBackward_basic", + "TensorToBoolZeroRank_basic", + "TensorToBool_basic", + "TensorToFloatZeroRank_basic", + "TensorToFloat_basic", + "TensorToIntZeroRank_basic", + "TensorToInt_basic", + "TensorsConcatModule_basic", + "TensorsConcatNegativeDimModule_basic", + "TensorsConcatPromoteDTypeModule_basic", + "TensorsStackModule_basic", + "TensorsStackNegativeDimModule_basic", + "TensorsStackPromoteDTypeModule_basic", + "TensorsStackSingleElementListModule_basic", + "TestMultipleTensorAndPrimitiveTypesReturn_basic", + "Threshold1dFloatModule_basic", + "Threshold1dIntI32Module_basic", + "Threshold1dIntModule_basic", + "Threshold2dFloatModule_basic", + "Threshold2dIntModule_basic", + "Threshold3dFloatModule_basic", + "Threshold3dIntModule_basic", + "ThresholdBackward1dFloatModule_basic", + "ThresholdBackward1dIntModule_basic", + "ThresholdBackward1dMixedModule_basic", + "ThresholdBackward2dFloatModule_basic", + "ThresholdBackward2dIntModule_basic", + "ThresholdBackward2dMixedModule_basic", + "ThresholdBackward3dFloatModule_basic", + "ThresholdBackward3dIntModule_basic", + "ThresholdBackward3dMixedModule_basic", + "TileBigDimsSizeModule_basic", + "TileSmallDimsSizeModule_basic", + "ToCopyBoolDTypeStaticModule_basic", + "ToCopyModule_basic", + "ToCopyWithDTypeFalsePinMemoryModule_basic", + "ToCopyWithDTypeModule_basic", + "ToDtypeLayoutCPUModule_basic", + "ToDtypeLayoutNoneModule_basic", + "ToDtypeLayoutStridedModule_basic", + "TorchPrimLoopForLikeModule_basic", + "TorchPrimLoopWhileLikeModule_basic", + "TraceModule_basic", + "TraceModule_empty", + "TraceModule_nonsquare", + "TraceSignedIntModule_basic", + "TraceUnsignedIntModule_basic", + "TraceUnsignedIntModule_empty", + "TriuBroadcastModule_basic", + "TriuModule_basic", + "TupleModule_basic", + "TypeAsDifferentModule_basic", + "TypeConversionF32ToF64Module_basic", + "TypeConversionF64ToF32Module_basic", + "TypeConversionI1ToF32Module_basic", + "TypeConversionI1ToF64Module_basic", + "TypeConversionI1ToI32Module_basic", + "TypeConversionI1ToI64Module_basic", + "TypeConversionI32ToI64Module_basic", + "TypeConversionI64ToI32Module_basic", + "TypePromotionDifferentCategoryModule_basic", + "TypePromotionSameCategoryDifferentWidthModule_basic", + "TypePromotionZeroRankHigherCategoryModule_basic", + "UnflattenIntNegativeOneDimStaticModule_basic", + "UnflattenIntNegativeOneSizeStaticModule_basic", + "UnflattenIntStaticModule_basic", + "UnflattenStaticModule_basic", + "UniformModule_basic", + "UniformNoCorrelationModule_basic", + "UniformStaticShapeModule_basic", + "UnsafeIndexPutHackedTwin1DFloatNonAccumulateModule_basic", + "UnsafeView1DFoldModule_basic", + "UnsafeViewCollapseDynamicWithAtenSizeIntModule_basic", + "UnsafeViewCollapseModule_basic", + "UnsafeViewDynamicExpandModule_basic", + "UnsafeViewDynamicExpandWithAtenSizeIntModule_basic", + "UnsafeViewExpandModule_basic", + "UpSampleNearest2dBackwardScalesNone_basic", + "UpSampleNearest2dBackward_basic", + "UpSampleNearest2dDynamicFactor_basic", + "UpSampleNearest2dDynamicSize_basic", + "UpSampleNearest2dStaticFactor_basic", + "UpSampleNearest2dStaticSize_basic", + "UpSampleNearest2d_basic", + "VarBiasedModule_basic", + "VarCorrectionAllDimReduceModule_basic", + "VarCorrectionEmptyDimModule_basic", + "VarCorrectionKeepDimModule_basic", + "VarCorrectionLargeInputModule_basic", + "VarCorrectionModule_basic", + "VarCorrectionNoneModule_basic", + "VarCorrectionSingleDimReduceModule_basic", + "VarDimAllDimReduceModule_basic", + "VarDimBiasedModule_basic", + "VarDimEmptyDimModule_basic", + "VarDimModule_basic", + "VarDimMultiDimModule_basic", + "VarDimNegativeModule_basic", + "VarDimNoneDimModule_basic", + "VarDimSingleDimModule_basic", + "VarDimUnbiasedModule_basic", + "VarMeanBiasedModule_basic", + "VarMeanCorrectionModule_basic", + "VarMeanCorrectionNoneModule_basic", + "VarMeanDimBiasedModule_basic", + "VarMeanDimModule_basic", + "VarMeanUnbiasedModule_basic", + "VarUnbiasedModule_basic", + "View1DFoldModule_basic", + "ViewCollapseDynamicWithAtenSizeIntModule_basic", + "ViewCollapseModule_basic", + "ViewDynamicExpandCollapseModule_basic", + "ViewDynamicExpandCollapseWithAtenIntModule_basic", + "ViewDynamicExpandCollapseWithParallelUnknownDimModule_basic", + "ViewDynamicExpandModule_basic", + "ViewDynamicExpandWithAtenSizeIntModule_basic", + "ViewExpandDynamicDimModule_basic", + "ViewFlattenAndExpandModule_basic", + "ViewNoChange1dModule_basic", + "ViewNoChange2dModule_basic", + "ViewNoChange3dModule_basic", + "ViewSizeDimFollowedByCollapsedOnesModule_basic", + "ViewSizeDimFollowedByExpandedOnesModule_basic", + "ViewSizeDimLedAndFollowedByCollapsedOnesModule_basic", + "ViewSizeDimLedAndFollowedByExpandedOnesModule_basic", + "ViewSizeDimLedByCollapsedOnesModule_basic", + "ViewSizeDimLedByExpandedOnesModule_basic", + "ViewSizeFromOtherTensor_basic", + "ZeroFloat32Module_basic", + "ZeroInt32Module_basic", + "ZeroInt64Module_basic", + "ZerosLikeModule_defaultDtype", + "ZerosLikeModule_falsePinMemory", + "ZerosLikeModule_float", + "ZerosLikeModule_int", + "_Convolution2DAllFalseModule_basic", + "_Convolution2DBenchmarkModule_basic", + "_Convolution2DCudnnModule_basic", + "_Convolution2DDeterministicModule_basic", + "_Convolution2DTF32Module_basic", + "_ConvolutionDeprecated2DAllFalseModule_basic", + "_ConvolutionDeprecated2DBenchmarkModule_basic", + "_ConvolutionDeprecated2DCudnnModule_basic", + "_ConvolutionDeprecated2DDeterministicModule_basic", + "_LogSoftmaxModule_basic", + "_SoftmaxModule_basic", +} diff --git a/projects/pt1/python/torch_mlir_e2e_test/configs/onnx_backend.py b/projects/pt1/python/torch_mlir_e2e_test/configs/onnx_backend.py index 5402c7243e00..de39475b0dbb 100644 --- a/projects/pt1/python/torch_mlir_e2e_test/configs/onnx_backend.py +++ b/projects/pt1/python/torch_mlir_e2e_test/configs/onnx_backend.py @@ -11,7 +11,6 @@ import torch import torch_mlir -from torch_mlir_e2e_test.onnx_backends.abc import OnnxBackend from torch_mlir_e2e_test.framework import TestConfig, Trace, TraceItem from torch_mlir_e2e_test.utils import convert_annotations_to_placeholders from .utils import ( @@ -22,6 +21,20 @@ from torch_mlir.extras import onnx_importer from torch_mlir.dialects import torch as torch_d from torch_mlir.ir import Context, Module +from torch_mlir.compiler_utils import ( + OutputType, + run_pipeline_with_repro_report, + lower_mlir_module, +) + +# The pipeline of func.func passes that lower the ONNX backend contract to the +# Linalg-on-Tensors backend contract accepted by RefBackend or another user +# defined backend. +ONNX_TO_TORCH_FUNC_PIPELINE = ",".join( + [ + "convert-torch-onnx-to-torch", + ] +) def import_onnx(contents): @@ -71,6 +84,33 @@ def convert_onnx(model, inputs): return import_onnx(buffer) +def _module_lowering( + verbose, + output_type, + torch_mod, +): + # Lower from ONNX to Torch + run_pipeline_with_repro_report( + torch_mod, + f"builtin.module(func.func({ONNX_TO_TORCH_FUNC_PIPELINE}))", + "Lowering Onnx backend contract to Linalg-on-Tensors backend contract", + ) + + backend_legal_ops = [ + "aten.flatten.using_ints", + "aten.adaptive_avg_pool1d", + "aten.unflatten.int", + ] + option_string = "{backend-legal-ops=" + ",".join(backend_legal_ops) + "}" + run_pipeline_with_repro_report( + torch_mod, + f"builtin.module(torch-lower-to-backend-contract{option_string})", + "Lowering TorchFX IR -> Torch Backend IR", + ) + + return lower_mlir_module(verbose, output_type, torch_mod) + + class OnnxBackendTestConfig(TestConfig): """Base class for TestConfig's that are implemented with ONNX. @@ -78,15 +118,24 @@ class OnnxBackendTestConfig(TestConfig): reaching the ONNX abstraction level. """ - def __init__(self, backend: OnnxBackend, use_make_fx: bool = False): + def __init__( + self, + backend, + use_make_fx: bool = False, + output_type="linalg-on-tensors", + ): super().__init__() self.backend = backend self.use_make_fx = use_make_fx + self.output_type = output_type - def compile(self, program: torch.nn.Module) -> Any: + def compile(self, program: torch.nn.Module, verbose: bool = False) -> Any: example_args = convert_annotations_to_placeholders(program.forward) onnx_module = convert_onnx(program, example_args) - compiled_module = self.backend.compile(onnx_module) + backend_module = _module_lowering( + verbose, OutputType.get(self.output_type), onnx_module + ) + compiled_module = self.backend.compile(backend_module) return compiled_module def run(self, artifact: Any, trace: Trace) -> Trace: diff --git a/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/__init__.py b/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/abc.py b/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/abc.py deleted file mode 100644 index 7e12f8b15d7d..000000000000 --- a/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/abc.py +++ /dev/null @@ -1,50 +0,0 @@ -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# Also available under a BSD-style license. See LICENSE. - -import abc -from typing import TypeVar - -import torch - -from torch_mlir.ir import Module - -# A type shared between the result of `OnnxBackend.compile` and the -# input to `OnnxBackend.load`. Each backend will likely have a -# different definition of this type. -CompiledArtifact = TypeVar("CompiledArtifact") - -# A wrapper around a backend-specific loaded program representation -# that uniformly translates the `x.method(...)` interface expected of -# Torch modules into appropriate lower-level operations. -Invoker = TypeVar("Invoker") - - -class OnnxBackend(abc.ABC): - """The interface to an ONNX backend. - - Backends are recommended to raise meaningful exceptions in case of error, - ideally with easy reproduction instructions. - """ - - @abc.abstractmethod - def compile(self, module: Module) -> CompiledArtifact: - """Compile the provided MLIR module into a compiled artifact. - - The module adheres to the ONNX backend contract - (see the VerifyOnnxBackendContract pass). - - The compiled artifact can be any type, but must be correctly - interpreted by the `load` method. - """ - - @abc.abstractmethod - def load(self, artifact: CompiledArtifact) -> Invoker: - """Load the compiled artifact into a uniformly invokable form. - - The compiled artifact is the result of a previous call to `compile`. - - See the description of `Invoker` for the requirements on the returned - type. - """ diff --git a/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/linalg_on_tensors.py b/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/linalg_on_tensors.py deleted file mode 100644 index 30129c7510ef..000000000000 --- a/projects/pt1/python/torch_mlir_e2e_test/onnx_backends/linalg_on_tensors.py +++ /dev/null @@ -1,80 +0,0 @@ -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# Also available under a BSD-style license. See LICENSE. - - -from torch_mlir.compiler_utils import ( - run_pipeline_with_repro_report, - lower_mlir_module, - OutputType, -) -from torch_mlir.ir import * -from torch_mlir.passmanager import * - -from torch_mlir_e2e_test.linalg_on_tensors_backends.refbackend import ( - RefBackendLinalgOnTensorsBackend, -) - -from .abc import OnnxBackend - -__all__ = [ - "LinalgOnTensorsOnnxBackend", -] - -# The pipeline of func.func passes that lower the ONNX backend contract to the -# Linalg-on-Tensors backend contract accepted by RefBackend. -ONNX_TO_TORCH_FUNC_PIPELINE = ",".join( - [ - "convert-torch-onnx-to-torch", - ] -) - - -class LinalgOnTensorsOnnxBackend(OnnxBackend): - """Main entry-point for the linalg-on-tensors based ONNX backend. - - This currently uses the linalg-on-tensors RefBackend for actual execution. - """ - - def __init__(self): - super().__init__() - self.refbackend = RefBackendLinalgOnTensorsBackend() - - def compile(self, imported_module: Module): - """Compiles an imported module that satisfied the ONNX backend contract. - - Args: - imported_module: The MLIR module consisting of ONNX operations wrapped by - torch.operator. - Returns: - An opaque, backend specific compiled artifact object that can be - passed to `load`. - """ - run_pipeline_with_repro_report( - imported_module, - f"builtin.module(func.func({ONNX_TO_TORCH_FUNC_PIPELINE}))", - "Lowering Onnx backend contract to Linalg-on-Tensors backend contract", - ) - - backend_legal_ops = [ - "aten.flatten.using_ints", - "aten.adaptive_avg_pool1d", - "aten.unflatten.int", - ] - option_string = "{backend-legal-ops=" + ",".join(backend_legal_ops) + "}" - run_pipeline_with_repro_report( - imported_module, - f"builtin.module(torch-lower-to-backend-contract{option_string})", - "Lowering TorchFX IR -> Torch Backend IR", - ) - - imported_module = lower_mlir_module( - False, OutputType.LINALG_ON_TENSORS, imported_module - ) - compiled_module = self.refbackend.compile(imported_module) - return compiled_module - - def load(self, module): - """Loads a compiled artifact into the runtime.""" - return self.refbackend.load(module)