LoginSignup
3
3

More than 3 years have passed since last update.

ColabのGPUのRAMを最大限に活用したい。

Posted at

方法

機械学習ではバッチサイズを大きくしたいのでメモリをできるだけ多く使いたい。
colabでの通常のメモリ

!free -h

              total        used        free      shared  buff/cache   available
Mem:            12G        562M         10G        900K        2.0G         11G
Swap:            0B          0B          0B

casheで2Gも食ってる。

[_ for _ in range(10000000000)]
これで強制的にメモリを溢れさせると...

!free -h

              total        used        free      shared  buff/cache   available
Mem:            25G        603M         24G        900K        427M         24G
Swap:            0B          0B          0B

427mにcasheが減っている。
そしてメモリが12Gから25Gに変更

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3