-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
- Set the
PROJECT_IDenvironment variable.
export PROJECT_ID="<your-project-id>"
- Set the
REGIONenvironment 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 \ cloudapis.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.serviceAccountUserrole, which includes theactAspermission to deploy to the runtime.gcloud iam service-accounts add-iam-policy-binding $(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --role="roles/iam.serviceAccountUser" \ --project=$PROJECT_ID
-
Add the
roles/aiplatform.userrole.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --role="roles/aiplatform.user"
-
Add the
roles/artifactregistry.writerrole.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --role="roles/artifactregistry.writer"
-
Add the
roles/storage.objectCreatorrole.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --role="roles/storage.objectCreator"
-
Add the
roles/storage.objectViewerrole.gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --role="roles/storage.objectViewer"
-
Create a role for reading storage buckets and add it.
gcloud iam roles create storageBucketGet \ --project=$PROJECT_ID \ --title="Storage Bucket Getter" \ --permissions="storage.buckets.get" gcloud projects add-iam-policy-binding $PROJECT_ID \ --member=serviceAccount:$(gcloud projects describe $PROJECT_ID \ --format="value(projectNumber)")-compute@developer.gserviceaccount.com \ --role="projects/$PROJECT_ID/roles/storageBucketGet"
-
Create a Cloud Storage bucket.
- Set the
BUCKET_URIvariable. If you change the value, make sure to also update it in the configuration.
export BUCKET_URI="gs://$PROJECT_ID-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_REGISTRYvariable. If you change the value, make sure to also update it in the configuration.
export PIPELINE_REGISTRY="$PROJECT_ID-rlhf-pipelines"
- Create the Artifact Registry backing the Vertex AI Pipeline Registry.
gcloud artifacts repositories create $PIPELINE_REGISTRY \ --location=$REGION \ --repository-format=KFP \ --project=$PROJECT_ID
- 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-central1will use 8 Nvidia A100 80GB.europe-west4will use 64 v3 TPUs.