stanford-ppl / spatial

Spatial: "Specify Parameterized Accelerators Through Inordinately Abstract Language"
https://spatial.stanford.edu
MIT License
274 stars 32 forks source link

Matrix mulltiplication app compilation fails #174

Closed nitish2112 closed 5 years ago

nitish2112 commented 5 years ago

Hi,

I want to compile Matrix Multiplication on Arria 10 FPGA. I downloaded this repo and spatial-apps (https://github.com/stanford-ppl/spatial-apps/tree/ff8f3026619f323ac0b3799cb429e14bd10b990b). I compiled this repo using:

% make install

After this when I ran matrix multiplication example:

% ./bin/spatial  ../spatial-apps/src/MayMults.scala

It gave me following error:

[error] ## Exception when compiling 237 sources to /work/zhang-x1/users/nks45/spatial/spatial/test/target/scala-2.12/test-classes
[error] GC overhead limit exceeded
[error] scala.reflect.internal.Symbols$Symbol$$Lambda$3940/107347937.get$Lambda(Unknown Source)
[error] java.lang.invoke.LambdaForm$DMH/445288316.invokeStatic_L_L(LambdaForm$DMH)
[error] java.lang.invoke.LambdaForm$MH/1413246829.linkToTargetMethod(LambdaForm$MH)
[error] scala.reflect.internal.Symbols$Symbol.overriddenSymbol(Symbols.scala:2344)
[error] scala.tools.nsc.transform.Mixin.existsCompetingMethod$1(Mixin.scala:256)
[error] scala.tools.nsc.transform.Mixin.$anonfun$addMixedinMembers$2(Mixin.scala:273)
[error] scala.tools.nsc.transform.Mixin.$anonfun$addMixedinMembers$2$adapted(Mixin.scala:214)
[error] scala.tools.nsc.transform.Mixin$$Lambda$5047/1244084907.apply(Unknown Source)
[error] scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:789)
[error] scala.collection.TraversableLike$WithFilter$$Lambda$3541/1048087092.apply(Unknown Source)
[error] scala.reflect.internal.Scopes$Scope.foreach(Scopes.scala:408)
[error] scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:788)
[error] scala.tools.nsc.transform.Mixin.mixinTraitForwarders$1(Mixin.scala:214)
[error] scala.tools.nsc.transform.Mixin.$anonfun$addMixedinMembers$13(Mixin.scala:355)
[error] scala.tools.nsc.transform.Mixin.$anonfun$addMixedinMembers$13$adapted(Mixin.scala:350)
[error] scala.tools.nsc.transform.Mixin$$Lambda$5043/1588433792.apply(Unknown Source)
[error] scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:789)
[error] scala.collection.TraversableLike$WithFilter$$Lambda$3541/1048087092.apply(Unknown Source)
[error] scala.collection.immutable.List.foreach(List.scala:389)
[error] scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:788)
[error] scala.tools.nsc.transform.Mixin.addMixedinMembers(Mixin.scala:350)
[error] scala.tools.nsc.transform.Mixin$MixinTransformer.preTransform(Mixin.scala:391)
[error] scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:598)
[error] scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:366)
[error] scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
[error] scala.reflect.internal.Trees.$anonfun$itransform$4(Trees.scala:1429)
[error] scala.reflect.internal.Trees$$Lambda$3672/2086696161.apply(Unknown Source)
[error] scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1428)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1357)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:18)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:18)
[error]
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
[error]         at java.util.concurrent.FutureTask.report(FutureTask.java:122)
[error]         at java.util.concurrent.FutureTask.get(FutureTask.java:192)
[error]         at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:207)
[error]         at sbt.Execute.next$1(Execute.scala:104)
[error]         at sbt.Execute.processAll(Execute.scala:107)
[error]         at sbt.Execute.runKeep(Execute.scala:84)
[error]         at sbt.EvaluateTask$.liftedTree1$1(EvaluateTask.scala:387)
[error]         at sbt.EvaluateTask$.run$1(EvaluateTask.scala:386)
[error]         at sbt.EvaluateTask$.runTask(EvaluateTask.scala:405)
[error]         at sbt.internal.Aggregation$.$anonfun$timedRun$4(Aggregation.scala:100)
[error]         at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:331)
[error]         at sbt.internal.Aggregation$.timedRun(Aggregation.scala:98)
[error]         at sbt.internal.Aggregation$.runTasks(Aggregation.scala:111)
[error]         at sbt.internal.Aggregation$.$anonfun$applyTasks$1(Aggregation.scala:68)
[error]         at sbt.Command$.$anonfun$applyEffect$2(Command.scala:130)
[error]         at sbt.internal.Aggregation$.$anonfun$evaluatingParser$11(Aggregation.scala:220)
[error]         at sbt.internal.Act$.$anonfun$actParser0$3(Act.scala:387)
[error]         at sbt.MainLoop$.processCommand(MainLoop.scala:153)
[error]         at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:136)
[error]         at sbt.State$$anon$1.runCmd$1(State.scala:242)
[error]         at sbt.State$$anon$1.process(State.scala:248)
[error]         at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:136)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.MainLoop$.next(MainLoop.scala:136)
[error]         at sbt.MainLoop$.run(MainLoop.scala:129)
[error]         at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:107)
[error]         at sbt.io.Using.apply(Using.scala:22)
[error]         at sbt.MainLoop$.runWithNewLog(MainLoop.scala:101)
[error]         at sbt.MainLoop$.runAndClearLast(MainLoop.scala:57)
[error]         at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:42)
[error]         at sbt.MainLoop$.runLogged(MainLoop.scala:34)
[error]         at sbt.StandardMain$.runManaged(Main.scala:113)
[error]         at sbt.xMain.run(Main.scala:76)
[error]         at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)

Am I doing something wrong?

dkoeplin commented 5 years ago

As the error says, the JVM has run out of memory while compiling Spatial. Since the Scala compiler is pretty memory intensive, we recommend using at least the following when compiling the Spatial compiler from source: export SBT_OPTS="-Xmx4G -Xss1G -Xms2G"