Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion compiler/plugins/target/ROCM/Dialect/ROCM/IR/ROCMAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,20 @@ static bool checkIterationSizeConstraints(ArrayRef<int64_t> iterationSizes,
if (indexVal < 0 || indexVal >= iterationSizes.size()) {
return false;
}
// For now, assume a dynamic dimension is very large and any division constraint is
// satisfied to keep the performancestate on current models (llama) as is.
// TODO(#22370): This is not ideal and can be improved once we support value
// bounds on dynamic dimensions for encodings.
if (IntegerAttr sizeMin = constraint.getSizeMin()) {
if (iterationSizes[indexVal] < sizeMin.getInt()) {
if (!ShapedType::isDynamic(iterationSizes[indexVal]) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!ShapedType::isDynamic(iterationSizes[indexVal]) &&
if (ShapedType::isStatic(iterationSizes[indexVal]) &&

iterationSizes[indexVal] < sizeMin.getInt()) {
return false;
}
}
if (IntegerAttr sizeMax = constraint.getSizeMax()) {
if (ShapedType::isDynamic(iterationSizes[indexVal])) {
return false;
}
if (iterationSizes[indexVal] > sizeMax.getInt()) {
return false;
}
Expand All @@ -95,6 +103,9 @@ static bool checkIterationSizeConstraints(ArrayRef<int64_t> iterationSizes,
if (sizeDiv.getInt() <= 0) {
return false;
}
if (ShapedType::isDynamic(iterationSizes[indexVal])) {
return true;
}
if (iterationSizes[indexVal] % sizeDiv.getInt()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@
util.func @pingpong_dt_large_f16(%lhs_base: !lhs_base_ty, %rhs_base: !rhs_base_ty, %unused_acc: !acc_base_ty) -> !acc_base_ty attributes {
ukernel_info = #rocm.ukernel_info<
match = {
types = [f16, f16, f32]
types = [f16, f16, f32],
iteration_sizes_constraints = [
#rocm.ukernel_interation_size_constraint<
index = 0,
size_min = 512,
size_div = 64
>,
#rocm.ukernel_interation_size_constraint<
index = 1,
size_min = 32832,
size_div = 64
>,
#rocm.ukernel_interation_size_constraint<
index = 2,
size_min = 512,
size_div = 64
>
]
},
mma = #iree_gpu.data_tiled_mma_layout<
intrinsic = MFMA_F32_16x16x16_F16,
Expand Down
Loading