Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rayで分散処理

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for sakami sakami
April 08, 2026
0

 Rayで分散処理

Avatar for sakami

sakami

April 08, 2026

Transcript

  1. 4 ▪ 分散処理を行うためのPythonライブラリ Rayとは? https://github.com/ray-project/ray • シンプルで柔軟なAPI: 既存のPythonコードからの書き換えが簡単 • 分散処理への書き換え:

    ローカルとほとんど同じコードで分散処理を実行できる • リソース管理機能: orchestration, scheduling, fault-tolerance, auto-scaling
  2. 5 ▪ Rayで動作するライブラリ群 ▪ 機械学習ワークロードをすべてカバーする Ray AI Libaries • Ray

    Data: データ処理 • Ray Train: 分散学習 • Ray Tune: ハイパラチューニング • RLlib: 強化学習 • Ray Serve: 推論サービング https://www.youtube.com/watch?v=oH9pJavu-PU
  3. 8 ▪ ローカルで並列処理を実行するコード ▪ 各処理はTaskと呼ばれる ▪ ray.get はすべての処理が完了するまで待ち、結果を取得する関数 Tasks 1.

    並列処理したい関数に @ray.remote デコレータをつける 2. ray.init() を呼んで Ray を起動する 3. <関数名>.remote() を呼んで、タスクを実行する 4. ray.get() を呼んで、結果を取得する
  4. 11 ▪ プロセスに状態を持たせることができる ▪ 各プロセスはActorと呼ばれる ▪ 簡単に各プロセスと情報をやり取りできる Actors 1. クラスに

    @ray.remote デコレータをつける 2. <クラス名>.remote() を呼んでプロセスを初期化する 3. <クラス名>.<関数名>.remote() を呼んで処理を実行する
  5. 17 ▪ 実行したいPythonコードのray.initの引数に address=”auto”を追加 ▪ Ray Clusterを立ち上げた状態で、$ ray submit ~~.yaml

    ~~.py を実行する Ray ClusterでPythonコードを実行する ray.init の引数に address=”auto” を追加
  6. 23 ▪ Vertex AI上にRay Clusterを構成する ▪ Ray Clusterと比較したメリット ▪ BigQueryやVertex

    AI Notebooks などのGoogle Cloudサービスとの 連携が効率的にできる ▪ インスタンスの外部ポートを 開けなくてもよい Ray on Vertex AI https://cloud.google.com/vertex-ai/docs/open-source/ray-on-vertex-ai/overview
  7. 24 ▪ GitHub - ray-project/ray ▪ Welcome to Ray! —

    Ray 2.49.2 ▪ Getting Started with Ray Clusters ▪ Ray, a Unified Distributed Framework for the Modern AI Stack | Ion Stoica ▪ Ray Summit 2025 ▪ GitHub - ray-project/ray-educational-materials ▪ The Modern AI Stack: Ray ▪ GitHub - vllm-project/vllm ▪ [Ray Meetup] Ray + vLLM in Action: Lessons from Pinterest and Large Scale Distributed Inference ▪ Ray on Vertex AI overview | Google Cloud ▪ Ray on Vertex AI 入門 参考リンク