Unverified Commit 7dc209c6 authored by Jeff Rasley's avatar Jeff Rasley Committed by GitHub
Browse files

add basic post-install test (#209)

* add basic post-install test
parent a90a32d7
import torch
import importlib
try:
import deepspeed as ds
print("deepspeed successfully imported")
except ImportError as err:
raise err
print(f"torch version: {torch.__version__}")
print(f"deepspeed info: {ds.__version__}, {ds.__git_hash__}, {ds.__git_branch__}")
try:
apex_C = importlib.import_module('apex_C')
print("apex successfully installed")
except Exception as err:
raise err
try:
fused_lamb = importlib.import_module('fused_lamb_cuda')
print('deepspeed kernels successfully installed')
except Exception as err:
raise err
try:
from apex.optimizers import FP16_Optimizer
print("using old-style apex")
except ImportError:
print("using new-style apex")
......@@ -164,8 +164,12 @@ if [ "$local_only" == "1" ]; then
echo "Installing deepspeed"
$PIP_SUDO pip uninstall -y deepspeed
$PIP_SUDO $PIP_INSTALL dist/deepspeed*.whl
python -c 'import deepspeed; print("deepspeed info:", deepspeed.__version__, deepspeed.__git_branch__, deepspeed.__git_hash__)'
python basic_install_test.py
if [ $? == 0 ]; then
echo "Installation is successful"
else
echo "Installation failed"
fi
fi
else
local_path=`pwd`
......@@ -193,9 +197,10 @@ else
echo "Installing deepspeed"
pdsh -w $hosts "$PIP_SUDO pip uninstall -y deepspeed"
pdcp -w $hosts dist/deepspeed*.whl $tmp_wheel_path/
pdcp -w $hosts basic_install_test.py $tmp_wheel_path/
pdsh -w $hosts "$PIP_SUDO $PIP_INSTALL $tmp_wheel_path/deepspeed*.whl"
pdsh -w $hosts "python -c 'import deepspeed; print(\"deepspeed info:\", deepspeed.__version__, deepspeed.__git_branch__, deepspeed.__git_hash__)'"
pdsh -w $hosts "python $tmp_wheel_path/basic_install_test.py"
echo "Installation is successful"
fi
pdsh -w $hosts "if [ -d $tmp_wheel_path ]; then rm $tmp_wheel_path/*.whl $tmp_wheel_path/requirements.txt; rmdir $tmp_wheel_path; fi"
pdsh -w $hosts "if [ -d $tmp_wheel_path ]; then rm $tmp_wheel_path/*.whl $tmp_wheel_path/basic_install_test.py $tmp_wheel_path/requirements.txt; rmdir $tmp_wheel_path; fi"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment