리소스 가용성 기반의 학습 작업 예약

GPU 리소스가 필요한 서버리스 학습 작업의 경우 동적 워크로드 스케줄러를 사용하면 요청된 GPU 리소스를 사용할 수 있게 되었을 때를 기준으로 작업을 예약할 수 있습니다. 이 페이지에서는 동적 워크로드 스케줄러를 사용해서 서버리스 학습 작업을 예약하는 방법과 Gemini Enterprise Agent Platform에서 예약 동작을 맞춤설정하는 방법을 설명합니다.

권장 사용 사례

다음 상황에서는 동적 워크로드 스케줄러를 사용해서 서버리스 학습 작업을 예약하는 것이 좋습니다.

  • 서버리스 학습 작업은 L4, A100, H100, H200 또는 B200 GPU를 요청하며, 요청된 리소스가 사용 가능해지는 즉시 작업을 실행하고자 합니다. 예를 들어 Gemini Enterprise Agent Platform이 에너지 수요가 높은 시간대가 아닌 시간대에 GPU 리소스를 할당하는 경우입니다.
  • 워크로드에 여러 노드가 필요하고 모든 GPU 노드가 동시에 프로비저닝되고 준비될 때까지 실행을 시작할 수 없습니다. 예를 들어 분산 학습 작업을 만드는 경우입니다.

요구사항

동적 워크로드 스케줄러를 사용하려면 서버리스 학습 작업이 다음 요구사항을 충족해야 합니다.

  • 서버리스 학습 작업에서 L4, A100, H100, H200 또는 B200 GPU를 요청합니다.
  • 서버리스 학습 작업의 최대 timeout이 7일 이하입니다.
  • 서버리스 학습 작업에서 모든 작업자 풀에 대해 동일한 머신 구성이 사용됩니다.

지원되는 작업 유형

CustomJob, HyperparameterTuningjob, TrainingPipeline을 비롯한 모든 서버리스 학습 작업 유형이 지원됩니다.

서버리스 학습 작업에서 동적 워크로드 스케줄러 사용 설정

서버리스 학습 작업에서 동적 워크로드 스케줄러를 사용 설정하려면 작업을 만들 때 scheduling.strategy API 필드를 FLEX_START로 설정합니다.

서버리스 학습 작업을 만드는 방법은 다음 링크를 참조하세요.

리소스 가용성을 기다리는 기간 구성

scheduling.maxWaitDuration 필드에서 해당 작업이 리소스를 기다릴 수 있는 기간을 구성할 수 있습니다. 값이 0이면 요청된 리소스를 사용할 수 있을 때까지 작업이 무제한으로 기다립니다. 기본값은 1일입니다.

예시

다음 예시는 customJob에 대해 동적 워크로드 스케줄러를 사용 설정하는 방법을 보여줍니다. 사용할 인터페이스의 탭을 선택하세요.

gcloud

Google Cloud CLI를 사용하여 작업을 제출할 때는 config.yaml 파일에 scheduling.strategy 필드를 추가합니다.

YAML 구성 파일 예시:

workerPoolSpecs:
  machineSpec:
    machineType: a2-highgpu-1g
    acceleratorType: NVIDIA_TESLA_A100
    acceleratorCount: 1
  replicaCount: 1
  containerSpec:
    imageUri: gcr.io/ucaip-test/ucaip-training-test
    args:
    - port=8500
    command:
    - start
scheduling:
  strategy: FLEX_START
  maxWaitDuration: 7200s

Python

Agent Platform SDK for Python을 사용하여 작업을 제출할 때는 관련 CustomJob 만들기 메서드에서 scheduling_strategy 필드를 설정합니다.

from google.cloud.aiplatform_v1.types import custom_job as gca_custom_job_compat

def create_custom_job_with_dws_sample(
    project: str,
    location: str,
    staging_bucket: str,
    display_name: str,
    script_path: str,
    container_uri: str,
    service_account: str,
    experiment: str,
    experiment_run: Optional[str] = None,
) -> None:
    aiplatform.init(project=project, location=location, staging_bucket=staging_bucket, experiment=experiment)

    job = aiplatform.CustomJob.from_local_script(
        display_name=display_name,
        script_path=script_path,
        container_uri=container_uri,
        enable_autolog=True,
        machine_type="a2-highgpu-1g",
        accelerator_type="NVIDIA_TESLA_A100",
        accelerator_count=1,
    )

    job.run(
        service_account=service_account,
        experiment=experiment,
        experiment_run=experiment_run,
        max_wait_duration=1800,
        scheduling_strategy=gca_custom_job_compat.Scheduling.Strategy.FLEX_START
    )

REST

Gemini Enterprise Agent Platform REST API를 사용하여 작업을 제출할 때는 서버리스 학습 작업을 만들 때 scheduling.strategy 및 scheduling.maxWaitDuration 필드를 설정합니다.

요청 JSON 본문 예시:

{
  "displayName": "MyDwsJob",
  "jobSpec": {
    "workerPoolSpecs": [
      {
        "machineSpec": {
          "machineType": "a2-highgpu-1g",
          "acceleratorType": "NVIDIA_TESLA_A100",
          "acceleratorCount": 1
        },
        "replicaCount": 1,
        "diskSpec": {
          "bootDiskType": "pd-ssd",
          "bootDiskSizeGb": 100
        },
        "containerSpec": {
          "imageUri": "python:3.10",
          "command": [
            "sleep"
          ],
          "args": [
            "100"
          ]
        }
      }
    ],
    "scheduling": {
      "maxWaitDuration": "1800s",
      "strategy": "FLEX_START"
    }
  }
}

Quota

동적 워크로드 스케줄러를 사용하여 작업을 제출할 때 Gemini Enterprise Agent Platform은 주문형 Gemini Enterprise Agent Platform 할당량을 소비하는 대신 선점형 할당량을 소비합니다. 예를 들어 Nvidia H100 GPU의 경우 다음을 소비하는 대신:

aiplatform.googleapis.com/custom_model_training_nvidia_h100_gpus,

Gemini Enterprise Agent Platform은 다음을 소비합니다.

aiplatform.googleapis.com/custom_model_training_preemptible_nvidia_h100_gpus.

하지만 선점형 할당량은 이름에만 사용됩니다. 여기서 리소스는 선점형이 아니며 표준 리소스와 같이 작동합니다.

동적 워크로드 스케줄러를 사용하여 작업을 제출하기 전에 선점형 할당량이 충분한 양으로 증가되었는지 확인합니다. Gemini Enterprise Agent Platform 할당량 및 할당량 증가 요청 방법에 대한 자세한 내용은 Gemini Enterprise Agent Platform 할당량 및 한도를 참조하세요.

결제

DWS flex start를 사용하는 경우 동적 워크로드 스케줄러 가격 책정에 따라 요금이 청구됩니다. 인프라 사용량 외에도 서버리스 학습 관리 비용이 있습니다.

다음 단계