Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate symbol emitted with SoA and fusion optimizations #44

Open
asujeeth opened this issue Nov 26, 2014 · 1 comment
Open

Duplicate symbol emitted with SoA and fusion optimizations #44

asujeeth opened this issue Nov 26, 2014 · 1 comment
Labels

Comments

@asujeeth
Copy link
Contributor

In OptiML logistic regression, we are getting a duplicated symbol emitted that appears to be a scheduling bug related to some interaction between Multiloop SoA and loop fusion (it does not occur if either one is turned off).

The exact behavior we are seeing is a while loop kernel generated like the following:

def apply(resourceInfo:generated.scala.ResourceInfo,x1231:Int,x1135:Int,x1296:Array[Double],x1229:Array[Double],x628:generated.scala.DenseVectorDouble,x1301:generated.scala.Ref[Double],x1356:generated.scala.Ref[Int],x1355:generated.scala.Ref[generated.scala.DenseVectorDouble]):
Unit = {
val x1880 = while ({
// ...
} {
// ...
val x1135 = x1134.length
// ...
})

Notice that x1135 is re-emitted, despite being an input to the kernel. This also occurs in normal kernel generation, but because x1135 is emitted as a kernel (a separate file), that file is simply overwritten, so the program still compiles and runs correctly.

To reproduce, use the following hashes:
Forge: stanford-ppl/Forge@3de62bb
Delite: c301618
LMS: TiarkRompf/virtualization-lms-core@81ee4b1

and run the program LogRegCompiler from OptiML. When running delite LogRegCompiler, you should see the following walk-time compilation error:

generatedCache/scala/src/kernels/x1880.scala:24: error: not found: value x1134
val x1135 = x1134.length
            ^
one error found

My hypothesis (though unproven) is that the problematic symbol may be being injected into the scope during fusion, which is somehow affected by the split SoA loops. It's possible this could be fixed by Vera's new implementation, or at least made easier to debug.

@asujeeth
Copy link
Contributor Author

@kjbrown, @TiarkRompf, @vsalvis - let me know if you guys have any ideas. I'm punting on this one for now, I think.

@asujeeth asujeeth added the bug label Nov 26, 2014
asujeeth added a commit that referenced this issue Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant