ExecutionTemplate

笔记本执行工作负载的说明。

JSON 表示法
{
  "scaleTier": enum (ScaleTier),
  "masterType": string,
  "acceleratorConfig": {
    object (SchedulerAcceleratorConfig)
  },
  "labels": {
    string: string,
    ...
  },
  "inputNotebookFile": string,
  "containerImageUri": string,
  "outputNotebookFolder": string,
  "paramsYamlFile": string,
  "parameters": string,
  "serviceAccount": string,
  "jobType": enum (JobType),
  "kernelSpec": string,
  "tensorboard": string,

  // Union field job_parameters can be only one of the following:
  "dataprocParameters": {
    object (DataprocParameters)
  },
  "vertexAiParameters": {
    object (VertexAIParameters)
  }
  // End of list of possible types for union field job_parameters.
}
字段
scaleTier
(deprecated)

enum (ScaleTier)

必需。用于笔记本执行的硬件的规模层级。已弃用,将被停用。目前仅支持 CUSTOM。

masterType

string

指定用于训练作业的主工作器的虚拟机类型。如果 scaleTier 设置为 CUSTOM,您必须指定此字段。

您可以直接在此字段中使用特定的 Compute Engine 机器类型。系统支持以下类型:

  • n1-standard-4
  • n1-standard-8
  • n1-standard-16
  • n1-standard-32
  • n1-standard-64
  • n1-standard-96
  • n1-highmem-2
  • n1-highmem-4
  • n1-highmem-8
  • n1-highmem-16
  • n1-highmem-32
  • n1-highmem-64
  • n1-highmem-96
  • n1-highcpu-16
  • n1-highcpu-32
  • n1-highcpu-64
  • n1-highcpu-96

或者,您也可以使用以下旧版机器类型:

  • standard
  • large_model
  • complex_model_s
  • complex_model_m
  • complex_model_l
  • standard_gpu
  • complex_model_m_gpu
  • complex_model_l_gpu
  • standard_p100
  • complex_model_m_p100
  • standard_v100
  • large_model_v100
  • complex_model_m_v100
  • complex_model_l_v100

最后,如果您想要使用 TPU 进行训练,请在此字段中指定 cloud_tpu。详细了解使用 TPU 进行训练的特殊配置选项

acceleratorConfig

object (SchedulerAcceleratorConfig)

用于运行笔记本执行的硬件的配置(数量和加速器类型)。

labels

map (key: string, value: string)

执行的标签。如果执行是预定的,则包含的字段将为“nbs-scheduled”。否则,它是立即执行,包含的字段将为“nbs-immediate”。使用字段可以高效地在各种类型的执行之间建立索引。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

inputNotebookFile

string

要执行的笔记本文件的路径。必须位于 Google Cloud Storage 存储桶中。格式:gs://{bucket_name}/{folder}/{notebook_file_name} 示例:gs://notebook_user/scheduled_notebooks/sentiment_notebook.ipynb

containerImageUri

string

指向 DLVM 的容器映像 URI 示例:“gcr.io/deeplearning-platform-release/base-cu100”如需查看更多示例,请访问:https://cloud.google.com/ai-platform/deep-learning-containers/docs/choosing-container

outputNotebookFolder

string

要写入的笔记本文件夹的路径。必须位于 Google Cloud Storage 存储桶路径中。格式:gs://{bucket_name}/{folder} 示例:gs://notebook_user/scheduled_notebooks

paramsYamlFile

string

在执行期间要在笔记本中替换的参数。如需了解如何在输入笔记本中指定参数并在 YAML 文件中在此处传递这些参数,请参阅 https://papermill.readthedocs.io/en/latest/usage-parameterize.html。示例:gs://notebook_user/scheduled_notebooks/sentiment_notebook_params.yaml

parameters

string

在“inputNotebookFile”笔记本中使用的参数。

serviceAccount

string

运行执行时要使用的服务帐号的电子邮件地址。您必须拥有指定服务帐号的 iam.serviceAccounts.actAs 权限。

jobType

enum (JobType)

在此执行中要使用的作业类型。

kernelSpec

string

要使用的内核规范的名称。如果执行目标上的内核规范名称与输入笔记本文件中的名称不匹配,则必须指定此项。

tensorboard

string

此执行将向其上传 Tensorboard 日志的 Agent Platform [Tensorboard] 资源的名称。格式:projects/{project}/locations/{location}/tensorboards/{tensorboard}

联合字段 job_parameters。执行类型的参数。注意:目前,VertexAI 作业没有额外的参数。job_parameters 只能是下列其中一项:
dataprocParameters

object (DataprocParameters)

在 Dataproc JobType 执行中使用的参数。

vertexAiParameters

object (VertexAIParameters)

在 Agent Platform JobType 执行中使用的参数。

ScaleTier

必需。指定机器类型、工作器和参数服务器的副本数。

枚举
SCALE_TIER_UNSPECIFIED 未指定的规模层级。
BASIC 单一工作器实例。该层级适合用于学习如何使用 Cloud ML 以及如何使用小数据集来试验新模型。
STANDARD_1 许多工作器和一些参数服务器。
PREMIUM_1 大量工作器和许多参数服务器。
BASIC_GPU 带有 K80 GPU 的单个工作器实例。
BASIC_TPU 带有 Cloud TPU 的单个工作器实例。
CUSTOM

CUSTOM 层级不是预设层级,但允许您使用自定义集群规范。使用该层级时,请根据以下准则设置值,以配置处理集群:

  • 您必须设置 ExecutionTemplate.masterType 以指定主节点使用的机器类型。这是唯一的必需设置。

SchedulerAcceleratorConfig

硬件加速器的定义。请注意,并非所有 typecoreCount 组合都有效。如需查找有效组合,请参阅 Compute Engine 上的 GPU。不支持 TPU。

JSON 表示法
{
  "type": enum (SchedulerAcceleratorType),
  "coreCount": string
}
字段
type

enum (SchedulerAcceleratorType)

此加速器的类型。

coreCount

string (int64 format)

此加速器的核心数。

SchedulerAcceleratorType

AI Platform Training 作业的硬件加速器类型。

枚举
SCHEDULER_ACCELERATOR_TYPE_UNSPECIFIED 未指定的加速器类型。默认为不带 GPU。
NVIDIA_TESLA_K80 Nvidia Tesla K80 GPU。
NVIDIA_TESLA_P100 Nvidia Tesla P100 GPU。
NVIDIA_TESLA_V100 Nvidia Tesla V100 GPU。
NVIDIA_TESLA_P4 Nvidia Tesla P4 GPU。
NVIDIA_TESLA_T4 Nvidia Tesla T4 GPU。
NVIDIA_TESLA_A100 Nvidia Tesla A100 GPU。
TPU_V2 TPU v2。
TPU_V3 TPU v3。

JobType

用于此执行的后端。

枚举
JOB_TYPE_UNSPECIFIED 未指定类型。
VERTEX_AI aiplatform.googleapis.com 中的自定义作业。执行的默认值。
DATAPROC 在以 Dataproc 作为作业的集群上运行执行。https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs

DataprocParameters

在 Dataproc JobType 执行中使用的参数。

JSON 表示法
{
  "cluster": string
}
字段
cluster

string

用于运行 Dataproc 执行的集群的 URI。格式:projects/{PROJECT_ID}/regions/{REGION}/clusters/{CLUSTER_NAME}

VertexAIParameters

在 Agent Platform JobType 执行中使用的参数。

JSON 表示法
{
  "network": string,
  "env": {
    string: string,
    ...
  }
}
字段
network

string

作业应对等互连的 Compute Engine 网络的全名。例如,projects/12345/global/networks/myVPC格式projects/{project}/global/networks/{network}。其中,{project} 是项目编号,例如 12345{network} 是网络名称。

该网络必须已配置专用服务访问通道。如果未指定,则作业不与任何网络对等互连。

env

map (key: string, value: string)

环境变量。最多可以指定 100 个环境变量,且这些变量必须是唯一的。示例:GCP_BUCKET=gs://my-bucket/samples/

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }