You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backend dynamic tests for Pad (test_constant_pad_cpu, test_edge_pad_cpu, and test_reflect_pad_cpu) fail when the dynamic shape is -1:-1 for testing all inputs.
Assertion failed: (indexExprObj), function getObjPtr, file IndexExpr.cpp, line 439.
The tests pass if src/Dialect/Mlir/IndexExprBuilder.cpp line 200 the following condition is removed:
if (size == ShapedType::kDynamic || i >= (uint64_t)size) {
return UndefinedIndexExpr();
}
These tests also pass if the dynamic shape is 0:-1. PR #2754 was delivered to to update the dynamic shape to 0:-1.
The text was updated successfully, but these errors were encountered:
Basically, the code is trying to get a value from an array for an index I when we don't know the array size. Say array is defined as a:[?xi64] and we are asking to get a[10]. The compiler doesn't know if the array has 11 values. So up to now, we only allowed a call to this method when the array was of known size.
But if you were to look at the code, and it is really like this (aka careful code)
%dim = dim %a: type<?xi64>
for %I =0; %I<%dim, %I++) {
%v = "getValFromArray(%a, %i)
or you know that another parameter to the operation that you are lowering, say %axis must be by definition in the range 0 ... %dim even if that dim is only known at runtime.
then maybe the code might work, but I would have to look at the generated code much more carefully.
So if you are in that later situation, you could try to add a flag dynamicArraySizeAllowed, enable it for this case, and see what the output is.
In addition, if the current "user" of that call expected a constant value, then the code will also not work. Aka if the algorithm expected to know %a[10] == 3 and then use that value 3 explicitly, now having an IndexExpr = "runtime value" would not work. Namely, the algorithm using that value would have to be rewritten to accommodate a value only known at runtime.
Backend dynamic tests for Pad (test_constant_pad_cpu, test_edge_pad_cpu, and test_reflect_pad_cpu) fail when the dynamic shape is -1:-1 for testing all inputs.
Assertion failed: (indexExprObj), function getObjPtr, file
IndexExpr.cpp
, line 439.The tests pass if
src/Dialect/Mlir/IndexExprBuilder.cpp
line 200 the following condition is removed:These tests also pass if the dynamic shape is 0:-1. PR #2754 was delivered to to update the dynamic shape to 0:-1.
The text was updated successfully, but these errors were encountered: