ray使用手册

  1. 安装conda:wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh

  2. bash Anaconda3-2021.05-Linux-x86_64.sh

export PATH=/home/zjy/anaconda3/bin:$PATH
3. source ~/.bashrc

  1. conda create -n ray python==3.6.6

  2. conda activate ray

  3. pip install ray==1.5.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
    conda insatll ray ==1.6.0

  4. 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

  5. 示例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))

  1. 运行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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值