Tencent / PhoenixGo

Go AI program which implements the AlphaGo Zero paper
Other
2.88k stars 577 forks source link

.cache folder is big : 6.1 GB after building : cleanup possible ? #76

Closed wonderingabout closed 5 years ago

wonderingabout commented 5 years ago

after the building is finished, .cache is not cleaned and it is big

6.1 GB on my computer

cache cleanup

however, windows and mac binaries are much smaller, so i assume a lot of cleanup is possible on linux

what is the folders that can be safely removed in .cache and in PhoenixGo folders ?

thanks @wodesuck

wodesuck commented 5 years ago

bazel clean

wonderingabout commented 5 years ago

thanks :)

i gained 1.3 GB, which is still worth taking :

bazelafter beforebazel after bazelv2

to gain more space, i should rebuild with disabling all the options i dont need during the bazel build (google cloud, android workspaces, etc...)

wonderingabout commented 5 years ago

update :

bazel clean broke the engine

i'll rebuild to see (i'll also use this opportunity to remove the huge .cache bazel folder and build only what i need this time (disable google cloud, aws, android, etc..)

enginebroken

update 2 :

as said earlier, i removed ./cache/bazel (which was 4.8 GB size even after bazel clean that broke the engine)

cache bazel removed cache bazel removed 2

now i want to see how much space can be gained by reducing the install options to minimum only

update 3 :

it is too late now, will try next time

i hope we can gain new knowledge from this

wodesuck commented 5 years ago

You should backup the binary and library you just built (mcts_main and libtensorflow_framework.so) before cleanup.

wonderingabout commented 5 years ago

oh ok, will try to clean after i rebuild (and confirm it works first)

wonderingabout commented 5 years ago

ok, so i also removed the old PhoenixGo folder (after backup of config files)

then this was my free space (13.5 GB)

beforebazelcompile

then i disabled as much things that i thought were not needed :

bazel1 bazel2

also, it seems using bazel 0.11.1 instead of 0.17.2 somehow made the compile smoother (it felt more stable looking at RAM usage overall, but it still takes a lot of RAM, i recommend to do a clean reboot and exit all running programs before starting)

1

it is much smaller now !! 2.6 GB (also i have now 10.2 GB free in the system as compared to 6 GB, a huge difference !)

bazel4 bazel3

also, this is the size of the phoenigo folder : phoenixgo1

2.6 GB ~/.cache/bazel/ + 0.7 GB ~/PhoenixGo/ = 3.3 GB total, which is the same size than the difference between system free space ( before vs after bazel = 13.4 vs 10.1 = 3.3 GB)

it is already a big gain for me (6.1 GB last time, 2.6 GB now, but i want to try to reduce it more)

first, i confirmed that the engine works before running bazel clean

phoenixgo2

then i backup mcts_main and libtensorflow_framework.so

now i run bazel clean, trying to reduce the size more

after bazel clean ~/.cache/bazel/ has been reduced from 2.6 GB to 1.4 GB !! PhoenixGo folder size remains the same (700 MB)

wonderingabout commented 5 years ago

update :

i backed up mcts_main , libtensorflow_framework.so , and just in case i backed up all the /PhoenixGo/bazel-bin/_solib_local/ folder entirely too

then i copied mcts_main and libtensorflow_framework.so in mcts folder, and also libtensorflow_framework.so in ~\PhoenixGo\ , but i get the following error

phoenixgo7

but i get this error :

where should i copy the libtensorflow_framework.so file (i tried all existing directories with same error)

and second question : does bazel clean remove the possibility to build later with batch size 32 ? (as we saw in #75 )

thanks

update :

i'll try to copy the backed up files in their original directory tree now

update 2 : recreating the same tree still fails (i assume its because these were symbolic links, not paths)

so where should i copy the .so file ?

wonderingabout commented 5 years ago

update : i found that bazel-bin folder is a link to this place :

bazelbin location

i will try to backup the original files mcts and .so then run bazel clean again, then recreate their original tree in .cache

wonderingabout commented 5 years ago

update : i increased the size of my ubuntu parition, and although its interesting, 3GB is not big now,

i rebuilt phoenixgo again, so i will not try this anytime soon if someone does, update this thread or start another then