Hello everyone,
I am running large-scale DMRG simultations to study a two dimensional spin system on a finite cylinder with no symmetries. I have experience with the algorithm itself, but it is the first time I use iTensor and Julia for this purpose, attracted by the possibility of GPU (CUDA) usage, which indeed provides incredible speedups compared to what I was used to.
I was a bit surprised to find out that the memory (vRAM when I use GPUs) quickly becomes the bottleneck, to the point that I can reproduce my older results (obtained with python/TenPy using purely CPUs) orders of magnitude faster but I cannot grow the bond dimension further, even on the 80GB vRAM A100 GPU.
To give some reference, I have N=144 physical “sites” (9x8 lattice with d.o.f on links), physical Hilbert space of d=2 (spins), Hamiltonian MPO of size D=22, and I want to increase the bond dimension as much as possible since for \chi = 2400 some points in parameter space are not fully converged. This results in MPS of approximately 5GB in size. For higher bond dimension \chi \approx 2500, all the 80GB of vRAM are allocated and the simulation crashes.
Does anyone know if such large memory consumption is normal for 2-sites DMRG? If so, is there some way to mitigate the issue? At the moment I am particularly interested in the case of vRAM since all the relevant operations should happen on the GPU, in case there are differences compared to regular RAM allocation.
I learned about the write_when_maxdim_exceeds
option, and with that enabled I can go up to \chi=2800 before running out of memory anyway, at the cost of a 3x slowdown. This is not bad, but I would still like to understand if the memory usage can be mitigated even further. I paste here the code that I am using to run the simulation, in case there is something obvious that I am missing.
g=0.2
H = hamiltonian(g)
H = cu(H)
maxdim = [1200, 1600, 2000, 2400, 2400, 2400, 2400] #Example, in practice I would do more sweeps
cutoff = [1e-10]
noise = [0]
psi = random_mps(sites; linkdims=2)
psi = cu(psi)
energy, psi = dmrg(H, psi; nsweeps, maxdim, cutoff, noise=noise, eigsolve_krylovdim = 3, write_when_maxdim_exceeds=2400) #example
Thanks!