Install TinyMS¶
Installation For Beginners¶
Pypi¶
For users who own a clean environment, it is recommended to use pypi to install TinyMS given that the following requirements are meet. For those who don’t, Anaconda is a good choice for setting up the python environment.
Prerequisites
OS:
Ubuntu 18.04
orWindows 10
Python:
3.7.5
For China based users it is recommended to run the following command lines to help with faster download
mkdir -pv /root/.pip \
&& echo "[global]" > /root/.pip/pip.conf \
&& echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
&& echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf
pip install tinyms==0.1.0
Docker¶
For those who don’t want to affect the local develop environment due to difficulty of meeting the prerequisites, using docker to install is recommended
docker:
v18.06.1-ce
If user wants to try the tutorials that are written in .ipynb
files,please pull jupyter version of TinyMS in which jupyter components are installed by default
Default version
docker pull tinyms/tinyms:0.1.0
Jupyter version
If user wants to try jupyter, run the following command line
docker pull tinyms/tinyms:0.1.0-jupyter
docker run -it --net=host tinyms/tinyms:0.1.0-jupyter
Open a browser on the local machine, type in
<Your_external_IP_address>:8888
Example: 188.8.8.88:8888
, the default password is tinyms
,then user can log in to jupyter
Installation For Experienced Developers¶
For developers who want to develop based on TinyMS, install from source
sudo apt-get install -y libssl-dev
git clone https://github.com/tinyms-ai/tinyms.git
cd tinyms
pip install -r requirements.txt
python setup.py install
Validate installation¶
Create a python
or jupyter
kernel, input the following codes
import tinyms as ts
from tinyms.primitives import tensor_add
x = ts.ones([2, 3])
y = ts.ones([2, 3])
print(tensor_add(x, y))
If the output is similar to below, then the installation is valid
[[2. 2. 2.]
[2. 2. 2.]]