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的名字)或創建問題。
我們歡迎捐款!請查看貢獻。