oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
623 stars 64 forks source link

Runtime error - com.oracle.truffle.r.runtime.RInternalError: com.oracle.truffle.api.dsl.UnsupportedSpecializationException: Unexpected values provided #197

Open abhinaynagpal opened 2 years ago

abhinaynagpal commented 2 years ago

root@a73dcc5ca637:~/old-tseries/tseries/src# gu --version GraalVM Updater 21.3.0

I compiled all the packages by enabling fc to use LLVM

/opt/java/graalvm/languages/R/bin/R --R.BackEnd=llvm --R.PrintErrorStacktracesToFile=true

library('forecast') data("AirPassengers") time_func <- function() { startTime <- Sys.time() mymodel <- auto.arima(AirPassengers) myforecast <- forecast(mymodel, level=c(95), h=10*12) endTime <- Sys.time() print(endTime - startTime) }

Mon Feb 07 01:11:39 GMT 2022 com.oracle.truffle.r.runtime.RInternalError: com.oracle.truffle.api.dsl.UnsupportedSpecializationException: Unexpected values provided for LLVMWriteI32NodeGen#1 slot=[9,8,Int]: [0x0], [LLVMPointerImpl] at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:342) at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:650) at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:622) at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:555) at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:539) at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:481) at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71) at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:63) at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1233) at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:920) at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:745) at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:708) at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:295) at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:236) at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:211) at com.oracle.truffle.r.nodes.function.CallArgumentsNode.evaluateFlattenObjects(CallArgumentsNode.java:242) at com.oracle.truffle.r.nodes.function.RCallNode.callGroupGeneric(RCallNode.java:498) at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:302) at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:211) at com.oracle.truffle.r.nodes.function.CallArgumentsNode.evaluateFlattenObjects(CallArgumentsNode.java:242) at com.oracle.truffle.r.nodes.function.RCallNode.callGroupGeneric(RCallNode.java:498) at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:302) at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:211) at com.oracle.truffle.r.nodes.function.CallArgumentsNode.evaluateFlattenObjects(CallArgumentsNode.java:242) at com.oracle.truffle.r.nodes.function.RCallNode.callGroupGeneric(RCallNode.java:498) at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:302) at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:211)

I have attached the log along with the issue fastr_errors_pid24149.log

steve-s commented 2 years ago

Hello

thank you for the report. This seems to be a bug in GraalVM LLVM. I could reduce the issue to a simple reproducer below that doesn't need any packages installed and I'll report that to the GraalVM LLVM team.

$GRAALVM_HOME/bin/R --R.BackEnd=llvm -e "polyroot(c(1, 0.273003970398776, -0.569873375900593))"
abhinaynagpal commented 2 years ago

thanks @steve-s ! looking forward to the fix so that I can benchmark vs GNU R :) and hopefully migrate to graalvm