File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
third_party/intel/lib/TritonIntelGPUTransforms Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,22 @@ bool isExpensiveLoadOrStore(Operation *op) {
120
120
if (isSingleValue (base))
121
121
return false ;
122
122
123
- // Loads that use a block pointer are expensive if they cannot be lowered to
124
- // 2D block read operations. Temporarily leverage the
125
- // "ttig.block_io" attribute to filter out inexpensive loads.
123
+ if (auto loadOp = dyn_cast<LoadOp>(op)) {
124
+ // Subgroup2DBlockEncodingAttr loads are expensive, but loads without this
125
+ // encoding may still be expensive so we only return true if the encodng
126
+ // exists
127
+ if (auto tensorTy = dyn_cast<RankedTensorType>(loadOp.getType ()))
128
+ if (isa<Subgroup2DBlockEncodingAttr>(tensorTy.getEncoding ()))
129
+ return true ;
130
+ }
131
+
132
+ // The block ptr attribute identifies loads that are candidates for subgroup
133
+ // 2d block io operations. Loads with these attributes (and without the new
134
+ // subgroup 2d block encoding above) should have their layouts replaced with
135
+ // the layout from the expensive op (usually a dot op with DPAS encoding). The
136
+ // load result is convert to the expensive op layout during LLVM lowering.
137
+ // Note: the long term plan is to replace this path with the above subgroup 2d
138
+ // block encoding layout.
126
139
Attribute blockIOAttr =
127
140
op->getAttr (TritonIntelGPUDialect::getBlockIOAttrName ());
128
141
if (blockIOAttr)
You can’t perform that action at this time.
0 commit comments