-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
- Set the
PROJECT_ID
environment variable.
export PROJECT_ID="<your-project-id>"
- Set the
REGION
environment variable; it defaults to"us-central1"
. For now, the only other supported region iseurope-west4
. Learn more about Vertex AI regions.
export REGION="us-central1"
- Set the
-
Make sure that billing is enabled for your Google Cloud project.
-
Install the Google Cloud CLI.
-
Initialize the gcloud CLI.
gcloud init
-
Enable the Vertex AI, Artifact Registry, Cloud Build, Cloud Deploy and Cloud Storage APIs.
gcloud services enable \ aiplatform.googleapis.com \ artifactregistry.googleapis.com \ compute.googleapis.com \ cloudbuild.googleapis.com \ clouddeploy.googleapis.com \ notebooks.googleapis.com \ --project $PROJECT_ID
Make sure the default Compute Engine service account has sufficient permissions.
-
Add the
iam.serviceAccountUser
role, which includes theactAs
permission to deploy to the runtime.gcloud iam service-accounts add-iam-policy-binding $(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --role="roles/iam.serviceAccountUser" \ --project=$PROJECT_ID
-
Add the
clouddeploy.jobRunner
role.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --role="roles/clouddeploy.jobRunner"
-
Add the
roles/clouddeploy.viewer
role.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --role="roles/clouddeploy.viewer"
-
Add the
roles/aiplatform.user
role.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --role="roles/aiplatform.user"
-
Add the
roles/storage.objectCreator
role.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --role="roles/storage.objectCreator"
-
Add the
roles/storage.objectViewer
role.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")[email protected] \ --role="roles/storage.objectViewer"
-
Create a Cloud Storage bucket.
- Set the
BUCKET_URI
variable. If you change the value, make sure to also update it in the configuration.
export BUCKET_URI="gs://rlhf-artifacts"
- Create the Cloud Storage bucket used to store the tuning artifacts.
gsutil mb -l $REGION -p $PROJECT_ID $BUCKET_URI
- Set the
-
Create Vertex AI Pipeline Registry repository.
- Set the
PIPELINE_REGISTRY
variable. If you change the value, make sure to also update it in the configuration.
export PIPELINE_REGISTRY="rlhf-pipelines"
- Create the Artifact Registry backing the Vertex AI Pipeline Registry.
gcloud artifacts repositories create $PIPELINE_REGISTRY \ --location=$REGION \ --repository-format=KFP
- Set the
The table below shows the supported models, hardware and regions.
large_model_reference | supported accelerator_type | supported region |
---|---|---|
text-bison@001 |
TPU_V3 , NVIDIA_TESLA_A100 |
europe-west4, us-central1 |
chat-bison@001 |
TPU_V3 , NVIDIA_TESLA_A100 |
europe-west4, us-central1 |
t5-small |
TPU_V3 , NVIDIA_TESLA_A100 |
europe-west4, us-central1 |
t5-large |
TPU_V3 |
europe-west4 |
t5-xl |
TPU_V3 |
europe-west4 |
t5-xxl |
TPU_V3 |
europe-west4 |
Note that tuning jobs that run in:
us-central1
will use 8 Nvidia A100 80GB.europe-west4
will use 64 v3 TPUs.