@rkube I assume you’re on an unreleased main branch of Enzyme.jl since that error about runtime activity has not been tagged in a release version.
That error is an over-aggressive warning, that an operation being performed could (but not necessarily will) lead to incorrect results. It’s over-aggressive at the moment because we figure it’s better to have confidence in your answer being correct than have to see the error and turn on runtimeActivity more than necessary.
That said we are both working to reduce the aggressive error, as well as resolve the underlying issue.
Also, while enabling runtime activity does lead to a performance reduction, it should not be substantial.
You should also get a backtrace of where and why the runtime activity error is occurring, but unfortunately it’s limited to basically a few function calls back until the corresponding PR’s to the latest Julia and LLVM.jl land to enable better backtraces (Add Interface to julia OJIT by gbaraldi · Pull Request #346 · maleadt/LLVM.jl · GitHub), (https://github.com/JuliaLang/julia/pull/49858). I’m told this will only enable it for the (not released) Julia 1.10, but maybe if you ask nicely enough someone can be convinced to backport it.
By turning on the runtime activity flag, the program appears to succeed (and should be correct at that minor performance reduction).
The much more substantial performance issue is this:
Warning: Using fallback BLAS replacements, performance may be degraded
In essence, this says we have not finished implementing our internal BLAS and have a fallback implementation which exists and is correct, but is single core and may be substantially slower. Ironically we are presently on the verge of merging the much faster one for most cases of dot product, matrix multiply, and matrix vector multiply (Gemv by ZuseZ4 · Pull Request #1208 · EnzymeAD/Enzyme · GitHub) with more coming soon. cc @ZuseZ4 who is leading that effort (though FYI that branch doesn’t support runtime activity yet).
The BLAS isn’t a warning you can fix normally, but is an internal feature that is under development. That said you can work around it by writing a custom Enzyme rule (Custom rules · Enzyme.jl). Finding where to write it however, may be a bit more tricky without the better backtraces having landed in LLVM.jl.