-
安装conda:wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
-
bash Anaconda3-2021.05-Linux-x86_64.sh
export PATH=/home/zjy/anaconda3/bin:$PATH
3. source ~/.bashrc
-
conda create -n ray python==3.6.6
-
conda activate ray
-
pip install ray==1.5.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
conda insatll ray ==1.6.0 -
PS机器学习tutorial:pip install torch torchvision filelock -i https://pypi.tuna.tsinghua.edu.cn/simple
https://docs.ray.io/en/master/auto_examples/plot_parameter_server.html
-
示例code:test.py
import ray
import time
ray.init() #local mode
@ray.remote
#@ray.remote(num_gpus=0.1)
def f1(x):
#time.sleep(1)
a = x * x
return a
def f2(x):
#time.sleep(1)
a = x * x
return a
futures = [f.remote(i) for i in range(4)]
print(ray.get(futures))
- 运行code:python test.py
-------------------暂时不需要看下面内容----------------------
10.build ray by source
cd python/ray/new_dashboard/client && npm install && npm ci && npm run build): ‘/home/yangkun/anaconda3/envs/ray/lib/python3.6/site-packages/ray/new_dashboard/client/build’
https://docs.ray.io/en/master/development.html
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt -y install nodejs make gcc g++
/tmp/ray/session_latest/logs/raylet.err 可以查看日志
https://docs.ray.io/en/master/debugging.html
python -m ipykernel install --user --name ray --display-name “ray”
pip install -e . --verbose --user
pip3 install -e . --verbose --user