-
Notifications
You must be signed in to change notification settings - Fork 19
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
Integrate Squid #369
Comments
Note: to support local variables you can always override |
The last "missing feature" issue you mention (
There is also a (unfortunately rather hacky) workaround for this, similar to the one for local variables; see here.
Strange. Perhaps due to the variable having
Nice catch! Seems to be due to the vararg being a Java vararg (differently encoded than Scala 😅) Don't hesitate to open issues on the Squid tracker for this kind of bugs 🙂 |
OK, I resolved the |
Edit: We have resolved some more issues!
It would be really good to integrate Squid into our compiler pipeline, because its quasiquote-based API would probably make it easier to write tree transformations. I tried to do it [1], but unfortunately there were a number of issues. You can see the details of the issues in comments in the code [1], but here is a list:
Resolved issues:
tpt
of ValDefs to be filled, but we don't fill them [3] (resolved by an extra transform pass (addValAndVarDefTpts
) before passing the tree to Squid)addImplicitPlaceholders
).TypeTag
is path-dependent on the universe. Lionel fixed this in Squid.TransitiveClosureFlinkSpec
) rely on accesses to local variables, which is not supported by Squid by default. However, the solution suggested by Lionel in the below comment solved this issue.dscfInv
/dscf
before/after Squid.this
references to enclosing classes or objects inLogRegFlinkSpec, SGDFlinkSpec, LinRegFlinkSpec, StatsFlinkSpec
(and many other unit tests). Resolved by the workaround in Integrate Squid #369 (comment) (2bd6cbc)Not yet resolved issues:
Probably Emma bugs:
TransitiveClosureFlinkSpec
fails withsquid.quasi.EmbeddingException$Unsupported: Unsupported feature: Reference to local method 'doWhile$m2'
. ButdscfInv
should have removed this, so this is probably a bug indscfInv
.Probably Squid missing features:
NaiveBayesFlinkSpec, KMeansFlinkSpec, TokenizeFlinkSpec
. The most prevalent isArray[_]
, which appears due to implicitly resolvingCanBuildFrom
in code such asline.split(",").map(_.toDouble)
.[2] says that "using type aliases may circumvent this limitation".
We also have
x$1.label.type forSome { val x$1: org.emmalanguage.lib.ml.LDPoint[Long,Double] }
, but I'm not really sure how this type appears.squid.quasi.EmbeddingException$Unsupported: Unsupported feature: org.emmalanguage.api.FlinkDataSet.memoizeTypeInfo[String](implicitly[scala.reflect.runtime.universe.TypeTag[String]], org.apache.flink.api.scala.`package`.createTypeInformation[String])
This issue is not really a big problem, as these calls come in only near the end of our pipelines, so we can just avoid using Squid at that stage.
Probably Squid bugs (or maybe we give Squid some invalid trees):
EvalFlinkSpec, LogRegFlinkSpec, SGDFlinkSpec, LinRegFlinkSpec
,BaseCodegenIntegrationSpec.'Updated tmp sink'
fail with an undefined variable issue. InEvalFlinkSpec
, in the tree that we give to Squid we have a var namedanf$m25
, and a reference to it somewhere. Squid seems to "rename" this var toanf$m25$m1
but doesn't change the reference. In the other test, the variable get renamed fromp$p$r2
top$p$r2$r1
.NGramsFlinkSpec
fails withBaseCodegenIntegrationSpec.CSV
fails withTODO:
"Note that I'm still of the opinion (as expressed earlier) that in your case, it would be more appropriate to not convert Emma's IR into a Squid IR, but instead to provide a new implementation of the Base interface so Squid can use Emma's own IR behind the scenes. Have you considered that? It represent a tighter coupling with Squid, but I could help with making it work and evolve as needed."
compileSpecPipelines
. (Or just comment in the testSquid line in Compiler.scala)Other notes:
[1] https://github.com/ggevay/emma-1/tree/squid
[2] https://github.com/epfldata/squid/blob/master/doc/reference/Quasiquotes.md#supported-scala-features
[3] #234
[4] epfldata/squid#55 (comment)
[5] epfldata/squid#57 (comment)
[6] epfldata/squid#55
[7] epfldata/squid#56
The text was updated successfully, but these errors were encountered: