-
Notifications
You must be signed in to change notification settings - Fork 27
Description
I find that calling TensorKit.empty_globalcaches!() can significantly reduce memory usage when dealing with product of several symmetries: just inserting it between these two lines.
PEPSKit.jl/src/algorithms/ctmrg/ctmrg.jl
Lines 114 to 115 in 7ceb4a3
| env, info = ctmrg_iteration(network, env, alg) | |
| η, CS, TS = calc_convergence(env, CS, TS) |
In my case I was contracting a PEPS with fZ2 x U(1) x U(1) symmetry, D = 8, using environment chi = 32. I use the sequential CTMRG with fullinfinite for the projectors. I was also restricting the cache sizes:
resize!(TensorKit.GLOBAL_FSTRANSPOSE_CACHE; maxsize = 400)
resize!(TensorKit.GLOBAL_FSBRAID_CACHE; maxsize = 400)
resize!(TensorKit.GLOBAL_FUSIONBLOCKSTRUCTURE_CACHE; maxsize = 400)
resize!(TensorKit.GLOBAL_TREEBRAIDER_CACHE; maxsize = 400)
resize!(TensorKit.GLOBAL_TREEPERMUTER_CACHE; maxsize = 400)
resize!(TensorKit.GLOBAL_TREETRANSPOSER_CACHE; maxsize = 400)Using current master branch of PEPSKit, memory usage can go up to 24 GB, which is even more than the amount used fZ2 x U(1). But if I clear cache after each CTMRG iteration, memory usage can be reduced by half, though this seems to have some negative effect on the speed of CTMRG (I haven't been able to do a controlled test due to limited resources).
IIRC, @leburgel was also bothered by the memory issue and may find this cache clearing helpful.