Ray Adapter安装部署实战:从零开始搭建AI分布式计算环境 Ray Adapter安装部署实战从零开始搭建AI分布式计算环境【免费下载链接】ray-adapterCompatible with the core interfaces of the open-source software Ray, it facilitates the seamless migration of workloads running on Ray (such as vllm/verl, etc.) to the Yuanrong cluster, while also enjoying the performance advantages brought by Yuanrongs deep optimization on Huawei Kunpeng and Ascend hardware.项目地址: https://gitcode.com/openeuler/ray-adapter前往项目官网免费下载https://ar.openeuler.org/ar/Ray Adapter是一款兼容开源软件Ray核心接口的工具能帮助用户将运行在Ray上的工作负载如vllm/verl等无缝迁移到openYuanrong集群充分享受openYuanrong在华为鲲鹏和昇腾硬件上深度优化带来的性能优势。本文将为你详细介绍Ray Adapter的安装部署步骤助你快速搭建起高效的AI分布式计算环境。准备工作安装前的环境检查在安装Ray Adapter之前确保你的系统满足以下基本要求操作系统建议使用Linux系统如openEuler等Python环境Python 3.6及以上版本网络环境能够正常访问互联网以便下载安装相关依赖包快速安装一键获取Ray Adapter安装Ray Adapter非常简单只需执行以下命令即可pip install https://openyuanrong.obs.cn-southwest-2.myhuaweicloud.com/ray_adapter-0.7.0-py3-none-any.whl这条命令会从指定的地址下载Ray Adapter的安装包并自动完成安装。安装过程中系统会自动处理相关依赖其中主要的依赖包为openyuanrong。部署指南开启openYuanrong集群之旅完成Ray Adapter的安装后接下来需要进行部署。你可以查看openYuanrong文档的安装部署章节获取详细的部署步骤和配置说明确保你的集群环境能够正常运行Ray Adapter。简单使用轻松迁移Ray应用将原来使用Ray开发的应用代码迁移到Ray Adapter非常便捷只需将代码中的import ray替换为import ray_adapter as ray即可。不过在使用过程中需要关注接口的差异。下面为你介绍一些常用接口的使用示例。remote接口使用示例import ray_adapter as ray ray.init() ray.remote(num_cpus1, max_retries3) def test_function(): return Hello! remote_function test_function.remote() result ray.get(remote_function) print(result) ray.shutdown()在Ray Adapter中remote接口支持参数解析目前支持的参数有num_cpus,num_npus,resources,concurrency_groups,max_concurrency。init接口使用示例import ray_adapter as ray ray.init() ray.shutdown()init接口目前定义的参数只有logging_level,num_cpus,runtime_env。get接口使用示例import ray_adapter as ray ray.init() ray.remote() def add(a, b): return a b obj_ref_1 add.remote(1, 2) obj_ref_2 add.remote(3, 4) result ray.get([obj_ref_1, obj_ref_2], timeout-1) print(result) ray.shutdown()接口差异了解Ray与Ray Adapter的不同Ray Adapter虽然兼容Ray的核心接口但在一些接口的参数和返回值上存在差异。以下是一些主要接口的差异说明接口名称与 Ray接口 的差异remote支持参数解析ray_adapter 目前支持参数有num_cpus,num_npus,resources,concurrency_groups,max_concurrencymethod目前仅支持num_returns参数init目前定义参数只有logging_level,num_cpus,runtime_envget_actor返回的是自定义 ActorHandle 对象而非 Ray 原生 actor handleruntime_context().namespace目前无法获取 actor 的命名空间ray_adapter 目前定义接口返回空了解这些差异有助于你更好地使用Ray Adapter避免在迁移应用时出现不必要的问题。总结开启高效AI分布式计算通过本文的介绍你已经了解了Ray Adapter的安装、部署和基本使用方法。Ray Adapter作为一款强大的工具为将Ray工作负载迁移到openYuanrong集群提供了便捷的途径让你能够充分利用华为鲲鹏和昇腾硬件的性能优势开展高效的AI分布式计算工作。希望本文对你有所帮助祝你在AI分布式计算的道路上取得更多成果【免费下载链接】ray-adapterCompatible with the core interfaces of the open-source software Ray, it facilitates the seamless migration of workloads running on Ray (such as vllm/verl, etc.) to the Yuanrong cluster, while also enjoying the performance advantages brought by Yuanrongs deep optimization on Huawei Kunpeng and Ascend hardware.项目地址: https://gitcode.com/openeuler/ray-adapter创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考