Skip to content

Commit

Permalink
Integrate llvm/llvm-project@bbd2b08b95fe (2023-12-07) (#15844)
Browse files Browse the repository at this point in the history
This commit updates LLVM submoulde to

* llvm/llvm-project@bbd2b08b95fe

With a local cherry-pick of llvm/llvm-project@0d0c22985522.

Includes a local patch to stablehlo to include the token name one liner
from here: openxla/stablehlo#1871 (a full
integrate of stablehlo looks quite invasive and due to
openxla/stablehlo#1872 and punted after seeing
if it would be easy).

---------

Co-authored-by: Lei Zhang <antiagainst@gmail.com>
Co-authored-by: hanhanW <hanhan0912@gmail.com>
  • Loading branch information
3 people committed Dec 8, 2023
1 parent 010427d commit cef31e7
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 25 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ class SPIRVInitialLoweringPass
vector::VectorTransformsOptions().setVectorTransposeLowering(
vector::VectorTransposeLowering::EltWise);
vector::populateVectorTransposeLoweringPatterns(patterns, options);
vector::populateVectorShapeCastLoweringPatterns(patterns);
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(patterns)))) {
return signalPassFailure();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ hal.executable @i4_dequant_matvec_f32 {
// CHECK: %[[BCAST:.+]] = vector.broadcast %[[ADD]] : vector<4xf32> to vector<1x4xf32>
// CHECK: scf.yield %[[BCAST]] : vector<1x4xf32>

// CHECK: %[[SCAST:.+]] = vector.shape_cast %[[FOR]] : vector<1x4xf32> to vector<4xf32>
// CHECK: %[[REDUCE:.+]] = vector.reduction <add>, %[[SCAST]] : vector<4xf32> into f32
// CHECK: %[[EXTRACT3:.+]] = vector.extract %[[FOR]][0] : vector<4xf32> from vector<1x4xf32>
// CHECK: %[[REDUCE:.+]] = vector.reduction <add>, %[[EXTRACT3]] : vector<4xf32> into f32
// CHECK: gpu.subgroup_reduce add %[[REDUCE]] : (f32) -> f32
// CHECK: scf.if
// CHECK: vector.transfer_write
2 changes: 2 additions & 0 deletions compiler/src/iree/compiler/Dialect/Flow/IR/FlowTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class DispatchTensorType

using Base::Base;

static constexpr StringLiteral name = "flow.dispatch_tensor";

/// Get or create a new DispatchTensorType of the provided shape and
/// element type. Assumes the arguments define a well-formed
/// DispatchTensorType.
Expand Down
26 changes: 26 additions & 0 deletions compiler/src/iree/compiler/Dialect/HAL/IR/HALTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ std::optional<uint64_t> lookupOffsetOrAlignment(Value value);

struct AllocatorType : public Type::TypeBase<AllocatorType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.allocator";
};

struct BufferType
Expand All @@ -81,6 +83,8 @@ struct BufferType
IREE::Util::ReferenceTypeInterface::Trait> {
using Base::Base;

static constexpr StringLiteral name = "hal.buffer";

Value inferSizeFromValue(Location loc, Value value, OpBuilder &builder) const;
};

Expand All @@ -90,53 +94,75 @@ struct BufferViewType
IREE::Util::ReferenceTypeInterface::Trait> {
using Base::Base;

static constexpr StringLiteral name = "hal.buffer_view";

Value inferSizeFromValue(Location loc, Value value, OpBuilder &builder) const;
};

struct ChannelType : public Type::TypeBase<ChannelType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.channel";
};

struct CommandBufferType
: public Type::TypeBase<CommandBufferType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.command_buffer";
};

struct DescriptorSetLayoutType
: public Type::TypeBase<DescriptorSetLayoutType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.descriptor_set_layout";
};

struct DeviceType
: public Type::TypeBase<DeviceType, Type, TypeStorage,
mlir::OpTrait::IREE::Util::ImplicitlyCaptured> {
using Base::Base;

static constexpr StringLiteral name = "hal.device";
};

struct EventType : public Type::TypeBase<EventType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.event";
};

struct ExecutableType
: public Type::TypeBase<ExecutableType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.executable";
};

struct FenceType : public Type::TypeBase<FenceType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.fence";
};

struct FileType : public Type::TypeBase<FileType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.file";
};

struct PipelineLayoutType
: public Type::TypeBase<PipelineLayoutType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.pipeline_layout";
};

struct SemaphoreType : public Type::TypeBase<SemaphoreType, Type, TypeStorage> {
using Base::Base;

static constexpr StringLiteral name = "hal.semaphore";
};

//===----------------------------------------------------------------------===//
Expand Down
8 changes: 8 additions & 0 deletions compiler/src/iree/compiler/Dialect/VM/IR/VMTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ struct RefTypeStorage;
class BufferType : public Type::TypeBase<BufferType, Type, TypeStorage> {
public:
using Base::Base;

static constexpr StringLiteral name = "vm.buffer";
};

/// A list containing an optional element type.
Expand All @@ -41,6 +43,8 @@ class ListType
public:
using Base::Base;

static constexpr StringLiteral name = "vm.list";

/// Returns true if the given type can be wrapped in a list.
static bool isCompatible(Type type);

Expand Down Expand Up @@ -70,6 +74,8 @@ class ListType
class OpaqueType : public Type::TypeBase<OpaqueType, Type, TypeStorage> {
public:
using Base::Base;

static constexpr StringLiteral name = "vm.opaque";
};

/// A ref<T> containing a reference to a ref-object-compatible type.
Expand All @@ -78,6 +84,8 @@ class RefType : public Type::TypeBase<RefType, Type, detail::RefTypeStorage> {
public:
using Base::Base;

static constexpr StringLiteral name = "vm.ref";

/// Returns true if the given type can be wrapped in a ref ptr.
static bool isCompatible(Type type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class TargetEnvAttr
public:
using Base::Base;

static constexpr StringLiteral name = "vk.target_env";

/// Gets a TargetEnvAttr instance.
// TODO(antiagainst): support other physical device core properties, physical
// device core features and per-extension features.
Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
Submodule llvm-project updated 1577 files
2 changes: 1 addition & 1 deletion third_party/stablehlo
2 changes: 1 addition & 1 deletion third_party/torch-mlir
Submodule torch-mlir updated 28 files
+1 −1 build_tools/write_env_file.sh
+1 −1 docs/adding_an_e2e_test.md
+7 −8 docs/development.md
+1 −1 include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td
+1 −1 lib/Conversion/TorchToLinalg/DataMovement.cpp
+1 −1 lib/Conversion/TorchToLinalg/IndirectDataMovement.cpp
+13 −31 lib/Conversion/TorchToLinalg/Linear.cpp
+1 −1 lib/Conversion/TorchToLinalg/Pooling.cpp
+1 −1 lib/Conversion/TorchToLinalg/Random.cpp
+60 −90 lib/Conversion/TorchToLinalg/Reduction.cpp
+1 −1 lib/Conversion/TorchToLinalg/TensorConstructors.cpp
+1 −1 lib/Conversion/TorchToLinalg/Uncategorized.cpp
+2 −1 lib/Conversion/TorchToLinalg/Utils.cpp
+0 −0 lib/Conversion/TorchToLinalg/Utils.h
+0 −20 lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp
+12 −15 lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp
+0 −1 lib/Dialect/Torch/Transforms/LowerToBackendContract.cpp
+5 −2 projects/pt1/e2e_testing/xfail_sets.py
+1 −16 projects/pt1/python/torch_mlir/jit_ir_importer/build_tools/abstract_interp_lib_gen.py
+1 −1 projects/pt1/python/torch_mlir/jit_ir_importer/build_tools/torch_ods_gen.py
+1 −1 projects/pt1/python/torch_mlir_e2e_test/test_suite/__init__.py
+65 −0 projects/pt1/python/torch_mlir_e2e_test/test_suite/argmax.py
+1 −37 projects/pt1/python/torch_mlir_e2e_test/test_suite/matmul.py
+0 −276 projects/pt1/python/torch_mlir_e2e_test/test_suite/reduction.py
+1 −1 pytorch-hash.txt
+1 −1 pytorch-requirements.txt
+0 −11 test/Conversion/TorchToLinalg/basic.mlir
+1 −1 torchvision-requirements.txt

0 comments on commit cef31e7

Please sign in to comment.