Skip to content

Commit 64768c3

Browse files
fix: Update milli node_hours for image training (#663)
Co-authored-by: sasha-gitg <44654632+sasha-gitg@users.noreply.github.com>
1 parent f0570cb commit 64768c3

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

google/cloud/aiplatform/training_jobs.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4514,7 +4514,7 @@ def run(
45144514
training_filter_split: Optional[str] = None,
45154515
validation_filter_split: Optional[str] = None,
45164516
test_filter_split: Optional[str] = None,
4517-
budget_milli_node_hours: int = 1000,
4517+
budget_milli_node_hours: Optional[int] = None,
45184518
model_display_name: Optional[str] = None,
45194519
model_labels: Optional[Dict[str, str]] = None,
45204520
disable_early_stopping: bool = False,
@@ -4580,18 +4580,26 @@ def run(
45804580
single DataItem is matched by more than one of the FilterSplit filters,
45814581
then it is assigned to the first set that applies to it in the training,
45824582
validation, test order. This is ignored if Dataset is not provided.
4583-
budget_milli_node_hours: int = 1000
4583+
budget_milli_node_hours (int):
45844584
Optional. The train budget of creating this Model, expressed in milli node
45854585
hours i.e. 1,000 value in this field means 1 node hour.
4586+
4587+
Defaults by `prediction_type`:
4588+
4589+
`classification` - For Cloud models the budget must be: 8,000 - 800,000
4590+
milli node hours (inclusive). The default value is 192,000 which
4591+
represents one day in wall time, assuming 8 nodes are used.
4592+
`object_detection` - For Cloud models the budget must be: 20,000 - 900,000
4593+
milli node hours (inclusive). The default value is 216,000 which represents
4594+
one day in wall time, assuming 9 nodes are used.
4595+
45864596
The training cost of the model will not exceed this budget. The final
45874597
cost will be attempted to be close to the budget, though may end up
45884598
being (even) noticeably smaller - at the backend's discretion. This
45894599
especially may happen when further model training ceases to provide
4590-
any improvements.
4591-
If the budget is set to a value known to be insufficient to train a
4592-
Model for the given training set, the training won't be attempted and
4600+
any improvements. If the budget is set to a value known to be insufficient to
4601+
train a Model for the given training set, the training won't be attempted and
45934602
will error.
4594-
The minimum value is 1000 and the maximum is 72000.
45954603
model_display_name (str):
45964604
Optional. The display name of the managed Vertex AI Model. The name
45974605
can be up to 128 characters long and can be consist of any UTF-8

tests/unit/aiplatform/test_automl_image_training_jobs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
_TEST_DISPLAY_NAME = "test-display-name"
3535
_TEST_METADATA_SCHEMA_URI_IMAGE = schema.dataset.metadata.image
3636

37-
_TEST_TRAINING_BUDGET_MILLI_NODE_HOURS = 1000
37+
_TEST_TRAINING_BUDGET_MILLI_NODE_HOURS = 7500
3838
_TEST_TRAINING_DISABLE_EARLY_STOPPING = True
3939
_TEST_MODEL_TYPE_ICN = "CLOUD" # Image Classification default
4040
_TEST_MODEL_TYPE_IOD = "CLOUD_HIGH_ACCURACY_1" # Image Object Detection default
@@ -493,6 +493,7 @@ def test_splits_fraction(
493493
training_fraction_split=_TEST_FRACTION_SPLIT_TRAINING,
494494
validation_fraction_split=_TEST_FRACTION_SPLIT_VALIDATION,
495495
test_fraction_split=_TEST_FRACTION_SPLIT_TEST,
496+
budget_milli_node_hours=_TEST_TRAINING_BUDGET_MILLI_NODE_HOURS,
496497
disable_early_stopping=_TEST_TRAINING_DISABLE_EARLY_STOPPING,
497498
sync=sync,
498499
)
@@ -560,6 +561,7 @@ def test_splits_filter(
560561
training_filter_split=_TEST_FILTER_SPLIT_TRAINING,
561562
validation_filter_split=_TEST_FILTER_SPLIT_VALIDATION,
562563
test_filter_split=_TEST_FILTER_SPLIT_TEST,
564+
budget_milli_node_hours=_TEST_TRAINING_BUDGET_MILLI_NODE_HOURS,
563565
disable_early_stopping=_TEST_TRAINING_DISABLE_EARLY_STOPPING,
564566
sync=sync,
565567
)
@@ -624,6 +626,7 @@ def test_splits_default(
624626
model_from_job = job.run(
625627
dataset=mock_dataset_image,
626628
model_display_name=_TEST_MODEL_DISPLAY_NAME,
629+
budget_milli_node_hours=_TEST_TRAINING_BUDGET_MILLI_NODE_HOURS,
627630
disable_early_stopping=_TEST_TRAINING_DISABLE_EARLY_STOPPING,
628631
sync=sync,
629632
)

0 commit comments

Comments
 (0)