runhouse
v0.0.37
Runhouse可以在研究和生产之间进行快速,具有成本效益的机器学习开发。它使您可以将Python功能和类派遣到您自己的任何云计算基础架构中,并热切地称其为本地。这意味着:
跨簇,区域或云进行编排是微不足道的,像缩放,容错或多步工作流这样的复杂逻辑也是如此。
Runhouse API很简单。将您的模块(功能和类)发送到计算中的环境(工作过程)中,这样:
import runhouse as rh
from diffusers import StableDiffusionPipeline
def sd_generate ( prompt , ** inference_kwargs ):
model = StableDiffusionPipeline . from_pretrained ( "stabilityai/stable-diffusion-2-base" ). to ( "cuda" )
return model ( prompt , ** inference_kwargs ). images
if __name__ == "__main__" :
img = rh . Image ( "sd_image" ). install_packages ([ "torch" , "transformers" , "diffusers" ])
gpu = rh . cluster ( name = "rh-a10x" , instance_type = "A10G:1" , provider = "aws" , image = img ). up_if_not ()
# Deploy the function and environment (syncing over local code changes and installing dependencies)
remote_sd_generate = rh . function ( sd_generate ). to ( gpu )
# This call is actually an HTTP request to the app running on the remote server
imgs = remote_sd_generate ( "A hot dog made out of matcha." )
imgs [ 0 ]. show ()
# You can also call it over HTTP directly, e.g. from other machines or languages
print ( remote_sd_generate . endpoint ())使用上述简单结构,您可以构建,调用和共享:
您可以解锁独特的可观察性和与此存储库的补充产品Runhouse Den共享功能。
将函数或类发送到远程计算后,Runhouse允许您坚持并将其作为服务共享,从而将其他冗余的AI活动变成了团队或公司的常见模块化组件。
从任何地方登录以节省,共享和加载资源,并观察单个玻璃窗格上的使用,日志和计算利用:
runhouse login或来自Python:
import runhouse as rh
rh . login ()扩展上面的示例以通过DEN共享和加载我们的应用:
remote_sd_generate . share ([ "[email protected]" ])
# The service stub can now be reloaded from anywhere, always at yours and your collaborators' fingertips
# Notice this code doesn't need to change if you update, move, or scale the service
remote_sd_generate = rh . function ( "/your_username/sd_generate" )
imgs = remote_sd_generate ( "More matcha hotdogs." )
imgs [ 0 ]. show ()如果您在这里看不到自己喜欢的计算,请伸出手(run.house的名字)。
?入门:安装,设置和快速演练。
文档:详细的API参考,基本API示例和演练,端到端教程以及高级体系结构概述。
?博客:深入了解符合屋的功能,用例和AI Infra的未来。
?不和谐:加入我们的社区提出问题,分享想法并获得帮助。
? Twitter :关注我们以获取更新和公告。
在Discord上给我们发消息,给我们发送电子邮件(run.house的名字)或创建问题。
我们欢迎捐款!请查看贡献。