Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to increase the ram in google colab? #253

Closed
dwy904 opened this issue Aug 29, 2018 · 65 comments
Closed

is it possible to increase the ram in google colab? #253

dwy904 opened this issue Aug 29, 2018 · 65 comments

Comments

@dwy904
Copy link

dwy904 commented Aug 29, 2018

is it possible to increase the memory limit. 11G is too small. Can't really do much.

@dwy904
Copy link
Author

dwy904 commented Sep 11, 2018

any update on this one?

@dwy904 dwy904 changed the title increase memory possibility? is it possible to increase the ram in google colab? Sep 11, 2018
@craigcitro
Copy link
Contributor

We don't have any support for changing the resource footprint of a managed runtime at this point.

You can always connect to a local backend.

@ritubebu
Copy link

Any idea how to increase memory size?

@dwy904
Copy link
Author

dwy904 commented Jul 5, 2019

any update on this one?

@ziatdinovmax
Copy link

@dwy904, in my experience the best way to "purchase" additional RAM and/or faster GPUs in Colab is by connecting (from Colab notebook) to a deep learning VM on GCP where you can adjust specs of your instance each time before launching it. I made a short video on this a few weeks ago: https://drive.google.com/file/d/1ijawhI6AuPXxWhLu8flkrHZPTu3o_zF0/view?usp=sharing

@Ramstein
Copy link

Ramstein commented Aug 4, 2019

Just crash your session by using the whole of the 12.5 Gigs of RAM then the door opens where you can directly double your RAM to 25 Gigs in Colab.
screenshot-colab research google com-2019 08 05-00_53_17

@juanlp
Copy link

juanlp commented Aug 5, 2019

@RamsteinWR is right. Just click on "Get more RAM" and you would be able to work on a 25Gbs instance. Not sure if it is still free?

@dwy904
Copy link
Author

dwy904 commented Aug 12, 2019

@RamsteinWR Interesting, do you have to crash before you can have more RAM?

@Spiffy1
Copy link

Spiffy1 commented Aug 14, 2019

@RamsteinWR Interesting, do you have to crash before you can have more RAM?

Yes. As for how, I was inspecting my data and it maxed out my allocated RAM.

@Suvi-dha
Copy link

True, happens with me all the time. My data is huge. After the 12.72 GB RAM is maxed out, I immediately get the prompt of crash and option to increase my RAM.

@RamziFsm
Copy link

RamziFsm commented Sep 9, 2019

Google Colab gives free 25 Gb as Ram space. But for my model I need 64 Gb. How can I increase the memory space? Can I buy the rest and How?

@ziatdinovmax
Copy link

ziatdinovmax commented Sep 9, 2019 via email

@RamziFsm
Copy link

RamziFsm commented Sep 9, 2019

Thanks ziatdinovmax for reply,
Do you know any link or tutorial for doing that?

@ziatdinovmax
Copy link

ziatdinovmax commented Sep 9, 2019 via email

@elsheikh21
Copy link

elsheikh21 commented Oct 17, 2019

For people searching for the problem, I hope this might help you out
you can just load a very large dataset into the ram,

  1. Download and Unzip a huge dataset
  2. Read the dataset into a var
  • Colab will crash and show you a message asking if you want to use their High Ram Option
  1. Click yes of course
    and voilà

@klazaj
Copy link

klazaj commented Nov 7, 2019

Just crashed Colab via this code:

d=[]
while(1):
  d.append('1')

Indeed, a message shows up, asking if you want to increase RAM usage. RAM is then upgraded to 35GB.

@VuongTuanKhanh
Copy link

Just crashed Colab via this code:

d=[]
while(1):
  d.append('1')

Indeed, a message shows up, asking if you want to increase RAM usage. RAM is then upgraded to 35GB.

Thanks in advance, a messagebox shows up and then I have 25.51GB of RAM

@umeshpant
Copy link

Just crashed Colab via this code:

d=[]
while(1):
  d.append('1')

Indeed, a message shows up, asking if you want to increase RAM usage. RAM is then upgraded to 35GB.

Thanks in advance, a messagebox shows up and then I have 25.51GB of RAM

Thank you !
you save my day

@Abhishek109
Copy link

Screenshot (2)

Can you help me how to increase my RAM from 25.5GB to higher limit

@VuongTuanKhanh
Copy link

VuongTuanKhanh commented Dec 31, 2019

Screenshot (2)

Can you help me how to increase my RAM from 25.5GB to higher limit

As far as I know: Nope. Believe me, I've tried a lot of different ways. Maybe Colab limits the Session to a maximum of 25Gb. Perhaps you want to optimize the solution rather than increasing the amount of RAM.

But you know what, I'm happy about that. Isn't 25.5Gb free a great thing ;) I think we can't ask for more

@Abhishek109
Copy link

Screenshot (2)
Can you help me how to increase my RAM from 25.5GB to higher limit

As far as I know: Nope. Believe me, I've tried a lot of different ways. Maybe Colab limits the Session to a maximum of 25Gb. Perhaps you want to optimize the solution rather than increasing the amount of RAM.

But you know what, I'm happy about that. Isn't 25.5Gb free a great thing ;) I think we can't ask for more

thats very true. thank you. have a great year ahead.

@Abdessamad139
Copy link

Screenshot (2)

Can you help me how to increase my RAM from 25.5GB to higher limit

Actually, if you chose to change the runtime type from GPU to TPU, you will get 35.35 Gb instead of 25.5Gb

@Abhishek109
Copy link

Abhishek109 commented Jan 19, 2020 via email

@Keramatfar
Copy link

Just crash your session by using the whole of the 12.5 Gigs of RAM then the door opens where you can directly double your RAM to 25 Gigs in Colab.
screenshot-colab research google com-2019 08 05-00_53_17

Does not work any more.

@Keramatfar
Copy link

Screenshot (2)
Can you help me how to increase my RAM from 25.5GB to higher limit

Actually, if you chose to change the runtime type from GPU to TPU, you will get 35.35 Gb instead of 25.5Gb

Does not show the message.

@Keramatfar
Copy link

Screenshot (2)
Can you help me how to increase my RAM from 25.5GB to higher limit

As far as I know: Nope. Believe me, I've tried a lot of different ways. Maybe Colab limits the Session to a maximum of 25Gb. Perhaps you want to optimize the solution rather than increasing the amount of RAM.

But you know what, I'm happy about that. Isn't 25.5Gb free a great thing ;) I think we can't ask for more

The problem is that in my case that is 12.75 Gb.

@KishoreKonakanti
Copy link

@YukiSakuma did you try smaller resolutions ? Can you please post your config?

@YukiSakuma
Copy link

@YukiSakuma did you try smaller resolutions ? Can you please post your config?

Config-e, and I can't lower the resolution because I am trying to train from a pretrained model that was trained on 512x512 images.

@karthiikselvam
Copy link

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

@hafiz031
Copy link

hafiz031 commented Aug 22, 2020

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

Didn't work. Any new ways?

@SBAESH
Copy link

SBAESH commented Aug 25, 2020

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

Didn't work. Any new ways?

You just need to save a copy of it in your drive (from File -> Save a copy in Drive) and then you have the 25G RAM. Apparently you need to copy the code from the other colab to this one then.

@hafiz031
Copy link

@SBAESH yes now it works, thanks!

@pearlie317
Copy link

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

Thanks so much. I made it !!!

@SjiYang
Copy link

SjiYang commented Aug 31, 2020

I dont think "crashing session" will guarantee you higher RAM... it depends on the usage... Having used both free and pro versions, here are limits on RAM:

**Free Version: ** Regardless of your acclerator (GPU/TPU/CPU), "free" version gives you only 12.5 GB

With Pro, you need to change RAM type:
Navigate to Runtime and click "Change Runtime type" and select Runtime shape as "High RAM"... this should give you 35.5 GB

Hi, I have buy colab pro, also click”change runtime type” but only have 25.5GB RAM, any suggestion?

@tasomaniac
Copy link

tasomaniac commented Aug 31, 2020

While working on your projects, you most probably have lots of data created by other data. This goes on an on and collects lots of garbage. You can do the following to save some RAM space very easily. Deleting ~4 dataframes allowed me to save 6GB of RAM after garbage collection.

import gc

# random operation
trainAttrX, testAttrX, trainY, testY = train_test_split(df['trainData'], df['testData'], test_size=0.25, random_state=111)

# after this I don't need `df` anymore.
del df
gc.collect()

@u-aqyuni
Copy link

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

Thanks so much. It really works

@ochen1
Copy link

ochen1 commented Dec 19, 2020

You can also use this shorter version to crash the instance if you'd like:

[1]*10**10

I wonder if there's a better way to do this? 🤔 Maybe by reverse engineering the APIs there might be a way to get the higher RAM runtime without having to crash it? This could be then made into a Chrome extension?

I personally don't like wasting resources, even if its not mine (Google's).

Wait it doesn't work anymore because Colab pro is a thing. Did they leave the API open though 🤨 ?

image

@YukiSakuma
Copy link

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

Looks like this trick doesn't work anymore... @karthiikselvam 😢

@Vaaaaaalllll
Copy link

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

Looks like this trick doesn't work anymore... @karthiikselvam 😢

Doesn't work :(

@almera-vs
Copy link

all methods aren't working anymore

currently its impossible to bypass the limit in any way👨‍💻

@ghost
Copy link

ghost commented May 14, 2021

Copying the notebook like @SBAESH suggested is working perfectly for me, even now. Don't run that code, just copy the notebook(copy the notebook and not the code of the notebook) and you have the RAM with you. Click on 'file' and scroll to 'Save a copy to Drive'. Click on that, go to your colab account again, and you will see a notebook titled 'Copy of Increase RAM Reference Notes By Techhawa .ipynb'. Edit the code in this copy notebook and write whatever you want now, you have 25gb RAM.
@SBAESH thank you so much for this trick, you're the greatest human being to ever exist.

@YukiSakuma
Copy link

@BleepLogger I was doing exactly that since the user posted the trick and it worked everytime until I last tried in April and just now again.

@OpenWaygate
Copy link

@craigcitro I think this issue need to be re-opened.
I can't see get more ram when my session crash because of using all ram (which is about 12 gig).
we really can't do much .
any solution ?

The thing is that google has now changed their policy and this trick doesn't work anymore. The only way to get more than 12 GB of RAM is to make a copy of earlier notebook which was alloted 25 GB RAM.
Use this https://colab.research.google.com/drive/155S_bb3viIoL0wAwkIyr1r8XQu4ARwA9?usp=sharing
copy to your drive and follow the instructions in the file.

It works, but I cannot Change Runtime Type to GPU/TPU

@Emekaborisama
Copy link

Yes, purchase google colab pro and run the script on the colab terminal

@almera-vs
Copy link

Yes, purchase google colab pro and run the script on the colab terminal

this thread is about increasing ram without paying, isn't this obvious?

@shreyaspj20
Copy link

@BleepLogger , Thanks a lot for sharing. Really helped me a lot.

@Fetulhak
Copy link

Fetulhak commented Jul 7, 2021

@OpenWaygate do you come up with any solution? to change into GPU. I think the 25GB will remain available only if you use CPU

@Fetulhak
Copy link

Fetulhak commented Jul 7, 2021

Copying the notebook like @SBAESH suggested is working perfectly for me, even now. Don't run that code, just copy the notebook(copy the notebook and not the code of the notebook) and you have the RAM with you. Click on 'file' and scroll to 'Save a copy to Drive'. Click on that, go to your colab account again, and you will see a notebook titled 'Copy of Increase RAM Reference Notes By Techhawa .ipynb'. Edit the code in this copy notebook and write whatever you want now, you have 25gb RAM.
@SBAESH thank you so much for this trick, you're the greatest human being to ever exist.

This only works for CPU

@askfriends
Copy link

Just crashed Colab via this code:

d=[]
while(1):
  d.append('1')

Indeed, a message shows up, asking if you want to increase RAM usage. RAM is then upgraded to 35GB.

Thanks bruh but how about getting more disk space?

@leminhyen2
Copy link

I am a pro + buyer but after half a month of usage, Google limited me with only 12GB RAM and all my NLP model crashed while they would have worked previously with at least 25GB RAM.

@NightMachinery
Copy link

Colab Pro gives ~25GB of RAM. How much more does Pro+ give?

@youyinnn
Copy link

The hack is not working now for free colab lol. The only way to increase the RAM is to upgrade it.

@zinedineliass
Copy link

it just works with 25 GB RAM and CPU
how to make it work with 25 GB ram and GPU ??

@MarkusDegen
Copy link

I tried reading a 16GB csv into colab pro+ (it says 51GB), but i still get creashes due to memory allocation of 16GB :-(
Pay 40 EUR per month for it, thinking about downgrading again

@VuongTuanKhanh
Copy link

I tried reading a 16GB csv into colab pro+ (it says 51GB), but i still get creashes due to memory allocation of 16GB :-( Pay 40 EUR per month for it, thinking about downgrading again

I believe 16GB is the RAM. It crashed because it had to handle some really heavy task. 51Gb is just the storage

@ashioyajotham
Copy link

It is no longer working folks maybe just upgrade or kaggle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests