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
if steps > 64: #MJ: 2.5: for every 2.5 bytes of free memory, only 1 byte is effectively usable for the tensor. The divisor "2.5" might be derived from some heuristic or specific memory management consideration
max_res = math.floor( math.sqrt( math.sqrt(mem_free_total / 2.5) ) / 8 ) * 64
=>
Can you explain to me
1) What does "steps" refer to ?
2) what is the logic behind the formula for the computation of steps
3) what is the logic behind the computation of "max_res"? I guess that number 8 refers to the compression factor by which the image is compressed into the latent space, where the attention matrix is computed (The code snippet seems to compute the memory needed to compute the self attention matrix for the latent tensor.
Sincerely
Moon R. Jung
Professor, Dept of Art & Technology
Sogang Univ, Seoul, Korea
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
line 336 - 342:
if mem_required > mem_free_total:
steps = 2 ** (math.ceil(math.log(mem_required / mem_free_total, 2))) #MJ: 20, 22, 2**3, ...
print(f"Expected tensor size:{tensor_size/gb:0.1f}GB, cuda free:{mem_free_cuda/gb:0.1f}GB "
f"torch free:{mem_free_torch/gb:0.1f} total:{mem_free_total/gb:0.1f} steps:{steps}")
Beta Was this translation helpful? Give feedback.
All reactions