12
12
#include " iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h"
13
13
#include " iree/compiler/Dialect/Encoding/IR/EncodingDialect.h"
14
14
#include " iree/compiler/Dialect/Encoding/IR/EncodingOps.h"
15
- #include " iree/compiler/Dialect/Encoding/IR/EncodingTypes.h"
16
15
#include " iree/compiler/Dialect/Flow/IR/FlowDialect.h"
17
16
#include " iree/compiler/Dialect/Flow/IR/FlowOps.h"
18
17
#include " iree/compiler/Dialect/Flow/Transforms/RegionOpUtils.h"
26
25
#include " mlir/Support/LLVM.h"
27
26
#include " mlir/Transforms/GreedyPatternRewriteDriver.h"
28
27
29
- llvm::cl::opt<bool > clEnableI1Support (
30
- " iree-experimental-packed-i1-storage" ,
31
- llvm::cl::desc (
32
- " Experimental feature: use packed storage for i1 tensors. This feature "
33
- " can be dropped once the frontend can emit packed i1 tensors." ),
34
- llvm::cl::init(false ));
35
-
36
28
#define DEBUG_TYPE " iree-dispatch-creation-set-encoding"
37
29
38
30
namespace mlir ::iree_compiler::DispatchCreation {
@@ -46,13 +38,6 @@ using IREE::Encoding::PackedStorageAttr;
46
38
// Utility functions
47
39
// ===---------------------------------------------------------------------===//
48
40
49
- static std::optional<Attribute> getI1PackedStorageAttr (MLIRContext *context) {
50
- if (clEnableI1Support) {
51
- return PackedStorageAttr::get (context);
52
- }
53
- return {};
54
- }
55
-
56
41
Value setEncoding (OpBuilder &builder, Location loc, Value source,
57
42
EncodingAttr encodingAttr) {
58
43
auto sourceType = cast<RankedTensorType>(source.getType ());
@@ -232,17 +217,9 @@ class setContractionOpEncoding
232
217
if (narrowDim.isN ()) {
233
218
roundDimsTo[1 ] = llvm::PowerOf2Ceil (narrowDim.size );
234
219
}
235
- // This is a temporary solution that we can use
236
- // `--iree-experimental-packed-i1-storage` to enable packed storage for i1
237
- // tensors without specifying attributes.
238
- auto optI1PackedStorageAttr =
239
- getI1PackedStorageAttr (rewriter.getContext ());
240
- auto layouts = optI1PackedStorageAttr
241
- ? ArrayRef<Attribute>(*optI1PackedStorageAttr)
242
- : ArrayRef<Attribute>{};
243
- auto encoding = EncodingAttr::get (
244
- linalgOp.getContext (), operandIndex, opType, elemTypes, maps,
245
- /* bcastMap=*/ std::nullopt, roundDimsTo, layouts);
220
+ auto encoding = EncodingAttr::get (linalgOp.getContext (), operandIndex,
221
+ opType, elemTypes, maps,
222
+ /* bcastMap=*/ std::nullopt, roundDimsTo);
246
223
return setEncoding (rewriter, loc, src, encoding);
247
224
};
248
225
Value encodedLhs = setEncodingWrapper (lhs, IREE::Encoding::MATMUL_LHS);
0 commit comments