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
After making mapRows pure in OptiML, we encountered an illegal instance of horizontal fusion in the DenseMatrixSuite's testMapAll(). The code to trigger the fusion error is:
def main() = {
val x = DenseMatrix.zeros(10,10)
val b = x mapRows { i => DenseVector.ones(10) }
println(b == DenseMatrix.ones(10,10))
}
The result of this is a java.lang.RuntimeException: Couldn't find following op: x509, and the generated kernel is:
The horizontally fused kernel x509x824 also expects x509 as an input. It seems to be caused by the fact that the outer loop and inner loop have the same constant size (10) in the example, and the inner loop has no dependency on the outer loop's bound symbol (i).
It seems that x509 is DenseVector.ones(10), which is moved out of the loop since it doesn't depend on i. x824 is b. Note that x isn't even generated, because its elements aren't used and its rowlength is constant. So the structure seen by fusion should be something along the lines of:
def main() = {
val x509 = DenseVector.ones(10)
val x824 = SimpleLoop (i <- 0 until 10) {
collect(x509)
}
println(x824 == DenseMatrix.ones(10,10))
}
The bug is that in this case, x509 and x824 are fused horizontally, despite the dependency.
After making
mapRows
pure in OptiML, we encountered an illegal instance of horizontal fusion in the DenseMatrixSuite's testMapAll(). The code to trigger the fusion error is:The result of this is a
java.lang.RuntimeException: Couldn't find following op: x509
, and the generated kernel is:The horizontally fused kernel x509x824 also expects x509 as an input. It seems to be caused by the fact that the outer loop and inner loop have the same constant size (10) in the example, and the inner loop has no dependency on the outer loop's bound symbol (i).
To reproduce, use the following hashes:
Forge: stanford-ppl/Forge@939141a
Delite: e686064
LMS: TiarkRompf/virtualization-lms-core@afeb9ef
and run the code snippet pasted above in OptiML.
The text was updated successfully, but these errors were encountered: