From ac418d1f45d562bf9e9675bf69606c7d718e2432 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 20 Jun 2024 19:24:08 -0700 Subject: [PATCH] Integrate llvm/llvm-project@27ac46e6bea2 (#17662) Updated to llvm/llvm-project@27ac46e6bea2 * Used LLVM `MathExtras.h` to replace MLIR one * Updated `applySignatureConversion` usage Updated to openxla/stablehlo@dd48ec5 * `chlo.minimum_broadcast_shapes` op was removed https://github.com/openxla/stablehlo/pull/2287 * `chlo.dynamic_reshape` op was removed https://github.com/openxla/stablehlo/pull/2286 * Added batching dims to scatter dims https://github.com/openxla/stablehlo/pull/2259 Updated to llvm/torch-mlir@77d7f64 --------- Co-authored-by: hanhanW Co-authored-by: Rob Suderman Co-authored-by: Quinn Dawkins Co-authored-by: Nirvedh Meshram --- .../onnx_cpu_llvm_sync.json | 17 +-------- .../external_test_suite/onnx_gpu_cuda.json | 17 +-------- .../onnx_gpu_rocm_rdna3.json | 18 +-------- .../external_test_suite/onnx_gpu_vulkan.json | 17 ++++++--- .../StableHLO/Conversion/LegalizeCHLO.cpp | 38 +------------------ .../Preprocessing/StableHLOToStableHLO.cpp | 11 ++++-- .../StableHLOToIREEInputDialects.cpp | 2 +- .../Conversion/StableHLOToLinalg.cpp | 12 +++--- .../Conversion/StableHLOToLinalgExt.cpp | 7 ++-- .../Conversion/StableHLOToLinalgReduce.cpp | 6 +-- .../TOSA/InputConversion/Converti48Toi64.cpp | 2 +- .../TOSA/InputConversion/StripSignedness.cpp | 2 +- .../Torch/InputConversion/FuncConversion.cpp | 18 +++++++-- .../test/auto_input_conversion.mlir | 9 ----- .../test/bitcast_quant_tensor.mlir | 4 +- .../input/Torch/torch-mlir/CMakeLists.txt | 4 +- compiler/pyproject.toml | 1 + compiler/setup.py | 1 + compiler/src/iree/compiler/API/BUILD.bazel | 1 + compiler/src/iree/compiler/API/CMakeLists.txt | 2 + compiler/src/iree/compiler/API/api_exports.c | 36 ++++++++++++++++++ .../src/iree/compiler/API/api_exports.def | 18 +++++++++ compiler/src/iree/compiler/API/api_exports.ld | 18 +++++++++ .../iree/compiler/API/api_exports.macos.lst | 18 +++++++++ .../src/iree/compiler/API/generate_exports.py | 1 + .../Codegen/Common/ConvertBf16ArithToF32.cpp | 2 +- .../Common/ConvertBf16ToUInt16Buffers.cpp | 3 +- .../Common/ForOpCanonicalizationPass.cpp | 7 +--- .../GPU/GPUDistributeSharedMemoryCopy.cpp | 5 +-- .../Codegen/Common/TypePropagationPass.cpp | 12 ++++-- .../test/decompose_pack_unpack_ops.mlir | 25 ++---------- .../Dialect/GPU/Transforms/Transforms.cpp | 20 +++++----- .../LLVMGPUCastAddressSpaceFunction.cpp | 11 +----- .../Utils/PrefetchSharedMemoryCopy.cpp | 4 +- .../Codegen/SPIRV/SPIRVVectorizeLoadStore.cpp | 2 +- .../GPU/AbstractGemmLikeStrategy.cpp | 4 +- .../TransformStrategies/GPU/CopyMapping.cpp | 4 +- .../TransformStrategies/GPU/MappingInfo.cpp | 4 +- .../GPU/MatmulTensorCoreStrategy.h | 2 - .../TransformStrategies/GPU/Strategies.cpp | 6 +-- .../Dialect/Encoding/IR/EncodingOps.cpp | 12 ------ .../Dialect/LinalgExt/IR/LinalgExtOps.cpp | 10 ++--- .../Conversion/VMToEmitC/ConvertVMToEmitC.cpp | 2 +- .../Common/ConvertPrimitiveType.cpp | 2 +- .../Common/IREEImportPublic.cpp | 2 +- .../iree/runtime/build_requirements.txt | 1 + third_party/llvm-project | 2 +- third_party/stablehlo | 2 +- third_party/torch-mlir | 2 +- 49 files changed, 205 insertions(+), 221 deletions(-) diff --git a/build_tools/pkgci/external_test_suite/onnx_cpu_llvm_sync.json b/build_tools/pkgci/external_test_suite/onnx_cpu_llvm_sync.json index 258ca1c13c55..f216111f18a7 100644 --- a/build_tools/pkgci/external_test_suite/onnx_cpu_llvm_sync.json +++ b/build_tools/pkgci/external_test_suite/onnx_cpu_llvm_sync.json @@ -30,8 +30,6 @@ "test_ai_onnx_ml_label_encoder_string_int_no_default", "test_ai_onnx_ml_label_encoder_tensor_value_only_mapping", "test_averagepool_2d_dilations", - "test_averagepool_2d_pads", - "test_averagepool_2d_precomputed_pads", "test_averagepool_2d_precomputed_same_upper", "test_averagepool_2d_same_lower", "test_averagepool_2d_same_upper", @@ -134,8 +132,6 @@ "test_dequantizelinear_e4m3fn_float16", "test_dequantizelinear_e4m3fn_zero_point", "test_dequantizelinear_e5m2", - "test_dequantizelinear_int16", - "test_dequantizelinear_uint16", "test_det_2d", "test_det_nd", "test_dft", @@ -260,7 +256,6 @@ "test_quantizelinear_blocked", "test_quantizelinear_e4m3fn", "test_quantizelinear_e5m2", - "test_quantizelinear_int16", "test_quantizelinear_uint16", "test_range_float_type_positive_delta_expanded", "test_range_int32_type_negative_delta_expanded", @@ -373,12 +368,9 @@ "test_resize_downsample_scales_cubic_align_corners", "test_resize_downsample_scales_cubic_antialias", "test_resize_downsample_scales_linear_antialias", - "test_resize_downsample_scales_linear_half_pixel_symmetric", - "test_resize_downsample_scales_nearest", "test_resize_downsample_sizes_cubic", "test_resize_downsample_sizes_cubic_antialias", "test_resize_downsample_sizes_linear_antialias", - "test_resize_downsample_sizes_nearest", "test_resize_downsample_sizes_nearest_not_larger", "test_resize_downsample_sizes_nearest_not_smaller", "test_resize_tf_crop_and_resize", @@ -388,17 +380,13 @@ "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside", "test_resize_upsample_scales_cubic_align_corners", "test_resize_upsample_scales_cubic_asymmetric", - "test_resize_upsample_scales_linear_half_pixel_symmetric", - "test_resize_upsample_scales_nearest", "test_resize_upsample_scales_nearest_axes_2_3", "test_resize_upsample_scales_nearest_axes_3_2", "test_resize_upsample_sizes_cubic", - "test_resize_upsample_sizes_nearest", "test_resize_upsample_sizes_nearest_axes_2_3", "test_resize_upsample_sizes_nearest_axes_3_2", - "test_resize_upsample_sizes_nearest_ceil_half_pixel", + "test_resize_upsample_sizes_nearest_floor_align_corners", "test_resize_upsample_sizes_nearest_not_larger", - "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric", "test_reversesequence_batch", "test_reversesequence_time", "test_rnn_seq_length", @@ -537,12 +525,10 @@ "test_unique_sorted_with_axis_3d", "test_unique_sorted_with_negative_axis", "test_unique_sorted_without_axis", - "test_upsample_nearest", "test_wrap_pad" ], "expected_run_failures": [ "test_asin", - "test_averagepool_2d_ceil", "test_bernoulli", "test_bernoulli_double", "test_bernoulli_double_expanded", @@ -608,7 +594,6 @@ "test_reduce_min_empty_set", "test_reduce_sum_empty_set_non_reduced_axis_zero", "test_resize_downsample_scales_linear_align_corners", - "test_resize_upsample_sizes_nearest_floor_align_corners", "test_scatter_elements_with_negative_indices", "test_sce_mean_no_weight_ii", "test_sce_mean_no_weight_ii_log_prob", diff --git a/build_tools/pkgci/external_test_suite/onnx_gpu_cuda.json b/build_tools/pkgci/external_test_suite/onnx_gpu_cuda.json index bead5fe62684..218f5683b80a 100644 --- a/build_tools/pkgci/external_test_suite/onnx_gpu_cuda.json +++ b/build_tools/pkgci/external_test_suite/onnx_gpu_cuda.json @@ -36,8 +36,6 @@ "test_ai_onnx_ml_label_encoder_string_int_no_default", "test_ai_onnx_ml_label_encoder_tensor_value_only_mapping", "test_averagepool_2d_dilations", - "test_averagepool_2d_pads", - "test_averagepool_2d_precomputed_pads", "test_averagepool_2d_precomputed_same_upper", "test_averagepool_2d_same_lower", "test_averagepool_2d_same_upper", @@ -140,8 +138,6 @@ "test_dequantizelinear_e4m3fn_float16", "test_dequantizelinear_e4m3fn_zero_point", "test_dequantizelinear_e5m2", - "test_dequantizelinear_int16", - "test_dequantizelinear_uint16", "test_det_2d", "test_det_nd", "test_dft", @@ -263,7 +259,6 @@ "test_quantizelinear_blocked", "test_quantizelinear_e4m3fn", "test_quantizelinear_e5m2", - "test_quantizelinear_int16", "test_quantizelinear_uint16", "test_range_float_type_positive_delta_expanded", "test_range_int32_type_negative_delta_expanded", @@ -376,12 +371,9 @@ "test_resize_downsample_scales_cubic_align_corners", "test_resize_downsample_scales_cubic_antialias", "test_resize_downsample_scales_linear_antialias", - "test_resize_downsample_scales_linear_half_pixel_symmetric", - "test_resize_downsample_scales_nearest", "test_resize_downsample_sizes_cubic", "test_resize_downsample_sizes_cubic_antialias", "test_resize_downsample_sizes_linear_antialias", - "test_resize_downsample_sizes_nearest", "test_resize_downsample_sizes_nearest_not_larger", "test_resize_downsample_sizes_nearest_not_smaller", "test_resize_tf_crop_and_resize", @@ -391,17 +383,13 @@ "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside", "test_resize_upsample_scales_cubic_align_corners", "test_resize_upsample_scales_cubic_asymmetric", - "test_resize_upsample_scales_linear_half_pixel_symmetric", - "test_resize_upsample_scales_nearest", "test_resize_upsample_scales_nearest_axes_2_3", "test_resize_upsample_scales_nearest_axes_3_2", "test_resize_upsample_sizes_cubic", - "test_resize_upsample_sizes_nearest", "test_resize_upsample_sizes_nearest_axes_2_3", "test_resize_upsample_sizes_nearest_axes_3_2", - "test_resize_upsample_sizes_nearest_ceil_half_pixel", + "test_resize_upsample_sizes_nearest_floor_align_corners", "test_resize_upsample_sizes_nearest_not_larger", - "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric", "test_reversesequence_batch", "test_reversesequence_time", "test_rnn_seq_length", @@ -540,12 +528,10 @@ "test_unique_sorted_with_axis_3d", "test_unique_sorted_with_negative_axis", "test_unique_sorted_without_axis", - "test_upsample_nearest", "test_wrap_pad" ], "expected_run_failures": [ "test_asin", - "test_averagepool_2d_ceil", "test_bernoulli", "test_bernoulli_double", "test_bernoulli_double_expanded", @@ -626,7 +612,6 @@ "test_reduce_sum_square_default_axes_keepdims_example_expanded", "test_reduce_sum_square_default_axes_keepdims_random", "test_reduce_sum_square_default_axes_keepdims_random_expanded", - "test_resize_upsample_sizes_nearest_floor_align_corners", "test_sce_mean_no_weight_ii", "test_sce_mean_no_weight_ii_log_prob", "test_shape_end_1", diff --git a/build_tools/pkgci/external_test_suite/onnx_gpu_rocm_rdna3.json b/build_tools/pkgci/external_test_suite/onnx_gpu_rocm_rdna3.json index 89715d74d95e..e7d30d40e70c 100644 --- a/build_tools/pkgci/external_test_suite/onnx_gpu_rocm_rdna3.json +++ b/build_tools/pkgci/external_test_suite/onnx_gpu_rocm_rdna3.json @@ -31,8 +31,6 @@ "test_ai_onnx_ml_label_encoder_string_int_no_default", "test_ai_onnx_ml_label_encoder_tensor_value_only_mapping", "test_averagepool_2d_dilations", - "test_averagepool_2d_pads", - "test_averagepool_2d_precomputed_pads", "test_averagepool_2d_precomputed_same_upper", "test_averagepool_2d_same_lower", "test_averagepool_2d_same_upper", @@ -135,8 +133,6 @@ "test_dequantizelinear_e4m3fn_float16", "test_dequantizelinear_e4m3fn_zero_point", "test_dequantizelinear_e5m2", - "test_dequantizelinear_int16", - "test_dequantizelinear_uint16", "test_det_2d", "test_det_nd", "test_dft", @@ -258,7 +254,6 @@ "test_quantizelinear_blocked", "test_quantizelinear_e4m3fn", "test_quantizelinear_e5m2", - "test_quantizelinear_int16", "test_quantizelinear_uint16", "test_range_float_type_positive_delta_expanded", "test_range_int32_type_negative_delta_expanded", @@ -371,12 +366,9 @@ "test_resize_downsample_scales_cubic_align_corners", "test_resize_downsample_scales_cubic_antialias", "test_resize_downsample_scales_linear_antialias", - "test_resize_downsample_scales_linear_half_pixel_symmetric", - "test_resize_downsample_scales_nearest", "test_resize_downsample_sizes_cubic", "test_resize_downsample_sizes_cubic_antialias", "test_resize_downsample_sizes_linear_antialias", - "test_resize_downsample_sizes_nearest", "test_resize_downsample_sizes_nearest_not_larger", "test_resize_downsample_sizes_nearest_not_smaller", "test_resize_tf_crop_and_resize", @@ -386,17 +378,13 @@ "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside", "test_resize_upsample_scales_cubic_align_corners", "test_resize_upsample_scales_cubic_asymmetric", - "test_resize_upsample_scales_linear_half_pixel_symmetric", - "test_resize_upsample_scales_nearest", "test_resize_upsample_scales_nearest_axes_2_3", "test_resize_upsample_scales_nearest_axes_3_2", "test_resize_upsample_sizes_cubic", - "test_resize_upsample_sizes_nearest", "test_resize_upsample_sizes_nearest_axes_2_3", "test_resize_upsample_sizes_nearest_axes_3_2", - "test_resize_upsample_sizes_nearest_ceil_half_pixel", + "test_resize_upsample_sizes_nearest_floor_align_corners", "test_resize_upsample_sizes_nearest_not_larger", - "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric", "test_reversesequence_batch", "test_reversesequence_time", "test_rnn_seq_length", @@ -535,12 +523,10 @@ "test_unique_sorted_with_axis_3d", "test_unique_sorted_with_negative_axis", "test_unique_sorted_without_axis", - "test_upsample_nearest", "test_wrap_pad" ], "expected_run_failures": [ "test_asin", - "test_averagepool_2d_ceil", "test_bernoulli", "test_bernoulli_double", "test_bernoulli_double_expanded", @@ -637,7 +623,7 @@ "test_reduce_sum_square_default_axes_keepdims_random", "test_reduce_sum_square_default_axes_keepdims_random_expanded", "test_resize_downsample_scales_linear_align_corners", - "test_resize_upsample_sizes_nearest_floor_align_corners", + "test_resize_downsample_scales_linear_half_pixel_symmetric", "test_scatter_elements_with_negative_indices", "test_sce_mean_no_weight_ii", "test_sce_mean_no_weight_ii_log_prob", diff --git a/build_tools/pkgci/external_test_suite/onnx_gpu_vulkan.json b/build_tools/pkgci/external_test_suite/onnx_gpu_vulkan.json index db27108dc5d9..ad5cb9ddbe26 100644 --- a/build_tools/pkgci/external_test_suite/onnx_gpu_vulkan.json +++ b/build_tools/pkgci/external_test_suite/onnx_gpu_vulkan.json @@ -45,12 +45,18 @@ "test_argmin_negative_axis_keepdims_random_select_last_index", "test_argmin_no_keepdims_example_select_last_index", "test_argmin_no_keepdims_random_select_last_index", + "test_averagepool_2d_ceil", + "test_averagepool_2d_default", "test_averagepool_2d_dilations", "test_averagepool_2d_pads", + "test_averagepool_2d_pads_count_include_pad", "test_averagepool_2d_precomputed_pads", + "test_averagepool_2d_precomputed_pads_count_include_pad", "test_averagepool_2d_precomputed_same_upper", + "test_averagepool_2d_precomputed_strides", "test_averagepool_2d_same_lower", "test_averagepool_2d_same_upper", + "test_averagepool_2d_strides", "test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_False", "test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_True", "test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_False", @@ -132,6 +138,8 @@ "test_constant_pad_axes", "test_constant_pad_negative_axes", "test_conv_with_autopad_same", + "test_convinteger_with_padding", + "test_convinteger_without_padding", "test_convtranspose_autopad_same", "test_convtranspose_kernel_shape", "test_convtranspose_output_shape", @@ -150,8 +158,6 @@ "test_dequantizelinear_e4m3fn_float16", "test_dequantizelinear_e4m3fn_zero_point", "test_dequantizelinear_e5m2", - "test_dequantizelinear_int16", - "test_dequantizelinear_uint16", "test_det_2d", "test_det_nd", "test_dft", @@ -294,7 +300,6 @@ "test_quantizelinear_blocked", "test_quantizelinear_e4m3fn", "test_quantizelinear_e5m2", - "test_quantizelinear_int16", "test_quantizelinear_uint16", "test_range_float_type_positive_delta_expanded", "test_range_int32_type_negative_delta_expanded", @@ -585,7 +590,6 @@ "test_and_bcast4v2d", "test_and_bcast4v4d", "test_asin", - "test_averagepool_2d_ceil", "test_bernoulli", "test_bernoulli_double", "test_bernoulli_double_expanded", @@ -628,8 +632,8 @@ "test_constantofshape_float_ones", "test_constantofshape_int_shape_zero", "test_constantofshape_int_zeros", - "test_convinteger_with_padding", - "test_convinteger_without_padding", + "test_dequantizelinear_int16", + "test_dequantizelinear_uint16", "test_dropout_default_mask_ratio", "test_dynamicquantizelinear", "test_dynamicquantizelinear_expanded", @@ -677,6 +681,7 @@ "test_qlinearmatmul_3D_uint8_float16", "test_qlinearmatmul_3D_uint8_float32", "test_quantizelinear", + "test_quantizelinear_int16", "test_reduce_l1_default_axes_keepdims_example", "test_reduce_l1_default_axes_keepdims_example_expanded", "test_reduce_l1_default_axes_keepdims_random", diff --git a/compiler/plugins/input/StableHLO/Conversion/LegalizeCHLO.cpp b/compiler/plugins/input/StableHLO/Conversion/LegalizeCHLO.cpp index 432fcf2d0c21..8dc2d8dda818 100644 --- a/compiler/plugins/input/StableHLO/Conversion/LegalizeCHLO.cpp +++ b/compiler/plugins/input/StableHLO/Conversion/LegalizeCHLO.cpp @@ -18,7 +18,6 @@ #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/TypeUtilities.h" -#include "mlir/Interfaces/FunctionInterfaces.h" #include "mlir/Support/LogicalResult.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" #include "stablehlo/dialect/BroadcastUtils.h" @@ -443,38 +442,6 @@ struct ConvertSelectOp final } }; -struct ConvertDynamicReshapeOp final - : OpRewritePattern { - using OpRewritePattern::OpRewritePattern; - - LogicalResult matchAndRewrite(mlir::chlo::DynamicReshapeOp op, - PatternRewriter &rewriter) const override { - Location loc = op.getLoc(); - TypedValue tensor = op.getOperand(); - TypedValue shape = op.getOutputShape(); - - auto shapeTy = cast(shape.getType()); - auto resultTy = cast(op.getType()); - - Value inputShape = rewriter.create(loc, tensor); - Value numEls = rewriter.create(loc, inputShape); - Value cstr = - rewriter.create(loc, numEls, shape); - rewriter.replaceOpWithNewOp( - op, cstr, [&](OpBuilder &b, Location l) { - Value computedShape = - b.create(l, shapeTy, - numEls, shape); - SmallVector result; - result.push_back(b.create( - l, resultTy, tensor, computedShape)); - return result; - }); - - return success(); - } -}; - //===----------------------------------------------------------------------===// // Decomposition Patterns. //===----------------------------------------------------------------------===// @@ -2192,7 +2159,6 @@ struct LegalizeChlo final : impl::LegalizeChloBase { ConversionTarget conversionTarget(getContext()); RewritePatternSet conversionPatterns(ctx); conversionTarget.addIllegalDialect(); - conversionTarget.addLegalOp(); conversionTarget.addLegalDialect< mlir::stablehlo::StablehloDialect, mlir::arith::ArithDialect, mlir::shape::ShapeDialect, mlir::scf::SCFDialect, @@ -2239,9 +2205,7 @@ static void populateBroadcastingPatterns(MLIRContext *context, context, patterns, 10); populateForBroadcastingBinaryOp( context, patterns, 5); - patterns - ->add( - context); + patterns->add(context); } static void populateDecompositionPatterns(MLIRContext *context, diff --git a/compiler/plugins/input/StableHLO/Conversion/Preprocessing/StableHLOToStableHLO.cpp b/compiler/plugins/input/StableHLO/Conversion/Preprocessing/StableHLOToStableHLO.cpp index da22c9efd35b..4970994e66f9 100644 --- a/compiler/plugins/input/StableHLO/Conversion/Preprocessing/StableHLOToStableHLO.cpp +++ b/compiler/plugins/input/StableHLO/Conversion/Preprocessing/StableHLOToStableHLO.cpp @@ -601,7 +601,8 @@ struct ScatterImplicitBatch final auto newDimNumbers = mlir::stablehlo::ScatterDimensionNumbersAttr::get( op.getContext(), newUpdateWindowDims, - dimNumbers.getInsertedWindowDims(), + dimNumbers.getInsertedWindowDims(), dimNumbers.getInputBatchingDims(), + dimNumbers.getScatterIndicesBatchingDims(), dimNumbers.getScatterDimsToOperandDims(), dimNumbers.getIndexVectorDim() + 1); @@ -700,7 +701,8 @@ struct ScatterCollapseBatch final auto newDimNumbers = mlir::stablehlo::ScatterDimensionNumbersAttr::get( op.getContext(), newUpdatedWindowDims, - dimNumbers.getInsertedWindowDims(), + dimNumbers.getInsertedWindowDims(), dimNumbers.getInputBatchingDims(), + dimNumbers.getScatterIndicesBatchingDims(), dimNumbers.getScatterDimsToOperandDims(), /*indexVectorDim=*/1); @@ -801,7 +803,8 @@ struct ScatterBatchFirst final : OpRewritePattern { auto newDimNumbers = mlir::stablehlo::ScatterDimensionNumbersAttr::get( op.getContext(), newUpdatedWindowDims, - dimNumbers.getInsertedWindowDims(), + dimNumbers.getInsertedWindowDims(), dimNumbers.getInputBatchingDims(), + dimNumbers.getScatterIndicesBatchingDims(), dimNumbers.getScatterDimsToOperandDims(), /*indexVectorDim=*/indexVectorDim); @@ -939,6 +942,8 @@ struct ScatterMaterializeInsertedDim final auto newDimNumbers = mlir::stablehlo::ScatterDimensionNumbersAttr::get( op.getContext(), newUpdatedWindowDims, newInsertedWindowDims, + dimNumbers.getInputBatchingDims(), + dimNumbers.getScatterIndicesBatchingDims(), dimNumbers.getScatterDimsToOperandDims(), /*indexVectorDim=*/1); diff --git a/compiler/plugins/input/StableHLO/Conversion/StableHLOToIREEInputDialects.cpp b/compiler/plugins/input/StableHLO/Conversion/StableHLOToIREEInputDialects.cpp index 11033379f9f9..0180abbd0749 100644 --- a/compiler/plugins/input/StableHLO/Conversion/StableHLOToIREEInputDialects.cpp +++ b/compiler/plugins/input/StableHLO/Conversion/StableHLOToIREEInputDialects.cpp @@ -416,7 +416,7 @@ struct GenericTypeConvert final : ConversionPattern { return rewriter.notifyMatchFailure(op, "argument type conversion failed"); } - rewriter.applySignatureConversion(newRegion, result); + rewriter.applySignatureConversion(&newRegion->front(), result); } Operation *newOp = rewriter.create(state); rewriter.replaceOp(op, newOp->getResults()); diff --git a/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalg.cpp b/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalg.cpp index 335805d3a7c2..c886df805ec6 100644 --- a/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalg.cpp +++ b/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalg.cpp @@ -1653,7 +1653,7 @@ struct MapOpToGenericConverter final } signatureConverter.addInputs(resultType.getElementType()); - rewriter.applySignatureConversion(®ion, signatureConverter, + rewriter.applySignatureConversion(®ion.front(), signatureConverter, getTypeConverter()); rewriter.replaceOp(op, linalgOp.getResults()); return success(); @@ -1706,7 +1706,7 @@ struct MapOpToMapConverter final : OpConversionPattern { signatureConverter.addInputs(idx, convertedTy); } - rewriter.applySignatureConversion(®ion, signatureConverter, + rewriter.applySignatureConversion(®ion.front(), signatureConverter, getTypeConverter()); auto result = rewriter.createOrFold(loc, resultType, linalgOp.getResults()); @@ -2073,8 +2073,8 @@ struct SelectAndScatterNoOverlapConverter final reduceSignConverter.addInputs(srcETy); reduceSignConverter.addInputs(1, destETy); reduceSignConverter.addInputs(indexETy); - rewriter.applySignatureConversion(&reduceRegion, reduceSignConverter, - getTypeConverter()); + rewriter.applySignatureConversion(&reduceRegion.front(), + reduceSignConverter, getTypeConverter()); // Grab the terminator and use the turned value to now select the // correct index and value. @@ -2179,8 +2179,8 @@ struct SelectAndScatterNoOverlapConverter final scatterSignConverter.addInputs(indexETy); scatterSignConverter.addInputs(0, sourceTy.getElementType()); scatterSignConverter.addInputs(1, sourceTy.getElementType()); - rewriter.applySignatureConversion(&scatterRegion, scatterSignConverter, - getTypeConverter()); + rewriter.applySignatureConversion(&scatterRegion.front(), + scatterSignConverter, getTypeConverter()); auto &scatterBlock = scatterRegion.front(); auto scatterTerminator = scatterBlock.getTerminator(); diff --git a/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgExt.cpp b/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgExt.cpp index d7b2a4ec82ea..a20f872c7b8f 100644 --- a/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgExt.cpp +++ b/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgExt.cpp @@ -189,7 +189,7 @@ struct SortOpConversion final : OpConversionPattern { idx, getTypeConverter()->convertType( getElementTypeOrSelf(argument.getType()))); } - rewriter.applySignatureConversion(®ion, signature_converter); + rewriter.applySignatureConversion(®ion.front(), signature_converter); rewriter.replaceOp(op, sortOp->getResults()); return success(); @@ -281,7 +281,7 @@ struct ScatterOpConversion final // where output[O] maps to block args #1 in linalg_ext.scatter ops. signatureConverter.addInputs(1, argType); signatureConverter.addInputs(0, argType); - rewriter.applySignatureConversion(®ion, signatureConverter); + rewriter.applySignatureConversion(®ion.front(), signatureConverter); rewriter.replaceOp(op, scatterOp->getResults()); return success(); @@ -598,7 +598,8 @@ struct ScanOpConversion final TypeConverter::SignatureConversion signatureConverter(2); signatureConverter.addInputs(0, input0Ty.getElementType()); signatureConverter.addInputs(1, init0Ty.getElementType()); - rewriter.applySignatureConversion(&scanOp.getRegion(), signatureConverter); + rewriter.applySignatureConversion(&scanOp.getRegion().front(), + signatureConverter); rewriter.replaceOp(op, scanOp.getResult(0)); return success(); diff --git a/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgReduce.cpp b/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgReduce.cpp index 8f43f12ad96d..ce8ba53ac83c 100644 --- a/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgReduce.cpp +++ b/compiler/plugins/input/StableHLO/Conversion/StableHLOToLinalgReduce.cpp @@ -201,7 +201,7 @@ struct ReduceOpToGenericConverter final cast(val.getType()).getElementType())); } - rewriter.applySignatureConversion(®ion, signatureConverter, + rewriter.applySignatureConversion(®ion.front(), signatureConverter, getTypeConverter()); rewriter.replaceOp(op, linalgOp.getResults()); return success(); @@ -301,7 +301,7 @@ struct ReduceOpToReduceConverter final // type for new operand number 'idx' + linalgOp.getNumInputs() typeConverter->convertType(val.getElementType())); } - rewriter.applySignatureConversion(®ion, signatureConverter, + rewriter.applySignatureConversion(®ion.front(), signatureConverter, getTypeConverter()); // Cast the result to the correct type. @@ -470,7 +470,7 @@ struct ReduceWindowOpOnTensorsGenericConversion final i, cast(input.getType()).getElementType()); } - rewriter.applySignatureConversion(®ion, signatureConverter, + rewriter.applySignatureConversion(®ion.front(), signatureConverter, getTypeConverter()); rewriter.replaceOp(op, linalgOp.getResults()); return success(); diff --git a/compiler/plugins/input/TOSA/InputConversion/Converti48Toi64.cpp b/compiler/plugins/input/TOSA/InputConversion/Converti48Toi64.cpp index eea538648159..06725dcf082c 100644 --- a/compiler/plugins/input/TOSA/InputConversion/Converti48Toi64.cpp +++ b/compiler/plugins/input/TOSA/InputConversion/Converti48Toi64.cpp @@ -112,7 +112,7 @@ class GenericTypeConvert : public ConversionPattern { TypeConverter::SignatureConversion result(newRegion->getNumArguments()); (void)getTypeConverter()->convertSignatureArgs( newRegion->getArgumentTypes(), result); - rewriter.applySignatureConversion(newRegion, result); + rewriter.applySignatureConversion(&newRegion->front(), result); } Operation *newOp = rewriter.create(state); rewriter.replaceOp(op, newOp->getResults()); diff --git a/compiler/plugins/input/TOSA/InputConversion/StripSignedness.cpp b/compiler/plugins/input/TOSA/InputConversion/StripSignedness.cpp index dc3ba5bf1a9f..d9097e321c61 100644 --- a/compiler/plugins/input/TOSA/InputConversion/StripSignedness.cpp +++ b/compiler/plugins/input/TOSA/InputConversion/StripSignedness.cpp @@ -66,7 +66,7 @@ class GenericTypeConvert : public ConversionPattern { TypeConverter::SignatureConversion result(newRegion->getNumArguments()); (void)getTypeConverter()->convertSignatureArgs( newRegion->getArgumentTypes(), result); - rewriter.applySignatureConversion(newRegion, result); + rewriter.applySignatureConversion(&newRegion->front(), result); } Operation *newOp = rewriter.create(state); rewriter.replaceOp(op, newOp->getResults()); diff --git a/compiler/plugins/input/Torch/InputConversion/FuncConversion.cpp b/compiler/plugins/input/Torch/InputConversion/FuncConversion.cpp index b7b78bc27f68..d9541a723276 100644 --- a/compiler/plugins/input/Torch/InputConversion/FuncConversion.cpp +++ b/compiler/plugins/input/Torch/InputConversion/FuncConversion.cpp @@ -11,17 +11,14 @@ #include "iree/compiler/Dialect/HAL/IR/HALTypes.h" #include "iree/compiler/Dialect/Util/IR/UtilDialect.h" #include "iree/compiler/Dialect/Util/IR/UtilOps.h" -#include "llvm/ADT/SmallPtrSet.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Func/Transforms/FuncConversions.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/BuiltinOps.h" -#include "mlir/IR/IRMapping.h" #include "torch-mlir/Dialect/Torch/IR/TorchOps.h" #include "torch-mlir/Dialect/Torch/IR/TorchTypes.h" #include "torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.h" #include "torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.h" -#include "torch-mlir/Dialect/TorchConversion/Transforms/BackendTypeConversion.h" namespace Torch = mlir::torch::Torch; namespace TorchConversion = mlir::torch::TorchConversion; @@ -103,8 +100,18 @@ Value convertToBuiltinTensor(OpBuilder &builder, Value possibleTorchTensor) { if (isa(ty)) return possibleTorchTensor; + if (auto defining = dyn_cast_or_null( + possibleTorchTensor.getDefiningOp())) { + return defining.getOperand(); + } + Torch::ValueTensorType vtensorType = cast(ty); TensorType builtinTy = vtensorType.toBuiltinTensor(); + if (auto intTy = dyn_cast(builtinTy.getElementType())) { + builtinTy = + builtinTy.clone(builder.getIntegerType(intTy.getIntOrFloatBitWidth())); + } + return builder.create( possibleTorchTensor.getLoc(), builtinTy, possibleTorchTensor); } @@ -357,6 +364,11 @@ LogicalResult ConvertedAsyncFunctionInfo::convertImmutableTensorArg( builtinTensorType = tType; } else if (auto vtType = dyn_cast(torchType)) { builtinTensorType = vtType.toBuiltinTensor(); + if (auto intTy = + dyn_cast(builtinTensorType.getElementType())) { + builtinTensorType = builtinTensorType.clone( + builder.getIntegerType(intTy.getIntOrFloatBitWidth())); + } } else { return emitError(loc) << "unsupported immutable tensor argument: " << torchType; diff --git a/compiler/plugins/input/Torch/InputConversion/test/auto_input_conversion.mlir b/compiler/plugins/input/Torch/InputConversion/test/auto_input_conversion.mlir index 92565195bc33..801b49acac91 100644 --- a/compiler/plugins/input/Torch/InputConversion/test/auto_input_conversion.mlir +++ b/compiler/plugins/input/Torch/InputConversion/test/auto_input_conversion.mlir @@ -2,15 +2,6 @@ // Check that the auto input conversion pipeline uses this plugin. -// CHECK-LABEL: util.func public @simple_add_torch -// CHECK: arith.addf -func.func @simple_add_torch(%arg0: !torch.vtensor<[2],f32>, %arg1: !torch.vtensor<[2],f32>) -> !torch.vtensor<[2],f32> { - %int1 = torch.constant.int 1 - %0 = torch.aten.add.Tensor %arg0, %arg1, %int1 : !torch.vtensor<[2],f32>, !torch.vtensor<[2],f32>, !torch.int -> !torch.vtensor<[2],f32> - return %0 : !torch.vtensor<[2],f32> -} - -// ----- // CHECK-LABEL: util.func public @simple_add_onnx // CHECK: arith.addi diff --git a/compiler/plugins/input/Torch/InputConversion/test/bitcast_quant_tensor.mlir b/compiler/plugins/input/Torch/InputConversion/test/bitcast_quant_tensor.mlir index 1ad40bcf51c5..fad4e7c9194a 100644 --- a/compiler/plugins/input/Torch/InputConversion/test/bitcast_quant_tensor.mlir +++ b/compiler/plugins/input/Torch/InputConversion/test/bitcast_quant_tensor.mlir @@ -8,8 +8,8 @@ func.func @forward(%arg0: !torch.vtensor<[1,1,8],f16>) -> !torch.vtensor<[1,1,8] %zps = torch.vtensor.literal(dense<0.0> : tensor<8x4x1xf16>) : !torch.vtensor<[8,4,1],f16> %bit_width = torch.constant.int 4 %group_size = torch.constant.int 2 - // CHECK: %[[TOBUILTIN:.*]] = torch_c.to_builtin_tensor %[[C0]] : !torch.vtensor<[8,4],ui8> -> tensor<8x4xi8> - // CHECK: %[[BITCAST:.*]] = flow.tensor.bitcast %[[TOBUILTIN]] : tensor<8x4xi8> -> tensor<8x8xi4> + // CHECK: %[[TOBUILTIN:.*]] = torch_c.to_builtin_tensor %[[C0]] : !torch.vtensor<[8,4],ui8> -> tensor<8x4xui8> + // CHECK: %[[BITCAST:.*]] = flow.tensor.bitcast %[[TOBUILTIN]] : tensor<8x4xui8> -> tensor<8x8xi4> // CHECK: %[[TOTORCH:.*]] = torch_c.from_builtin_tensor %[[BITCAST]] : tensor<8x8xi4> -> !torch.vtensor<[8,8],ui4> %output = torch.operator "quant.matmul_rhs_group_quant"(%arg0, %q_rhs, %scales, %zps, %bit_width, %group_size) : (!torch.vtensor<[1,1,8],f16>, !torch.vtensor<[8,4],ui8>, !torch.vtensor<[8,4,1],f16>, !torch.vtensor<[8,4,1],f16>, !torch.int, !torch.int) -> !torch.vtensor<[1,1,8],f16> return %output : !torch.vtensor<[1,1,8],f16> diff --git a/compiler/plugins/input/Torch/torch-mlir/CMakeLists.txt b/compiler/plugins/input/Torch/torch-mlir/CMakeLists.txt index 7a99114cc216..2b96c50b5588 100644 --- a/compiler/plugins/input/Torch/torch-mlir/CMakeLists.txt +++ b/compiler/plugins/input/Torch/torch-mlir/CMakeLists.txt @@ -85,8 +85,8 @@ iree_tablegen_library( TD_FILE "${TORCH_MLIR_ROOT_DIR}/include/torch-mlir/Dialect/Torch/IR/TorchOps.td" OUTS - -gen-dialect-decls Dialect/Torch/IR/TorchDialect.h.inc - -gen-dialect-defs Dialect/Torch/IR/TorchDialect.cpp.inc + -gen-dialect-decls -dialect=torch Dialect/Torch/IR/TorchDialect.h.inc + -gen-dialect-defs -dialect=torch Dialect/Torch/IR/TorchDialect.cpp.inc -gen-op-decls Dialect/Torch/IR/TorchOps.h.inc -gen-op-defs Dialect/Torch/IR/TorchOps.cpp.inc ) diff --git a/compiler/pyproject.toml b/compiler/pyproject.toml index 527e76b5e3f3..a7ed98fdd51f 100644 --- a/compiler/pyproject.toml +++ b/compiler/pyproject.toml @@ -13,5 +13,6 @@ requires = [ "packaging", "pybind11>=2.10.1", "PyYAML", + "sympy", ] build-backend = "setuptools.build_meta" diff --git a/compiler/setup.py b/compiler/setup.py index 6c4ac22adf38..393786e6ee12 100644 --- a/compiler/setup.py +++ b/compiler/setup.py @@ -464,6 +464,7 @@ def find_git_submodule_revision(submodule_path): install_requires=[ "numpy", "PyYAML", + "sympy", ], extras_require={ "onnx": [ diff --git a/compiler/src/iree/compiler/API/BUILD.bazel b/compiler/src/iree/compiler/API/BUILD.bazel index 374982be924b..30764047c4f3 100644 --- a/compiler/src/iree/compiler/API/BUILD.bazel +++ b/compiler/src/iree/compiler/API/BUILD.bazel @@ -43,6 +43,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:CAPIPDL", "@llvm-project//mlir:CAPITransformDialect", "@llvm-project//mlir:CAPITransformDialectTransforms", + "@llvm-project//mlir:CAPITransforms", ], ) diff --git a/compiler/src/iree/compiler/API/CMakeLists.txt b/compiler/src/iree/compiler/API/CMakeLists.txt index 1ff2e9e83c4d..f4047935f93d 100644 --- a/compiler/src/iree/compiler/API/CMakeLists.txt +++ b/compiler/src/iree/compiler/API/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( MLIRCAPIPDL MLIRCAPITransformDialect MLIRCAPITransformDialectTransforms + MLIRCAPITransforms iree::compiler::API::Internal::CompilerDriver iree::compiler::API::Internal::IREECompileToolEntryPoint iree::compiler::API::Internal::IREEMLIRLSPServerToolEntryPoint @@ -70,6 +71,7 @@ set(_EXPORT_OBJECT_LIBS obj.MLIRCAPIGPU obj.MLIRCAPILinalg obj.MLIRCAPIPDL + obj.MLIRCAPITransforms obj.MLIRCAPITransformDialect obj.MLIRCAPITransformDialectTransforms iree_compiler_API_Internal_CompilerDriver.objects diff --git a/compiler/src/iree/compiler/API/api_exports.c b/compiler/src/iree/compiler/API/api_exports.c index 09d8fa325be7..4904c65d5370 100644 --- a/compiler/src/iree/compiler/API/api_exports.c +++ b/compiler/src/iree/compiler/API/api_exports.c @@ -126,6 +126,7 @@ extern void mlirAffineModExprGet(); extern void mlirAffineMulExprGet(); extern void mlirAffineSymbolExprGet(); extern void mlirAffineSymbolExprGetPosition(); +extern void mlirApplyPatternsAndFoldGreedily(); extern void mlirArrayAttrGet(); extern void mlirArrayAttrGetElement(); extern void mlirArrayAttrGetNumElements(); @@ -158,6 +159,7 @@ extern void mlirAttributeIsADictionary(); extern void mlirAttributeIsAElements(); extern void mlirAttributeIsAFlatSymbolRef(); extern void mlirAttributeIsAFloat(); +extern void mlirAttributeIsAGPUObjectAttr(); extern void mlirAttributeIsAInteger(); extern void mlirAttributeIsAIntegerSet(); extern void mlirAttributeIsALocation(); @@ -181,6 +183,7 @@ extern void mlirBlockCreate(); extern void mlirBlockDestroy(); extern void mlirBlockDetach(); extern void mlirBlockEqual(); +extern void mlirBlockEraseArgument(); extern void mlirBlockGetArgument(); extern void mlirBlockGetFirstOperation(); extern void mlirBlockGetNextInRegion(); @@ -349,12 +352,20 @@ extern void mlirFloatAttrGetTypeID(); extern void mlirFloatAttrGetValueDouble(); extern void mlirFloatTF32TypeGetTypeID(); extern void mlirFloatTypeGetWidth(); +extern void mlirFreezeRewritePattern(); +extern void mlirFrozenRewritePatternSetDestroy(); extern void mlirFunctionTypeGet(); extern void mlirFunctionTypeGetInput(); extern void mlirFunctionTypeGetNumInputs(); extern void mlirFunctionTypeGetNumResults(); extern void mlirFunctionTypeGetResult(); extern void mlirFunctionTypeGetTypeID(); +extern void mlirGPUObjectAttrGet(); +extern void mlirGPUObjectAttrGetFormat(); +extern void mlirGPUObjectAttrGetObject(); +extern void mlirGPUObjectAttrGetProperties(); +extern void mlirGPUObjectAttrGetTarget(); +extern void mlirGPUObjectAttrHasProperties(); extern void mlirGetDialectHandle__iree_input__(); extern void mlirGetDialectHandle__transform__(); extern void mlirIREELinalgTransformRegisterPasses(); @@ -399,6 +410,7 @@ extern void mlirIntegerTypeIsSignless(); extern void mlirIntegerTypeIsUnsigned(); extern void mlirIntegerTypeSignedGet(); extern void mlirIntegerTypeUnsignedGet(); +extern void mlirIsCurrentDebugType(); extern void mlirIsGlobalDebugEnabled(); extern void mlirLinalgFillBuiltinNamedOpRegion(); extern void mlirLlvmThreadPoolCreate(); @@ -422,6 +434,7 @@ extern void mlirMemRefTypeGetLayout(); extern void mlirMemRefTypeGetMemorySpace(); extern void mlirMemRefTypeGetStridesAndOffset(); extern void mlirMemRefTypeGetTypeID(); +extern void mlirMergeSymbolsIntoFromClone(); extern void mlirModuleCreateEmpty(); extern void mlirModuleCreateParse(); extern void mlirModuleDestroy(); @@ -516,6 +529,8 @@ extern void mlirOperationWriteBytecode(); extern void mlirOperationWriteBytecodeWithConfig(); extern void mlirPDLAttributeTypeGet(); extern void mlirPDLOperationTypeGet(); +extern void mlirPDLPatternModuleDestroy(); +extern void mlirPDLPatternModuleFromModule(); extern void mlirPDLRangeTypeGet(); extern void mlirPDLRangeTypeGetElementType(); extern void mlirPDLTypeTypeGet(); @@ -547,6 +562,9 @@ extern void mlirRegionInsertOwnedBlockBefore(); extern void mlirRegionTakeBody(); extern void mlirRegisterGPUPasses(); extern void mlirRegisterLinalgPasses(); +extern void mlirRewritePatternSetFromPDLPatternModule(); +extern void mlirSetGlobalDebugType(); +extern void mlirSetGlobalDebugTypes(); extern void mlirShapedTypeGetDimSize(); extern void mlirShapedTypeGetDynamicSize(); extern void mlirShapedTypeGetDynamicStrideOrOffset(); @@ -822,6 +840,7 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirAffineMulExprGet; x += (uintptr_t)&mlirAffineSymbolExprGet; x += (uintptr_t)&mlirAffineSymbolExprGetPosition; + x += (uintptr_t)&mlirApplyPatternsAndFoldGreedily; x += (uintptr_t)&mlirArrayAttrGet; x += (uintptr_t)&mlirArrayAttrGetElement; x += (uintptr_t)&mlirArrayAttrGetNumElements; @@ -854,6 +873,7 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirAttributeIsAElements; x += (uintptr_t)&mlirAttributeIsAFlatSymbolRef; x += (uintptr_t)&mlirAttributeIsAFloat; + x += (uintptr_t)&mlirAttributeIsAGPUObjectAttr; x += (uintptr_t)&mlirAttributeIsAInteger; x += (uintptr_t)&mlirAttributeIsAIntegerSet; x += (uintptr_t)&mlirAttributeIsALocation; @@ -877,6 +897,7 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirBlockDestroy; x += (uintptr_t)&mlirBlockDetach; x += (uintptr_t)&mlirBlockEqual; + x += (uintptr_t)&mlirBlockEraseArgument; x += (uintptr_t)&mlirBlockGetArgument; x += (uintptr_t)&mlirBlockGetFirstOperation; x += (uintptr_t)&mlirBlockGetNextInRegion; @@ -1045,12 +1066,20 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirFloatAttrGetValueDouble; x += (uintptr_t)&mlirFloatTF32TypeGetTypeID; x += (uintptr_t)&mlirFloatTypeGetWidth; + x += (uintptr_t)&mlirFreezeRewritePattern; + x += (uintptr_t)&mlirFrozenRewritePatternSetDestroy; x += (uintptr_t)&mlirFunctionTypeGet; x += (uintptr_t)&mlirFunctionTypeGetInput; x += (uintptr_t)&mlirFunctionTypeGetNumInputs; x += (uintptr_t)&mlirFunctionTypeGetNumResults; x += (uintptr_t)&mlirFunctionTypeGetResult; x += (uintptr_t)&mlirFunctionTypeGetTypeID; + x += (uintptr_t)&mlirGPUObjectAttrGet; + x += (uintptr_t)&mlirGPUObjectAttrGetFormat; + x += (uintptr_t)&mlirGPUObjectAttrGetObject; + x += (uintptr_t)&mlirGPUObjectAttrGetProperties; + x += (uintptr_t)&mlirGPUObjectAttrGetTarget; + x += (uintptr_t)&mlirGPUObjectAttrHasProperties; x += (uintptr_t)&mlirGetDialectHandle__iree_input__; x += (uintptr_t)&mlirGetDialectHandle__transform__; x += (uintptr_t)&mlirIREELinalgTransformRegisterPasses; @@ -1095,6 +1124,7 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirIntegerTypeIsUnsigned; x += (uintptr_t)&mlirIntegerTypeSignedGet; x += (uintptr_t)&mlirIntegerTypeUnsignedGet; + x += (uintptr_t)&mlirIsCurrentDebugType; x += (uintptr_t)&mlirIsGlobalDebugEnabled; x += (uintptr_t)&mlirLinalgFillBuiltinNamedOpRegion; x += (uintptr_t)&mlirLlvmThreadPoolCreate; @@ -1118,6 +1148,7 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirMemRefTypeGetMemorySpace; x += (uintptr_t)&mlirMemRefTypeGetStridesAndOffset; x += (uintptr_t)&mlirMemRefTypeGetTypeID; + x += (uintptr_t)&mlirMergeSymbolsIntoFromClone; x += (uintptr_t)&mlirModuleCreateEmpty; x += (uintptr_t)&mlirModuleCreateParse; x += (uintptr_t)&mlirModuleDestroy; @@ -1212,6 +1243,8 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirOperationWriteBytecodeWithConfig; x += (uintptr_t)&mlirPDLAttributeTypeGet; x += (uintptr_t)&mlirPDLOperationTypeGet; + x += (uintptr_t)&mlirPDLPatternModuleDestroy; + x += (uintptr_t)&mlirPDLPatternModuleFromModule; x += (uintptr_t)&mlirPDLRangeTypeGet; x += (uintptr_t)&mlirPDLRangeTypeGetElementType; x += (uintptr_t)&mlirPDLTypeTypeGet; @@ -1243,6 +1276,9 @@ uintptr_t __iree_compiler_hidden_force_extern() { x += (uintptr_t)&mlirRegionTakeBody; x += (uintptr_t)&mlirRegisterGPUPasses; x += (uintptr_t)&mlirRegisterLinalgPasses; + x += (uintptr_t)&mlirRewritePatternSetFromPDLPatternModule; + x += (uintptr_t)&mlirSetGlobalDebugType; + x += (uintptr_t)&mlirSetGlobalDebugTypes; x += (uintptr_t)&mlirShapedTypeGetDimSize; x += (uintptr_t)&mlirShapedTypeGetDynamicSize; x += (uintptr_t)&mlirShapedTypeGetDynamicStrideOrOffset; diff --git a/compiler/src/iree/compiler/API/api_exports.def b/compiler/src/iree/compiler/API/api_exports.def index 9858b0af9dc2..0c104a7507e1 100644 --- a/compiler/src/iree/compiler/API/api_exports.def +++ b/compiler/src/iree/compiler/API/api_exports.def @@ -118,6 +118,7 @@ EXPORTS mlirAffineMulExprGet mlirAffineSymbolExprGet mlirAffineSymbolExprGetPosition + mlirApplyPatternsAndFoldGreedily mlirArrayAttrGet mlirArrayAttrGetElement mlirArrayAttrGetNumElements @@ -150,6 +151,7 @@ EXPORTS mlirAttributeIsAElements mlirAttributeIsAFlatSymbolRef mlirAttributeIsAFloat + mlirAttributeIsAGPUObjectAttr mlirAttributeIsAInteger mlirAttributeIsAIntegerSet mlirAttributeIsALocation @@ -173,6 +175,7 @@ EXPORTS mlirBlockDestroy mlirBlockDetach mlirBlockEqual + mlirBlockEraseArgument mlirBlockGetArgument mlirBlockGetFirstOperation mlirBlockGetNextInRegion @@ -341,12 +344,20 @@ EXPORTS mlirFloatAttrGetValueDouble mlirFloatTF32TypeGetTypeID mlirFloatTypeGetWidth + mlirFreezeRewritePattern + mlirFrozenRewritePatternSetDestroy mlirFunctionTypeGet mlirFunctionTypeGetInput mlirFunctionTypeGetNumInputs mlirFunctionTypeGetNumResults mlirFunctionTypeGetResult mlirFunctionTypeGetTypeID + mlirGPUObjectAttrGet + mlirGPUObjectAttrGetFormat + mlirGPUObjectAttrGetObject + mlirGPUObjectAttrGetProperties + mlirGPUObjectAttrGetTarget + mlirGPUObjectAttrHasProperties mlirGetDialectHandle__iree_input__ mlirGetDialectHandle__transform__ mlirIREELinalgTransformRegisterPasses @@ -391,6 +402,7 @@ EXPORTS mlirIntegerTypeIsUnsigned mlirIntegerTypeSignedGet mlirIntegerTypeUnsignedGet + mlirIsCurrentDebugType mlirIsGlobalDebugEnabled mlirLinalgFillBuiltinNamedOpRegion mlirLlvmThreadPoolCreate @@ -414,6 +426,7 @@ EXPORTS mlirMemRefTypeGetMemorySpace mlirMemRefTypeGetStridesAndOffset mlirMemRefTypeGetTypeID + mlirMergeSymbolsIntoFromClone mlirModuleCreateEmpty mlirModuleCreateParse mlirModuleDestroy @@ -508,6 +521,8 @@ EXPORTS mlirOperationWriteBytecodeWithConfig mlirPDLAttributeTypeGet mlirPDLOperationTypeGet + mlirPDLPatternModuleDestroy + mlirPDLPatternModuleFromModule mlirPDLRangeTypeGet mlirPDLRangeTypeGetElementType mlirPDLTypeTypeGet @@ -539,6 +554,9 @@ EXPORTS mlirRegionTakeBody mlirRegisterGPUPasses mlirRegisterLinalgPasses + mlirRewritePatternSetFromPDLPatternModule + mlirSetGlobalDebugType + mlirSetGlobalDebugTypes mlirShapedTypeGetDimSize mlirShapedTypeGetDynamicSize mlirShapedTypeGetDynamicStrideOrOffset diff --git a/compiler/src/iree/compiler/API/api_exports.ld b/compiler/src/iree/compiler/API/api_exports.ld index 48d6b32d0f7c..f810a0b04a3d 100644 --- a/compiler/src/iree/compiler/API/api_exports.ld +++ b/compiler/src/iree/compiler/API/api_exports.ld @@ -119,6 +119,7 @@ VER_0 { mlirAffineMulExprGet; mlirAffineSymbolExprGet; mlirAffineSymbolExprGetPosition; + mlirApplyPatternsAndFoldGreedily; mlirArrayAttrGet; mlirArrayAttrGetElement; mlirArrayAttrGetNumElements; @@ -151,6 +152,7 @@ VER_0 { mlirAttributeIsAElements; mlirAttributeIsAFlatSymbolRef; mlirAttributeIsAFloat; + mlirAttributeIsAGPUObjectAttr; mlirAttributeIsAInteger; mlirAttributeIsAIntegerSet; mlirAttributeIsALocation; @@ -174,6 +176,7 @@ VER_0 { mlirBlockDestroy; mlirBlockDetach; mlirBlockEqual; + mlirBlockEraseArgument; mlirBlockGetArgument; mlirBlockGetFirstOperation; mlirBlockGetNextInRegion; @@ -342,12 +345,20 @@ VER_0 { mlirFloatAttrGetValueDouble; mlirFloatTF32TypeGetTypeID; mlirFloatTypeGetWidth; + mlirFreezeRewritePattern; + mlirFrozenRewritePatternSetDestroy; mlirFunctionTypeGet; mlirFunctionTypeGetInput; mlirFunctionTypeGetNumInputs; mlirFunctionTypeGetNumResults; mlirFunctionTypeGetResult; mlirFunctionTypeGetTypeID; + mlirGPUObjectAttrGet; + mlirGPUObjectAttrGetFormat; + mlirGPUObjectAttrGetObject; + mlirGPUObjectAttrGetProperties; + mlirGPUObjectAttrGetTarget; + mlirGPUObjectAttrHasProperties; mlirGetDialectHandle__iree_input__; mlirGetDialectHandle__transform__; mlirIREELinalgTransformRegisterPasses; @@ -392,6 +403,7 @@ VER_0 { mlirIntegerTypeIsUnsigned; mlirIntegerTypeSignedGet; mlirIntegerTypeUnsignedGet; + mlirIsCurrentDebugType; mlirIsGlobalDebugEnabled; mlirLinalgFillBuiltinNamedOpRegion; mlirLlvmThreadPoolCreate; @@ -415,6 +427,7 @@ VER_0 { mlirMemRefTypeGetMemorySpace; mlirMemRefTypeGetStridesAndOffset; mlirMemRefTypeGetTypeID; + mlirMergeSymbolsIntoFromClone; mlirModuleCreateEmpty; mlirModuleCreateParse; mlirModuleDestroy; @@ -509,6 +522,8 @@ VER_0 { mlirOperationWriteBytecodeWithConfig; mlirPDLAttributeTypeGet; mlirPDLOperationTypeGet; + mlirPDLPatternModuleDestroy; + mlirPDLPatternModuleFromModule; mlirPDLRangeTypeGet; mlirPDLRangeTypeGetElementType; mlirPDLTypeTypeGet; @@ -540,6 +555,9 @@ VER_0 { mlirRegionTakeBody; mlirRegisterGPUPasses; mlirRegisterLinalgPasses; + mlirRewritePatternSetFromPDLPatternModule; + mlirSetGlobalDebugType; + mlirSetGlobalDebugTypes; mlirShapedTypeGetDimSize; mlirShapedTypeGetDynamicSize; mlirShapedTypeGetDynamicStrideOrOffset; diff --git a/compiler/src/iree/compiler/API/api_exports.macos.lst b/compiler/src/iree/compiler/API/api_exports.macos.lst index a6487e09ecf2..8a47e302f82b 100644 --- a/compiler/src/iree/compiler/API/api_exports.macos.lst +++ b/compiler/src/iree/compiler/API/api_exports.macos.lst @@ -117,6 +117,7 @@ _mlirAffineModExprGet _mlirAffineMulExprGet _mlirAffineSymbolExprGet _mlirAffineSymbolExprGetPosition +_mlirApplyPatternsAndFoldGreedily _mlirArrayAttrGet _mlirArrayAttrGetElement _mlirArrayAttrGetNumElements @@ -149,6 +150,7 @@ _mlirAttributeIsADictionary _mlirAttributeIsAElements _mlirAttributeIsAFlatSymbolRef _mlirAttributeIsAFloat +_mlirAttributeIsAGPUObjectAttr _mlirAttributeIsAInteger _mlirAttributeIsAIntegerSet _mlirAttributeIsALocation @@ -172,6 +174,7 @@ _mlirBlockCreate _mlirBlockDestroy _mlirBlockDetach _mlirBlockEqual +_mlirBlockEraseArgument _mlirBlockGetArgument _mlirBlockGetFirstOperation _mlirBlockGetNextInRegion @@ -340,12 +343,20 @@ _mlirFloatAttrGetTypeID _mlirFloatAttrGetValueDouble _mlirFloatTF32TypeGetTypeID _mlirFloatTypeGetWidth +_mlirFreezeRewritePattern +_mlirFrozenRewritePatternSetDestroy _mlirFunctionTypeGet _mlirFunctionTypeGetInput _mlirFunctionTypeGetNumInputs _mlirFunctionTypeGetNumResults _mlirFunctionTypeGetResult _mlirFunctionTypeGetTypeID +_mlirGPUObjectAttrGet +_mlirGPUObjectAttrGetFormat +_mlirGPUObjectAttrGetObject +_mlirGPUObjectAttrGetProperties +_mlirGPUObjectAttrGetTarget +_mlirGPUObjectAttrHasProperties _mlirGetDialectHandle__iree_input__ _mlirGetDialectHandle__transform__ _mlirIREELinalgTransformRegisterPasses @@ -390,6 +401,7 @@ _mlirIntegerTypeIsSignless _mlirIntegerTypeIsUnsigned _mlirIntegerTypeSignedGet _mlirIntegerTypeUnsignedGet +_mlirIsCurrentDebugType _mlirIsGlobalDebugEnabled _mlirLinalgFillBuiltinNamedOpRegion _mlirLlvmThreadPoolCreate @@ -413,6 +425,7 @@ _mlirMemRefTypeGetLayout _mlirMemRefTypeGetMemorySpace _mlirMemRefTypeGetStridesAndOffset _mlirMemRefTypeGetTypeID +_mlirMergeSymbolsIntoFromClone _mlirModuleCreateEmpty _mlirModuleCreateParse _mlirModuleDestroy @@ -507,6 +520,8 @@ _mlirOperationWriteBytecode _mlirOperationWriteBytecodeWithConfig _mlirPDLAttributeTypeGet _mlirPDLOperationTypeGet +_mlirPDLPatternModuleDestroy +_mlirPDLPatternModuleFromModule _mlirPDLRangeTypeGet _mlirPDLRangeTypeGetElementType _mlirPDLTypeTypeGet @@ -538,6 +553,9 @@ _mlirRegionInsertOwnedBlockBefore _mlirRegionTakeBody _mlirRegisterGPUPasses _mlirRegisterLinalgPasses +_mlirRewritePatternSetFromPDLPatternModule +_mlirSetGlobalDebugType +_mlirSetGlobalDebugTypes _mlirShapedTypeGetDimSize _mlirShapedTypeGetDynamicSize _mlirShapedTypeGetDynamicStrideOrOffset diff --git a/compiler/src/iree/compiler/API/generate_exports.py b/compiler/src/iree/compiler/API/generate_exports.py index 5200325ad46f..68f1c43e4b46 100755 --- a/compiler/src/iree/compiler/API/generate_exports.py +++ b/compiler/src/iree/compiler/API/generate_exports.py @@ -56,6 +56,7 @@ "Interfaces.h", "IR.h", "Pass.h", + "Rewrite.h", "Support.h", "Transforms.h", "Dialect/GPU.h", diff --git a/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ArithToF32.cpp b/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ArithToF32.cpp index b4d7bd7285e3..3c52c16cbe37 100644 --- a/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ArithToF32.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ArithToF32.cpp @@ -147,7 +147,7 @@ struct GenericTypeConversionPattern : public ConversionPattern { TypeConverter::SignatureConversion result(newRegion->getNumArguments()); (void)getTypeConverter()->convertSignatureArgs( newRegion->getArgumentTypes(), result); - rewriter.applySignatureConversion(newRegion, result); + rewriter.applySignatureConversion(&newRegion->front(), result); } Operation *newOp = rewriter.create(state); diff --git a/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ToUInt16Buffers.cpp b/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ToUInt16Buffers.cpp index 4272150c43df..13958d5fab58 100644 --- a/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ToUInt16Buffers.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/ConvertBf16ToUInt16Buffers.cpp @@ -172,7 +172,8 @@ struct GenericTypeConversionPattern : public ConversionPattern { "argument type conversion failed"); } - rewriter.applySignatureConversion(newRegion, result, typeConverter); + rewriter.applySignatureConversion(&newRegion->front(), result, + typeConverter); } Operation *newOp = rewriter.create(state); diff --git a/compiler/src/iree/compiler/Codegen/Common/ForOpCanonicalizationPass.cpp b/compiler/src/iree/compiler/Codegen/Common/ForOpCanonicalizationPass.cpp index 1388ea6a1bb0..3bd452ded357 100644 --- a/compiler/src/iree/compiler/Codegen/Common/ForOpCanonicalizationPass.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/ForOpCanonicalizationPass.cpp @@ -4,18 +4,15 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include - #include "iree/compiler/Codegen/Common/PassDetail.h" #include "iree/compiler/Codegen/Common/Passes.h" +#include "llvm/Support/MathExtras.h" #include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/IR/Builders.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/IRMapping.h" #include "mlir/IR/PatternMatch.h" -#include "mlir/Pass/PassRegistry.h" -#include "mlir/Support/MathExtras.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir::iree_compiler { @@ -208,7 +205,7 @@ struct PackForOpInductionVarVector final : public OpRewritePattern { VectorType::get({numElements}, iterType.getElementType()); castTypes.push_back(shapeCastType); auto targetType = - VectorType::get({mlir::ceilDiv(totalBits, 32)}, + VectorType::get({llvm::divideCeilSigned(totalBits, 32)}, rewriter.getIntegerType( std::min(static_cast(32), totalBits))); targetTypes.push_back(targetType); diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributeSharedMemoryCopy.cpp b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributeSharedMemoryCopy.cpp index d748a2900782..4610c545e553 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributeSharedMemoryCopy.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributeSharedMemoryCopy.cpp @@ -5,7 +5,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -#include #include "iree/compiler/Codegen/Common/GPU/Passes.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h" @@ -13,6 +12,7 @@ #include "iree/compiler/Codegen/Utils/GPUUtils.h" #include "iree/compiler/Codegen/Utils/MarkerUtils.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" @@ -20,7 +20,6 @@ #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h" #include "mlir/IR/Builders.h" #include "mlir/IR/MLIRContext.h" -#include "mlir/Support/MathExtras.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" #define DEBUG_TYPE "iree-codegen-gpu-distribute-shared-memory-copy" @@ -349,7 +348,7 @@ static int64_t numIteration(scf::ForOp forOp) { ubCstOp.value() < 0 || stepCstOp.value() < 0) return 0; int64_t tripCount = - mlir::ceilDiv(ubCstOp.value() - lbCstOp.value(), stepCstOp.value()); + llvm::divideCeil(ubCstOp.value() - lbCstOp.value(), stepCstOp.value()); return tripCount; } diff --git a/compiler/src/iree/compiler/Codegen/Common/TypePropagationPass.cpp b/compiler/src/iree/compiler/Codegen/Common/TypePropagationPass.cpp index 2917e660119a..9edb2d945a6a 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TypePropagationPass.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/TypePropagationPass.cpp @@ -226,7 +226,8 @@ struct GenericOpTypePropagation } signatureConverter.addInputs(index, legalizedArgType.value()); } - rewriter.applySignatureConversion(&modifiedOpRegion, signatureConverter); + rewriter.applySignatureConversion(&modifiedOpRegion.front(), + signatureConverter); // 6. Introduce scalar conversion operations to convert back to the // original scalar type. @@ -368,7 +369,8 @@ struct IREELinalgExtScatterTypePropagation } signatureConverter.addInputs(0, legalizedArgType.value()); signatureConverter.addInputs(1, legalizedArgType.value()); - rewriter.applySignatureConversion(&modifiedOpRegion, signatureConverter); + rewriter.applySignatureConversion(&modifiedOpRegion.front(), + signatureConverter); { // Introduce scalar conversion operations to convert back to the original @@ -444,7 +446,8 @@ struct IREELinalgExtSortTypePropagation } signatureConverter.addInputs(index, legalizedArgType.value()); } - rewriter.applySignatureConversion(&modifiedOpRegion, signatureConverter); + rewriter.applySignatureConversion(&modifiedOpRegion.front(), + signatureConverter); { // Introduce scalar conversion operations to convert back to the original @@ -536,7 +539,8 @@ struct LegalizeResultElementType : public ConversionPattern { doSignatureConversion |= argType != legalizedType; } if (doSignatureConversion) { - rewriter.applySignatureConversion(&newOpRegion, signatureConverter); + rewriter.applySignatureConversion(&newOpRegion.front(), + signatureConverter); } } rewriter.replaceOp(op, newOp->getResults()); diff --git a/compiler/src/iree/compiler/Codegen/Common/test/decompose_pack_unpack_ops.mlir b/compiler/src/iree/compiler/Codegen/Common/test/decompose_pack_unpack_ops.mlir index 6914f1f0005c..e11573aaeb32 100644 --- a/compiler/src/iree/compiler/Codegen/Common/test/decompose_pack_unpack_ops.mlir +++ b/compiler/src/iree/compiler/Codegen/Common/test/decompose_pack_unpack_ops.mlir @@ -180,30 +180,13 @@ func.func @CKck_to_KC(%arg0: tensor<32x4x32x8xf32>, %arg1: tensor<128x256xf32>) %0 = tensor.unpack %arg0 outer_dims_perm = [1, 0] inner_dims_pos = [0, 1] inner_tiles = [32, 8] into %arg1 : tensor<32x4x32x8xf32> -> tensor<128x256xf32> return %0 : tensor<128x256xf32> } -// CHECK-DAG: #[[MAP0:.+]] = affine_map<(d0) -> (d0 floordiv 32)> -// CHECK-DAG: #[[MAP1:.+]] = affine_map<(d0) -> (d0 floordiv 8)> // CHECK: func.func @CKck_to_KC // CHECK-SAME: %[[IN:[A-Za-z0-9]+]]: // CHECK-SAME: %[[OUT:[A-Za-z0-9]+]]: -// CHECK-DAG: %[[C0:.+]] = arith.constant 0 : index -// CHECK-DAG: %[[C8:.+]] = arith.constant 8 : index -// CHECK-DAG: %[[C32:.+]] = arith.constant 32 : index -// CHECK-DAG: %[[C128:.+]] = arith.constant 128 : index -// CHECK-DAG: %[[C256:.+]] = arith.constant 256 : index -// CHECK: %[[RES0:.+]] = scf.for %[[K:.+]] = %[[C0]] to %[[C128]] step %[[C32]] -// CHECK-SAME: iter_args(%[[ITER0:.+]] = %[[OUT]]) -// CHECK: %[[RES1:.+]] = scf.for %[[C:.+]] = %[[C0]] to %[[C256]] step %[[C8]] -// CHECK-SAME: iter_args(%[[ITER1:.+]] = %[[ITER0]]) -// CHECK-DAG: %[[IN_K:.+]] = affine.apply #[[MAP0]](%[[K]]) -// CHECK-DAG: %[[IN_C:.+]] = affine.apply #[[MAP1]](%[[C]]) -// CHECK: %[[IN_SLICE:.+]] = tensor.extract_slice %[[IN]][%[[IN_C]], %[[IN_K]], 0, 0] [1, 1, 32, 8] [1, 1, 1, 1] -// CHECK: %[[TILE:.+]] = tensor.extract_slice %[[IN_SLICE]][0, 0, 0, 0] [1, 1, 32, 8] [1, 1, 1, 1] : tensor<1x1x32x8xf32> to tensor<32x8xf32> -// CHECK: %[[INSERT:.+]] = tensor.insert_slice %[[TILE]] into %[[ITER1]][%[[K]], %[[C]]] [32, 8] [1, 1] -// CHECK: scf.yield %[[INSERT]] -// CHECK: } -// CHECK: scf.yield %[[RES1]] -// CHECK: } -// CHECK: return %[[RES0]] +// CHECK: %[[TRANSP:.+]] = linalg.transpose ins(%[[IN]] +// CHECK: %[[COLLAPSED:.+]] = tensor.collapse_shape %[[TRANSP]] {{.+}} : tensor<4x32x32x8xf32> into tensor<128x256xf32> +// CHECK: %[[RES:.+]] = linalg.copy ins(%[[COLLAPSED]] +// CHECK: return %[[RES]] // ----- diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp b/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp index ceb11bbb964b..fb529d66054b 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp @@ -10,6 +10,7 @@ #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUOps.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/MathExtras.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" @@ -26,7 +27,6 @@ #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/PatternMatch.h" -#include "mlir/Support/MathExtras.h" #define DEBUG_TYPE "iree-codegen-gpu-transforms" @@ -48,7 +48,7 @@ static FailureOr getTripCount(scf::ForallOp loop) { int64_t tripCount = 1; for (auto [lb, ub, step] : llvm::zip_equal(lbs, ubs, steps)) { - tripCount *= mlir::ceilDiv((ub - lb), step); + tripCount *= llvm::divideCeil((ub - lb), step); } return tripCount; } @@ -464,6 +464,7 @@ FailureOr distributeMultiMmaOp(RewriterBase &rewriter, } return llvm::to_vector(llvm::seq(static_cast(0), rank)); }; + Value laneId = newForallOp.getInductionVar(0); // LHS slice offsets. int64_t lhsOuterRank = mmaOp.getLhsOuterRank(); @@ -476,9 +477,8 @@ FailureOr distributeMultiMmaOp(RewriterBase &rewriter, SmallVector lhsPermutation = getOrInferPermutationOfRank( mmaOp.getLhsPermutation(), mmaOp.getLhsInnerShape().size()); if (failed(mmaOp.getKind().populateOperandOffsetsSizesStrides( - rewriter, loc, IREE::GPU::MMAFragment::Lhs, - *newForallOp.getSingleInductionVar(), lhsPermutation, lhsOffsets, - lhsSizes, lhsStrides))) { + rewriter, loc, IREE::GPU::MMAFragment::Lhs, laneId, lhsPermutation, + lhsOffsets, lhsSizes, lhsStrides))) { return failure(); } // Extract the rank-reduced slice of the lhs based on the expected inner @@ -497,9 +497,8 @@ FailureOr distributeMultiMmaOp(RewriterBase &rewriter, SmallVector rhsPermutation = getOrInferPermutationOfRank( mmaOp.getRhsPermutation(), mmaOp.getRhsInnerShape().size()); if (failed(mmaOp.getKind().populateOperandOffsetsSizesStrides( - rewriter, loc, IREE::GPU::MMAFragment::Rhs, - *newForallOp.getSingleInductionVar(), rhsPermutation, rhsOffsets, - rhsSizes, rhsStrides))) { + rewriter, loc, IREE::GPU::MMAFragment::Rhs, laneId, rhsPermutation, + rhsOffsets, rhsSizes, rhsStrides))) { return failure(); } // Extract the rank-reduced slice of the rhs based on the expected inner @@ -518,9 +517,8 @@ FailureOr distributeMultiMmaOp(RewriterBase &rewriter, SmallVector accPermutation = getOrInferPermutationOfRank( mmaOp.getAccPermutation(), mmaOp.getAccInnerShape().size()); if (failed(mmaOp.getKind().populateOperandOffsetsSizesStrides( - rewriter, loc, IREE::GPU::MMAFragment::Acc, - *newForallOp.getSingleInductionVar(), accPermutation, accOffsets, - accSizes, accStrides))) { + rewriter, loc, IREE::GPU::MMAFragment::Acc, laneId, accPermutation, + accOffsets, accSizes, accStrides))) { return failure(); } // Extract the rank-reduced slice of the accumulator based on the expected diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUCastAddressSpaceFunction.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUCastAddressSpaceFunction.cpp index d13358df5668..624361fadec8 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUCastAddressSpaceFunction.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUCastAddressSpaceFunction.cpp @@ -4,23 +4,14 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree/compiler/Codegen/LLVMGPU/KernelConfig.h" #include "iree/compiler/Codegen/LLVMGPU/PassDetail.h" #include "iree/compiler/Codegen/LLVMGPU/TransformExtensions/LLVMGPUExtensions.h" -#include "iree/compiler/Codegen/Transforms/Transforms.h" #include "iree/compiler/Codegen/Utils/GPUUtils.h" -#include "llvm/Support/raw_ostream.h" #include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" -#include "mlir/Dialect/Arith/IR/Arith.h" +#include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/GPU/TransformOps/GPUTransformOps.h" -#include "mlir/Dialect/GPU/Transforms/Passes.h" -#include "mlir/IR/Matchers.h" #include "mlir/Interfaces/FunctionInterfaces.h" -#include "mlir/Interfaces/SideEffectInterfaces.h" -#include "mlir/Support/MathExtras.h" -#include "mlir/Transforms/GreedyPatternRewriteDriver.h" -#include "mlir/Transforms/Passes.h" #define DEBUG_TYPE "iree-llvmgpu-cast-address-space-function" diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/PrefetchSharedMemoryCopy.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/PrefetchSharedMemoryCopy.cpp index c4b98e56ab08..544c73f5a695 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/PrefetchSharedMemoryCopy.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/PrefetchSharedMemoryCopy.cpp @@ -12,6 +12,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVectorExtras.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/SCF/IR/SCF.h" @@ -24,7 +25,6 @@ #include "mlir/IR/PatternMatch.h" #include "mlir/IR/Visitors.h" #include "mlir/Interfaces/SideEffectInterfaces.h" -#include "mlir/Support/MathExtras.h" #define DEBUG_TYPE "iree-codegen-llvmgpu-prefetch-shared-memory-copy" #define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ") @@ -279,7 +279,7 @@ class LoopPrefetcher { ub = *ubCst; step = *stepCst; - int64_t numIters = mlir::ceilDiv(ub - lb, step); + int64_t numIters = llvm::divideCeil(ub - lb, step); if (numIters <= 2) return failure(); diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVVectorizeLoadStore.cpp b/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVVectorizeLoadStore.cpp index 709d6356d547..c168da6ae138 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVVectorizeLoadStore.cpp +++ b/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVVectorizeLoadStore.cpp @@ -319,7 +319,7 @@ class ProcessFunctionArgument final signatureConverter.addInputs(index, arg.getType()); } // Creates a new function with the update signature. - rewriter.applySignatureConversion(&funcOp.getFunctionBody(), + rewriter.applySignatureConversion(&funcOp.getFunctionBody().front(), signatureConverter); // Creates a new function with the update signature. diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/AbstractGemmLikeStrategy.cpp b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/AbstractGemmLikeStrategy.cpp index bc992ddeb712..fcba3716fd15 100644 --- a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/AbstractGemmLikeStrategy.cpp +++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/AbstractGemmLikeStrategy.cpp @@ -11,8 +11,8 @@ #include "iree/compiler/Codegen/TransformStrategies/GPU/Common.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" -#include "mlir/Support/MathExtras.h" using namespace mlir; @@ -134,7 +134,7 @@ void AbstractGemmLikeStrategy::initDefaultValues(const GPUModel &gpuModel) { numWarps = SmallVector(clNumWarps.begin(), clNumWarps.end()); } else { numWarps = numThreads; - numWarps[0] = mlir::ceilDiv(numWarps[0], getSubgroupSize()); + numWarps[0] = llvm::divideCeil(numWarps[0], getSubgroupSize()); } if (clUseAsyncCopies.getNumOccurrences()) useAsyncCopies = clUseAsyncCopies; diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/CopyMapping.cpp b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/CopyMapping.cpp index 259c86f2861b..7d646303bec6 100644 --- a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/CopyMapping.cpp +++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/CopyMapping.cpp @@ -10,8 +10,8 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" -#include "mlir/Support/MathExtras.h" using namespace mlir; @@ -126,7 +126,7 @@ iree_compiler::gpu::MappingInfo iree_compiler::gpu::CopyMapping::getMappingInfo( llvm::zip(copySizes, maybeCopyMapping->numThreads), [](auto &&pair) { int64_t size, numThreads; std::tie(size, numThreads) = pair; - return mlir::ceilDiv(size, numThreads); + return llvm::divideCeilSigned(size, numThreads); })); SmallVector allThreadMappings{linearId2(ctx), linearId1(ctx), linearId0(ctx)}; diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MappingInfo.cpp b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MappingInfo.cpp index 56194bf32bfc..8d1c2c3eb108 100644 --- a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MappingInfo.cpp +++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MappingInfo.cpp @@ -4,12 +4,10 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree/compiler/Codegen/TransformStrategies/GPU/CopyMapping.h" +#include "iree/compiler/Codegen/TransformStrategies/GPU/MappingInfo.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "mlir/Support/MathExtras.h" using namespace mlir; diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MatmulTensorCoreStrategy.h b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MatmulTensorCoreStrategy.h index 14385c5745ab..99c41d05b940 100644 --- a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MatmulTensorCoreStrategy.h +++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/MatmulTensorCoreStrategy.h @@ -13,9 +13,7 @@ #include "iree/compiler/Codegen/TransformStrategies/GPU/Common.h" #include "iree/compiler/Codegen/TransformStrategies/GPU/CopyMapping.h" #include "llvm/Support/raw_ostream.h" -#include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Support/LogicalResult.h" -#include "mlir/Support/MathExtras.h" namespace mlir::iree_compiler::gpu { diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/Strategies.cpp b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/Strategies.cpp index 40385dfa770e..770091bda511 100644 --- a/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/Strategies.cpp +++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/GPU/Strategies.cpp @@ -23,6 +23,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/MathExtras.h" #include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.h" @@ -38,7 +39,6 @@ #include "mlir/IR/BuiltinTypeInterfaces.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/TypeUtilities.h" -#include "mlir/Support/MathExtras.h" using namespace mlir; @@ -321,7 +321,7 @@ static void failSafeOverrides(MatmulStrategy &strategy, // the future. if (strategy.pipelineDepth * strategy.reductionTileSize > strategy.k()) { strategy.pipelineDepth = - mlir::floorDiv(strategy.k(), strategy.reductionTileSize); + llvm::divideFloorSigned(strategy.k(), strategy.reductionTileSize); } } @@ -572,7 +572,7 @@ static void failSafeOverrides(ImplicitGemmStrategy &strategy, // the future. if (strategy.pipelineDepth * strategy.reductionTileSize > strategy.k()) { strategy.pipelineDepth = - mlir::floorDiv(strategy.k(), strategy.reductionTileSize); + llvm::divideFloorSigned(strategy.k(), strategy.reductionTileSize); } } diff --git a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingOps.cpp b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingOps.cpp index 8acf32ccf94e..77700c06d881 100644 --- a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingOps.cpp +++ b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingOps.cpp @@ -6,34 +6,22 @@ #include "iree/compiler/Dialect/Encoding/IR/EncodingOps.h" -#include "iree/compiler/Dialect/Encoding/IR/EncodingDialect.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/TypeSwitch.h" -#include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/Utils.h" -#include "mlir/Dialect/Arith/Utils/Utils.h" -#include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" -#include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/Builders.h" -#include "mlir/IR/BuiltinTypeInterfaces.h" #include "mlir/IR/Diagnostics.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/OperationSupport.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/IR/TypeUtilities.h" #include "mlir/IR/Value.h" #include "mlir/Interfaces/InferTypeOpInterface.h" #include "mlir/Support/LLVM.h" #include "mlir/Support/LogicalResult.h" -#include "mlir/Support/MathExtras.h" namespace mlir::iree_compiler::IREE::Encoding { diff --git a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp index bb4f817830f7..3ee627aebabc 100644 --- a/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp +++ b/compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.cpp @@ -6,7 +6,6 @@ #include "iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.h" -#include "iree/compiler/Dialect/LinalgExt/IR/LinalgExtDialect.h" #include "iree/compiler/Dialect/LinalgExt/IR/LinalgExtInterfaces.h" #include "iree/compiler/Dialect/LinalgExt/Utils/IndexingUtils.h" #include "iree/compiler/Dialect/LinalgExt/Utils/Utils.h" @@ -14,14 +13,12 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/TypeSwitch.h" +#include "llvm/Support/MathExtras.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/Utils.h" #include "mlir/Dialect/Arith/Utils/Utils.h" -#include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" -#include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/IR/AffineExpr.h" @@ -33,14 +30,12 @@ #include "mlir/IR/Diagnostics.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/OperationSupport.h" -#include "mlir/IR/PatternMatch.h" #include "mlir/IR/TypeUtilities.h" #include "mlir/IR/Value.h" #include "mlir/IR/ValueRange.h" #include "mlir/Interfaces/InferTypeOpInterface.h" #include "mlir/Support/LLVM.h" #include "mlir/Support/LogicalResult.h" -#include "mlir/Support/MathExtras.h" #include #include @@ -840,7 +835,8 @@ static SmallVector getPackOpResultTypeShape( resultShape[tiledDim] = ShapedType::kDynamic; continue; } - resultShape[tiledDim] = ceilDiv(resultShape[tiledDim], innerTileSizes[idx]); + resultShape[tiledDim] = + llvm::divideCeil(resultShape[tiledDim], innerTileSizes[idx]); } // Swap tile loops if outer_dims_perm is available. diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp index c74b8ca7fa91..5eef577e5694 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp @@ -1608,7 +1608,7 @@ class FuncOpConversion : public EmitCConversionPattern { signatureConverter.addInputs(arg.index(), convertedType); } - rewriter.applySignatureConversion(&funcOp.getFunctionBody(), + rewriter.applySignatureConversion(&funcOp.getFunctionBody().front(), signatureConverter); // Creates a new function with the updated signature. diff --git a/compiler/src/iree/compiler/InputConversion/Common/ConvertPrimitiveType.cpp b/compiler/src/iree/compiler/InputConversion/Common/ConvertPrimitiveType.cpp index 92dd2fb4644c..d59a0ba717ab 100644 --- a/compiler/src/iree/compiler/InputConversion/Common/ConvertPrimitiveType.cpp +++ b/compiler/src/iree/compiler/InputConversion/Common/ConvertPrimitiveType.cpp @@ -172,7 +172,7 @@ struct GenericTypeConversionPattern : public ConversionPattern { TypeConverter::SignatureConversion result(newRegion->getNumArguments()); (void)getTypeConverter()->convertSignatureArgs( newRegion->getArgumentTypes(), result); - rewriter.applySignatureConversion(newRegion, result); + rewriter.applySignatureConversion(&newRegion->front(), result); } Operation *newOp = rewriter.create(state); diff --git a/compiler/src/iree/compiler/InputConversion/Common/IREEImportPublic.cpp b/compiler/src/iree/compiler/InputConversion/Common/IREEImportPublic.cpp index 4fd3d76ead14..f6162eb283d5 100644 --- a/compiler/src/iree/compiler/InputConversion/Common/IREEImportPublic.cpp +++ b/compiler/src/iree/compiler/InputConversion/Common/IREEImportPublic.cpp @@ -468,7 +468,7 @@ class GenericTypeConvert : public ConversionPattern { TypeConverter::SignatureConversion result(newRegion->getNumArguments()); (void)getTypeConverter()->convertSignatureArgs( newRegion->getArgumentTypes(), result); - rewriter.applySignatureConversion(newRegion, result); + rewriter.applySignatureConversion(&newRegion->front(), result); } Operation *newOp = rewriter.create(state); rewriter.replaceOp(op, newOp->getResults()); diff --git a/runtime/bindings/python/iree/runtime/build_requirements.txt b/runtime/bindings/python/iree/runtime/build_requirements.txt index dbf9881c78d8..a096da0c852c 100644 --- a/runtime/bindings/python/iree/runtime/build_requirements.txt +++ b/runtime/bindings/python/iree/runtime/build_requirements.txt @@ -9,6 +9,7 @@ nanobind==2.0 numpy>=2.0.0b1 requests>=2.28.0 wheel>=0.36.2 +sympy==1.12.1 # TODO: nanobind is used in the runtime but the compiler uses pybind and # removing this breaks CI bots; remove this. diff --git a/third_party/llvm-project b/third_party/llvm-project index 53ddc8745466..144ebdd07a98 160000 --- a/third_party/llvm-project +++ b/third_party/llvm-project @@ -1 +1 @@ -Subproject commit 53ddc87454669c0d595c0e3d3174e35cdc4b0a61 +Subproject commit 144ebdd07a9872580ffcbd55147826882ccb0768 diff --git a/third_party/stablehlo b/third_party/stablehlo index 0b7ecf3e3538..dd48ec58d3bb 160000 --- a/third_party/stablehlo +++ b/third_party/stablehlo @@ -1 +1 @@ -Subproject commit 0b7ecf3e353843746adcbc7763f86348a3d4ed9b +Subproject commit dd48ec58d3bb8d674adf56715d4394102538fa84 diff --git a/third_party/torch-mlir b/third_party/torch-mlir index d59d0b6e5a88..77d7f6447256 160000 --- a/third_party/torch-mlir +++ b/third_party/torch-mlir @@ -1 +1 @@ -Subproject commit d59d0b6e5a88252d1d7e9b380e5488f49fadf87f +Subproject commit 77d7f6447256545b7eb375c2baafa9b3084094c8