Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
add local mode for cupy
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakuyume committed May 14, 2019
1 parent ee6e4ae commit de7dc96
Showing 1 changed file with 51 additions and 30 deletions.
81 changes: 51 additions & 30 deletions .pfnci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,59 @@ TEMP=$(mktemp -d)
mount -t tmpfs tmpfs ${TEMP}/ -o size=100%

REPOSITORY=${REPOSITORY:-chainercv}
if [ ${REPOSITORY} = chainercv ]; then
cp -a . ${TEMP}/chainercv
elif [ ${REPOSITORY} = chainer ]; then
CHAINER=local
cp -a . ${TEMP}/chainer
mv ${TEMP}/chainer/chainercv/ ${TEMP}/
fi
case ${REPOSITORY} in
chainercv)
CUPY=${CHAINER}
cp -a . ${TEMP}/chainercv
;;
chainer)
CHAINER=local
CUPY=master
cp -a . ${TEMP}/chainer
mv ${TEMP}/chainer/chainercv/ ${TEMP}/
;;
cupy)
CHAINER=master
CUPY=local
cp -a . ${TEMP}/cupy
mv ${TEMP}/cupy/chainercv/ ${TEMP}/
;;
esac
cd ${TEMP}/

if [ ${CHAINER} = stable ]; then
echo pip${PYTHON} install \
chainer==${STABLE} \
cupy-cuda92==${STABLE} >> install.sh
elif [ ${CHAINER} = latest ]; then
echo pip${PYTHON} install \
chainer==${LATEST} \
cupy-cuda92==${LATEST} >> install.sh
elif [ ${CHAINER} = master ]; then
CHAINER_MASTER=$(git ls-remote https://github.com/chainer/chainer.git master | cut -f1)
echo pip${PYTHON} install \
git+https://github.com/chainer/chainer.git@${CHAINER_MASTER}#egg=chainer >> install.sh

CUPY_MASTER=$(gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/master -)
gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/${CUPY_MASTER}/cuda9.2/*.whl .
echo pip${PYTHON} install cupy-*-cp${PYTHON}*-cp${PYTHON}*-linux_x86_64.whl >> install.sh
elif [ ${CHAINER} = local ]; then
echo pip${PYTHON} install -e chainer/ >> install.sh

CUPY_MASTER=$(gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/master -)
gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/${CUPY_MASTER}/cuda9.2/*.whl .
echo pip${PYTHON} install cupy-*-cp${PYTHON}*-cp${PYTHON}*-linux_x86_64.whl >> install.sh
fi
case ${CHAINER} in
stable)
echo pip${PYTHON} install chainer==${STABLE} >> install.sh
;;
latest)
echo pip${PYTHON} install chainer==${LATEST} >> install.sh
;;
master)
CHAINER_MASTER=$(git ls-remote https://github.com/chainer/chainer.git master | cut -f1)
echo pip${PYTHON} install \
git+https://github.com/chainer/chainer.git@${CHAINER_MASTER}#egg=chainer >> install.sh
;;
local)
echo pip${PYTHON} install -e chainer/ >> install.sh
;;
esac

case ${CUPY} in
stable)
echo pip${PYTHON} install cupy-cuda92==${STABLE} >> install.sh
;;
latest)
echo pip${PYTHON} install cupy-cuda92==${LATEST} >> install.sh
;;
master)
CUPY_MASTER=$(gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/master -)
gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/${CUPY_MASTER}/cuda9.2/*.whl .
echo pip${PYTHON} install cupy-*-cp${PYTHON}*-cp${PYTHON}*-linux_x86_64.whl >> install.sh
;;
local)
echo pip${PYTHON} install -e cupy/ >> install.sh
;;
esac

echo pip${PYTHON} install -e chainercv/ >> install.sh

Expand Down

0 comments on commit de7dc96

Please sign in to comment.