AxisArrays.jl
AxisArrays.jl copied to clipboard
Stackoverflow error when doing cat on array of AxisArrays
Using AxisArrays v0.4.4, I encountered a StackOverflow error when doing concatenation with a relatively large array as below:
stackoverflowarray = [AxisArray(rand(500,4)) for i in 1:1048]
cat(stackoverflowarray...; dims=3)
This is actually not an uncommon size in MCMC methods, since 500x4 is just for 4 chains with 500 samples each, and 1048 would be the number of parameters.
Additionally, while doing the cat
operation, I will see my RAM consistently climb for about 6GB until the stackoverflow error is thrown. This is probably not the cause though, but it might be correlated/side-effect, because I still have more RAM available, since I have seen julia climb to 12GB at times, and now it is at a total of 7GB when it throws the error.
Lastly, note that if I just do this:
nostackoverflowarray = [AxisArray(rand(500,4)) for i in 1:1048]
cat(nostackoverflowarray...; dims=3)
There is no stackoverflow errors, it finishes in a second, and the operation consumes maybe 25 MB