BatchCompute 클래스
Azure Machine Learning에서 Batch 컴퓨팅 대상을 관리합니다.
Azure Batch는 클라우드에서 대규모 병렬 및 HPC(고성능 컴퓨팅) 애플리케이션을 효율적으로 실행하는 데 사용됩니다. BatchCompute는 Azure Machine Learning 파이프라인에서 를 사용하여 Azure Batch 컴퓨터 풀에 AzureBatchStep작업을 제출하는 데 사용됩니다. 자세한 내용은 Azure Machine Learning의 컴퓨팅 대상을 참조하세요.
클래스 ComputeTarget 생성자입니다.
제공된 작업 영역과 연결된 Compute 개체의 클라우드 표현을 검색합니다. 검색된 Compute 개체의 특정 형식에 해당하는 자식 클래스의 인스턴스를 반환합니다.
생성자
BatchCompute(workspace, name)
매개 변수
| Name | Description |
|---|---|
|
workspace
필수
|
검색할 BatchCompute 개체를 포함하는 작업 영역 개체입니다. |
|
name
필수
|
검색할 BatchCompute 개체의 이름입니다. |
|
workspace
필수
|
검색할 Compute 개체를 포함하는 작업 영역 개체입니다. |
|
name
필수
|
검색할 Compute 개체의 이름입니다. |
설명
사용하기 전에 Azure Batch 계정을 만듭니다. 만들려면 Azure Portal을 사용하여 Batch 계정 만들기를 참조하세요.
다음 예제에서는 다음을 사용하여 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))
전체 샘플은 다음에서 사용할 수 있습니다. https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb
메서드
| 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
|
Batch 계정이 있는 리소스 그룹의 이름입니다. Default value: None
|
|
account_name
|
Batch 계정 이름입니다. 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 |
|---|---|
설명
ComputeTargetException 제공된 작업 영역이 Compute와 연결된 작업 영역이 아닌 경우 발생합니다.
detach
Batch 개체를 연결된 작업 영역에서 분리합니다.
기본 클라우드 개체는 삭제되지 않고 연결만 제거됩니다.
detach()
예외
| 형식 | Description |
|---|---|
refresh_state
개체의 속성에 대한 현재 위치 업데이트를 수행합니다.
이 메서드는 해당 클라우드 개체의 현재 상태에 따라 속성을 업데이트합니다. 이는 주로 컴퓨팅 상태의 수동 폴링에 사용됩니다.
refresh_state()
serialize
이 BatchCompute 개체를 JSON 직렬화된 사전으로 변환합니다.
serialize()
반환
| 형식 | Description |
|---|---|
|
이 BatchCompute 개체의 JSON 표현입니다. |