You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering a problem in TensorOperations.jl when using eval and Meta.parse for metaprogramming. The code runs fine without metaprogramming. However, when I use eval and Meta.parse with the @tensor macro, it appears that the memory used will grow, and eventually, all available memory will be used up and killed.
This code works fine;
using TensorOperations
for i in 1:1000
a = 16; c = 18; b = 18; d = 16; m = 16; n = 16; u = 18; v = 18; A = rand(Float64, (a, u, v, b, c, d)); B = rand(Float64, (n, m, v, u)); @tensor C[d, a, b, m, c, n] := A[a, u, v, b, c, d] * B[n, m, v, u]
end
If only one line is executed, it takes
0.577926 seconds (17.09 k allocations: 736.200 MiB, 7.40% gc time, 31.36% compilation time)
The whole loop takes
343.437409 seconds (114.93 k allocations: 359.412 GiB, 3.63% gc time, 0.07% compilation time)
My problem happens when I use Meta.parse and eval for metaprogramming.
using TensorOperations
for i in 1:1000
eval(Meta.parse("a = 16; c = 18; b = 18; d = 16; m = 16; n = 16; u = 18; v = 18; A = rand(Float64, (a, u, v, b, c, d));B = rand(Float64, (n, m, v, u)); @tensor C[d, a, b, m, c, n] := A[a, u, v, b, c, d] * B[n, m, v, u]"))
end
If only one line is executed, it takes
7.389352 seconds (41.43 M allocations: 2.726 GiB, 5.71% gc time, 93.99% compilation time)
However, when I run the whole for loop, the process runs out of memory on the machine, is killed, and cannot finish.
In my trial, the process died after the 179th execution.
Julia 1.8.5
TensorOperations v2.0.1
The text was updated successfully, but these errors were encountered:
I am encountering a problem in
TensorOperations.jl
when usingeval
andMeta.parse
for metaprogramming. The code runs fine without metaprogramming. However, when I useeval
andMeta.parse
with the@tensor
macro, it appears that the memory used will grow, and eventually, all available memory will be used up and killed.This code works fine;
If only one line is executed, it takes
The whole loop takes
My problem happens when I use
Meta.parse
andeval
for metaprogramming.If only one line is executed, it takes
However, when I run the whole for loop, the process runs out of memory on the machine, is killed, and cannot finish.
In my trial, the process died after the 179th execution.
Julia 1.8.5
TensorOperations v2.0.1
The text was updated successfully, but these errors were encountered: