BatchCompute 클래스
Azure Machine Learning에서 일괄 처리 컴퓨팅 대상을 관리합니다.
Azure Batch는 클라우드에서 대규모 병렬 및 HPC(고성능 컴퓨팅) 애플리케이션을 효율적으로 실행하는 데 사용됩니다. BatchCompute는 Azure Machine Learning Pipelines에서 AzureBatchStep을 사용하여 Azure Batch 컴퓨터 풀에 작업을 제출하는 데 사용됩니다. 자세한 내용은 Azure Machine Learning의 컴퓨팅 대상이란?을 참조하세요.
클래스 ComputeTarget 생성자입니다.
제공된 작업 영역과 연결된 Compute 개체의 클라우드 표현을 검색합니다. 검색된 Compute 개체의 특정 형식에 해당하는 자식 클래스의 instance 반환합니다.
- 상속
-
BatchCompute
생성자
BatchCompute(workspace, name)
매개 변수
Name | Description |
---|---|
workspace
필수
|
검색할 BatchCompute 개체를 포함하는 작업 영역 개체입니다. |
name
필수
|
검색할 BatchCompute 개체의 이름입니다. |
workspace
필수
|
검색할 Compute 개체를 포함하는 작업 영역 개체입니다. |
name
필수
|
검색할 Compute 개체의 이름입니다. |
설명
사용하기 전에 Azure 배치 계정을 만듭니다. 계정을 만들려면 Azure Portal에서 배치 계정 만들기를 참조하세요.
다음 예제는 attach_configuration을 사용하여 Azure Batch 컴퓨팅 계정을 작업 영역에 연결하는 방법을 보여 줍니다.
batch_compute_name = 'mybatchcompute' # Name to associate with new compute in workspace
# Batch account details needed to attach as compute to workspace
batch_account_name = "<batch_account_name>" # Name of the Batch account
batch_resource_group = "<batch_resource_group>" # Name of the resource group which contains this account
try:
# check if already attached
batch_compute = BatchCompute(ws, batch_compute_name)
except ComputeTargetException:
print('Attaching Batch compute...')
provisioning_config = BatchCompute.attach_configuration(resource_group=batch_resource_group,
account_name=batch_account_name)
batch_compute = ComputeTarget.attach(ws, batch_compute_name, provisioning_config)
batch_compute.wait_for_completion()
print("Provisioning state:{}".format(batch_compute.provisioning_state))
print("Provisioning errors:{}".format(batch_compute.provisioning_errors))
print("Using Batch compute:{}".format(batch_compute.cluster_resource_id))
메서드
attach_configuration |
Batch 컴퓨팅 대상을 연결하기 위한 구성 개체를 만듭니다. |
delete |
BatchCompute 개체에는 삭제가 지원되지 않습니다. 대신 detach를 사용하세요. |
deserialize |
JSON 개체를 BatchCompute 개체로 변환합니다. |
detach |
연결된 작업 영역에서 Batch 개체를 분리합니다. 기본 클라우드 개체는 삭제되지 않고 연결만 제거됩니다. |
refresh_state |
개체 속성의 내부 업데이트를 수행합니다. 이 메서드는 해당 클라우드 개체의 현재 상태에 따라 속성을 업데이트합니다. 이는 주로 컴퓨팅 상태의 수동 폴링에 사용됩니다. |
serialize |
이 BatchCompute 개체를 JSON 직렬화된 사전으로 변환합니다. |
attach_configuration
Batch 컴퓨팅 대상을 연결하기 위한 구성 개체를 만듭니다.
static attach_configuration(resource_group=None, account_name=None, resource_id=None)
매개 변수
Name | Description |
---|---|
resource_group
|
배치 계정이 있는 리소스 그룹의 이름입니다. Default value: None
|
account_name
|
배치 계정 이름입니다. Default value: None
|
resource_id
|
연결 중인 컴퓨팅 리소스의 Azure 리소스 ID입니다. Default value: None
|
반환
형식 | Description |
---|---|
Compute 개체를 연결할 때 사용할 구성 개체입니다. |
delete
deserialize
JSON 개체를 BatchCompute 개체로 변환합니다.
static deserialize(workspace, object_dict)
매개 변수
Name | Description |
---|---|
workspace
필수
|
BatchCompute 개체가 연결된 작업 영역 개체입니다. |
object_dict
필수
|
BatchCompute 개체로 변환할 JSON 개체입니다. |
반환
형식 | Description |
---|---|
제공된 JSON 개체의 BatchCompute 표현입니다. |
예외
형식 | Description |
---|---|
설명
제공된 작업 영역이 Compute가 연결된 작업 영역이 아닌 경우 ComputeTargetException을 발생시킵니다.
detach
연결된 작업 영역에서 Batch 개체를 분리합니다.
기본 클라우드 개체는 삭제되지 않고 연결만 제거됩니다.
detach()
예외
형식 | Description |
---|---|
refresh_state
개체 속성의 내부 업데이트를 수행합니다.
이 메서드는 해당 클라우드 개체의 현재 상태에 따라 속성을 업데이트합니다. 이는 주로 컴퓨팅 상태의 수동 폴링에 사용됩니다.
refresh_state()
serialize
이 BatchCompute 개체를 JSON 직렬화된 사전으로 변환합니다.
serialize()
반환
형식 | Description |
---|---|
이 BatchCompute 개체의 JSON 표현입니다. |