Created
November 18, 2020 01:44
-
-
Save rohan-varma/116050f432af677f3f79a2819b83e6b6 to your computer and use it in GitHub Desktop.
ccache setup for PT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run this script: | |
#!/bin/bash | |
if ! ls ~/ccache/bin/ccache | |
then | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y cmake | |
mkdir -p ~/ccache | |
pushd ~/ccache | |
rm -rf ccache | |
git clone https://github.com/ccache/ccache.git | |
mkdir -p ccache/build | |
pushd ccache/build | |
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/ccache -DENABLE_TESTING=OFF -DZSTD_FROM_INTERNET=ON .. | |
make -j$(nproc) install | |
popd | |
popd | |
mkdir -p ~/ccache/lib | |
mkdir -p ~/ccache/cuda | |
ln -s ~/ccache/bin/ccache ~/ccache/lib/cc | |
ln -s ~/ccache/bin/ccache ~/ccache/lib/c++ | |
ln -s ~/ccache/bin/ccache ~/ccache/lib/gcc | |
ln -s ~/ccache/bin/ccache ~/ccache/lib/g++ | |
ln -s ~/ccache/bin/ccache ~/ccache/cuda/nvcc | |
~/ccache/bin/ccache -M 25Gi | |
fi | |
export PATH=~/ccache/lib:$PATH | |
export CUDA_NVCC_EXECUTABLE=~/ccache/cuda/nvcc | |
Note if you are on redhat, you have to switch apt-get with yum | |
Next, set /home/rvarm1/ccache/bin/ccache -M 25Gi | |
See stats with /home/rvarm1/ccache/bin/ccache -s | |
After you rebuild pytorch, you should see a faster build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment