question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resuming uses more VRAM than starting from scratch with same parameters

See original GitHub issue

I’m able to run with the following parameters

MODEL_DIM = 512
TEXT_SEQ_LEN = 256
DEPTH = 64
HEADS = 62
DIM_HEAD = 64
BATCH_SIZE=16

using the VQGanVAE1024 vae, however when I try to resume with these parameters, I am hit with cuda out of memory errors. I can’t get past one step until I lower the batch size to 10. Any ideas why resuming with the same parameters would be more memory intensive?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
awilson9commented, Mar 21, 2021

The fix looks to be mapping the call to torch.load to the cpu rather than the gpu

loaded_obj = torch.load(str(dalle_path), map_location='cpu')

Adding this map location argument got rid of the memory errors for me

Edit: from pytorch docs

When you call torch.load() on a file which contains GPU tensors, those tensors will be loaded to GPU by default. You can call torch.load(…, map_location=‘cpu’) and then load_state_dict() to avoid GPU RAM surge when loading a model checkpoint.

2reactions
afiaka87commented, Mar 23, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

What happens when a game requires more VRAM than what ...
Go to Start > Settings > System.
Read more >
VRAM Usage EASY FIX! Fix Crashes, Stutters, Fps ... - YouTube
VRAM Usage EASY FIX! Fix Crashes, Stutters, Fps Drops! (Warzone)- In this Video I show you How to Fix VRAM Usage!
Read more >
How to FIX "VRAM Always at MAX FREQUENCY" Problem
Tap to unmute. If playback doesn't begin shortly, try restarting your device. Your browser can't play this video. Learn more. Switch camera.
Read more >
How to Increase Dedicated Video RAM (VRAM) in Windows ...
The best way to increase your video RAM is to purchase a new or better graphics card. If you're using integrated graphics and...
Read more >
What is VRAM, How to Check it, and Can You Increase It?
Video Random Access Memory is vital for modern computing. As such, this post will show you what VRAM is and how to increase...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found