|
| 1 | +# Copyright 2017 Google Inc. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +from collections import namedtuple |
| 16 | + |
| 17 | +_CloudTrainingConfig = namedtuple("CloudConfig", |
| 18 | + ['region', 'scale_tier', 'master_type', 'worker_type', |
| 19 | + 'parameter_server_type', 'worker_count', 'parameter_server_count']) |
| 20 | +_CloudTrainingConfig.__new__.__defaults__ = ('BASIC', None, None, None, None, None) |
| 21 | + |
| 22 | + |
| 23 | +class CloudTrainingConfig(_CloudTrainingConfig): |
| 24 | + """A config namedtuple containing cloud specific configurations for CloudML training. |
| 25 | + |
| 26 | + Fields: |
| 27 | + region: the region of the training job to be submitted. For example, "us-central1". |
| 28 | + Run "gcloud compute regions list" to get a list of regions. |
| 29 | + scale_tier: Specifies the machine types, the number of replicas for workers and |
| 30 | + parameter servers. For example, "STANDARD_1". See |
| 31 | + https://cloud.google.com/ml/reference/rest/v1beta1/projects.jobs#scaletier |
| 32 | + for list of accepted values. |
| 33 | + master_type: specifies the type of virtual machine to use for your training |
| 34 | + job's master worker. Must set this value when scale_tier is set to CUSTOM. |
| 35 | + See the link in "scale_tier". |
| 36 | + worker_type: specifies the type of virtual machine to use for your training |
| 37 | + job's worker nodes. Must set this value when scale_tier is set to CUSTOM. |
| 38 | + parameter_server_type: specifies the type of virtual machine to use for your training |
| 39 | + job's parameter server. Must set this value when scale_tier is set to CUSTOM. |
| 40 | + worker_count: the number of worker replicas to use for the training job. Each |
| 41 | + replica in the cluster will be of the type specified in "worker_type". |
| 42 | + Must set this value when scale_tier is set to CUSTOM. |
| 43 | + parameter_server_count: the number of parameter server replicas to use. Each |
| 44 | + replica in the cluster will be of the type specified in "parameter_server_type". |
| 45 | + Must set this value when scale_tier is set to CUSTOM. |
| 46 | + """ |
| 47 | + pass |
0 commit comments