Managing models with Vertex AI

Managing BigQuery ML models in the Vertex AI Model Registry

Vertex AI is a Google Cloud service which enables you to build, deploy, and scale ML models. With Vertex AI, you can use pre-trained and custom tooling all within a unified platform. When you register your BigQuery ML models with the Vertex AI Model Registry you can manage them alongside your other ML models to easily version, evaluate, and deploy for prediction.

With this integration, you can choose which BigQuery ML models to register to the Vertex AI Model Registry. From BigQuery ML you can register:

  • BigQuery ML built-in models
  • BigQuery ML TensorFlow models

However, there are some limitations around which ones can be deployed. The Vertex AI Model Registry deployment limitations are similar to the BigQuery ML model export limitations. For example, ARIMA timeseries models are not supported by nature, as well as XGboost models and other models trained with a transform clause.

Once registered, you can deploy your BigQuery ML model to a Vertex AI endpoint for online prediction. To learn more about Vertex AI prediction, see Vertex AI Prediction documentation.

To learn how to manage your BigQuery ML models from Vertex AI Model Registry, see Introduction to Vertex AI Model Registry.

BigQuery ML and Vertex AI Model Registry Pre-requisites

To add BigQuery ML models to the Vertex AI Model Registry you must assign cloud-dataengine@prod.google.com and cloud-dataengine@system.gserviceaccount.com the Vertex AI admin role for the correct permissions. This allows the BigQuery ML service account to check the model deployment status. Important: This is temporary. In a future release, you will be able to use the end user credential to register BigQuery ML with Vertex AI Model Registry.

To add the permission, use this gCloud command:

gcloud projects add-iam-policy-binding PROJECT_NUMBER \
      --member='serviceAccount:cloud-dataengine@system.gserviceaccount.com' \
      --role='roles/aiplatform.admin'

gcloud projects add-iam-policy-binding PROJECT_NUMBER \
      --member='user:cloud-dataengine@prod.google.com' \
      --role='roles/aiplatform.admin'

You'll also need to enable Vertex AI API in your project. Use this gCloud command:


gcloud --project PROJECT_ID services enable  aiplatform.googleapis.com

Add a BigQuery ML model to the Vertex AI Model Registry

To register a BigQuery ML model to Vertex AI Model Registry, you must use model_registry="vertex_ai". Once registered, you can deploy from Vertex AI Model Registry directly without manual exporting or importing. For example, you can run the following command to integrate a BigQuery ML model with Vertex AI Model Registry:

   CREATE OR REPLACE MODEL [PROJECT_ID].[DATASET_ID].[BQML_MODEL_ID]
   OPTIONS(model_registry="vertex_ai",
   [vertex_ai_model_id=<vertex_ai_model_id>,
   vertex_ai_model_version_aliases=[<version_aliases>])

Deleting BigQuery ML models from Vertex AI Model Registry

To delete a BigQuery ML model from the Vertex AI Model Registry you only need to delete it from BigQuery ML. Once you delete it from BigQuery ML, it is synced and removed from Vertex AI Model Registry.

   DROP MODEL [PROJECT_ID].[DATASET_ID].[BQML_MODEL_ID]

Considerations

What happens when I register a multi-region BigQuery ML model to Vertex AI Model Registry?

At this time, if you decide to add a multi-region BigQuery ML model to Vertex AI Model Registry it turns the model into a regional model. A BigQuery ML multi-region US model is synced to Vertex AI (us-central1) and a BigQuery ML multi-region EU model is synced to Vertex AI (europe-west4). Vertex AI Model Registry will support multi-region models in the future. For information about supported locations, see the Locations page.

Can I use XAI capabilities in Vertex AI Model Registry with BigQuery ML models?

No, at this time Vertex AI Model Registry does not support XAI with BigQuery ML models.