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.

AssertionError: Model should be on CPU before parallelization. It is more memory-efficient.

See original GitHub issue

Hello, first of all congratulations for this amazing project. It’s simple, efficient and versatile. Very useful.

In some cases, it happens that one has several GPUs, but not enough RAM to parallelize the model. When loading the model on GPU, and then parallelizing, I’m getting the below error: AssertionError: Model should be on CPU before parallelization. It is more memory-efficient.

It doesn’t stop the script, but it seems that the parallelization fails.

My question is: is it possible to load the initial model on GPU instead of CPU (even if it’s not memory-efficient) or not at all?

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:29 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
juliensalinascommented, Dec 28, 2021

Thanks a lot @hyunwoongko . I will try the above and close this issue. I think my request goes beyond the scope of parallelformers. Thanks again!

1reaction
juliensalinascommented, Dec 17, 2021

It works great! Thanks for the quick addition! 🥇

Thanks again for the great work, that’s very useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command-line Tools — fairseq 0.12.2 documentation
Fairseq provides several command-line tools for training and evaluating models: fairseq-preprocess: Data pre-processing: build vocabularies and binarize ...
Read more >
Torch not compiled with CUDA enabled" in spite upgrading to ...
python - "AssertionError: Torch not compiled with CUDA enabled" in spite upgrading to CUDA version - Stack Overflow. Stack Overflow for Teams – ......
Read more >
DeepSpeed: Extreme-scale model training for everyone
Model parallelism reduces the memory proportional to the number of workers. Model parallelism is the most memory efficient among the three types ...
Read more >
vk_mini_path_tracer - GitHub Pages
This tutorial is a beginner-friendly introduction to writing your own fast, photorealistic path tracer in less than 300 lines of C++ code and...
Read more >
parlai.utils — ParlAI Documentation
Add special tokens to the tokenizer. These tokens are never split, and prioritized over the BPE tokenization. finalize (frequencies: Dict[str, ...
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