Deadline Cloud での AI エージェントの使用 - Deadline クラウド

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

Deadline Cloud での AI エージェントの使用

AI エージェントを使用して、Deadline Cloud でジョブバンドルの記述、conda パッケージの開発、ジョブのトラブルシューティングを行います。このトピックでは、AI エージェントとは何か、AI エージェントを効果的に使用するための重要なポイント、エージェントが Deadline Cloud を理解するのに役立つリソースについて説明します。

AI エージェントは、大規模言語モデル (LLM) を使用してタスクを自律的に実行するソフトウェアツールです。AI エージェントは、フィードバックに基づいてファイルの読み取りと書き込み、コマンドの実行、ソリューションの反復を行うことができます。例としては、Kiro や IDE 統合アシスタントなどのコマンドラインツールなどがあります。

AI エージェントを使用するための重要なポイント

次のキーポイントは、Deadline Cloud で AI エージェントを使用すると、より良い結果を得るのに役立ちます。

  • グラウンディングを提供する – AI エージェントは、関連するドキュメント、仕様、例にアクセスできる場合に最高のパフォーマンスを発揮します。エージェントを特定のドキュメントページに向け、既存のサンプルコードをリファレンスとして共有し、関連するオープンソースリポジトリをローカルワークスペースにクローンし、サードパーティーアプリケーションのドキュメントを提供することで、グラウンディングを提供できます。

  • 成功基準を指定する – エージェントの期待される成果と技術要件を定義します。たとえば、ジョブバンドルの開発をエージェントに依頼する場合は、ジョブの入力、パラメータ、および期待される出力を指定します。仕様が不明な場合は、まずエージェントにオプションを提案してもらい、次に要件を一緒に絞り込みます。

  • フィードバックループを有効にする – AI エージェントは、ソリューションをテストしてフィードバックを受け取ることができるときに、より効果的に反復処理を行います。最初の試行で有効なソリューションを期待する代わりに、エージェントにソリューションを実行して結果を確認する機能を与えます。このアプローチは、エージェントがステータスの更新、ログ、検証エラーにアクセスできる場合に適しています。たとえば、ジョブバンドルを開発するときは、エージェントがジョブを送信してログを確認できるようにします。

  • 反復を想定する – 適切なコンテキストであっても、エージェントは軌道から外れたり、環境と一致しない仮定を立てることができます。エージェントがタスクにどのようにアプローチするかを観察し、その過程でガイダンスを提供します。エージェントが問題が発生した場合は、欠落しているコンテキストを追加し、特定のログファイルをポイントしてエラーを検出し、検出時に要件を絞り込み、エージェントが避けるべきことを明示的に記述するための負の要件を追加します。

エージェントコンテキストのリソース

以下のリソースは、AI エージェントが Deadline Cloud の概念を理解し、正確な出力を生成するのに役立ちます。

  • Deadline Cloud Model Context Protocol (MCP) サーバー – Model Context Protocol をサポートするエージェントの場合、deadline-cloud リポジトリには、ジョブを操作するための MCP サーバーを含む Deadline Cloud クライアントが含まれています。

  • AWSドキュメント MCP サーバー – MCP をサポートするエージェントの場合、Deadline Cloud ユーザーガイドやデベロッパーガイドなど、ドキュメントに直接アクセスできるようにAWSドキュメント AWS MCP サーバーを設定します。

  • Open Job Description 仕様 – GitHub の Open Job Description 仕様は、ジョブテンプレートのスキーマを定義します。エージェントがジョブテンプレートの構造と構文を理解する必要がある場合は、このリポジトリを参照してください。

  • deadline-cloud-samplesdeadline-cloud-samples リポジトリには、一般的なアプリケーションとユースケースのサンプルジョブバンドル、conda レシピ、CloudFormationテンプレートが含まれています。

  • aws-deadline GitHub 組織aws-deadline GitHub 組織には、他の統合の例として使用できる多くのサードパーティーアプリケーション用のリファレンスプラグインが含まれています。

プロンプトの例: ジョブバンドルの記述

次のプロンプト例は、AI エージェントを使用して、AI イメージを生成するための LoRA (Low-Rank Adaptation) アダプターをトレーニングするジョブバンドルを作成する方法を示しています。このプロンプトは、前述の重要なポイントを示しています。関連するリポジトリを指し示し、ジョブバンドル出力の成功基準を定義し、反復開発のフィードバックループの概要を示します。

Write a pair of job bundles for Deadline Cloud that use the diffusers Python library to train a LoRA adapter on a set of images and then generate images from it. Requirements: - The training job takes a set of JPEG images as input, uses an image description, LoRA rank, learning rate, batch size, and number of training steps as parameters, and outputs a `.safetensors` file. - The generation job takes the `.safetensors` file as input and the number of images to generate, then outputs JPEG images. The jobs use Stable Diffusion 1.5 as the base model. - The jobs run `diffusers` as a Python script. Install the necessary packages using conda by setting the job parameters: - `CondaChannels`: `conda-forge` - `CondaPackages`: list of conda packages to install For context, clone the following repositories to your workspace and review their documentation and code: - OpenJobDescription specification: https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/wiki/2023-09-Template-Schemas.md - Deadline Cloud sample job bundles: https://github.com/aws-deadline/deadline-cloud-samples/tree/mainline/job_bundles - diffusers library: https://github.com/huggingface/diffusers Read through the provided context before you start. To develop a job bundle, iterate with the following steps until the submitted job succeeds. If a step fails, update the job bundle and restart the loop: 1. Create a job bundle. 2. Validate the job template syntax: `openjd check` 3. Submit the job to Deadline Cloud: `deadline bundle submit` 4. Wait for the job to complete: `deadline job wait` 5. View the job status and logs: `deadline job logs` 6. Download the job output: `deadline job download-output` To verify the training and generation jobs work together, iterate with the following steps until the generation job produces images that resemble the dog in the training data: 1. Develop and submit a training job using the training images in `./exdog` 2. Wait for the job to succeed then download its output. 3. Develop and submit a generation job using the LoRA adapter from the training job. 4. Wait for the job to succeed then download its output. 5. Inspect the generated images. If they resemble the dog in the training data, you're done. Otherwise, review the job template, job parameters, and job logs to identify and fix the issue.