Skip to content

Commit 7146911

Browse files
icywang86ruilaurenyu
authored andcommitted
fix: use unique training job names in TensorFlow script mode integ tests (#742)
1 parent 3145d07 commit 7146911

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tests/integ/test_tf_script_mode.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ def test_mnist(sagemaker_session, instance_type):
4949
sagemaker_session=sagemaker_session,
5050
py_version='py3',
5151
framework_version=TensorFlow.LATEST_VERSION,
52-
metric_definitions=[{'Name': 'train:global_steps', 'Regex': r'global_step\/sec:\s(.*)'}],
53-
base_job_name=unique_name_from_base('test-tf-sm-mnist'))
52+
metric_definitions=[{'Name': 'train:global_steps', 'Regex': r'global_step\/sec:\s(.*)'}])
5453
inputs = estimator.sagemaker_session.upload_data(
5554
path=os.path.join(RESOURCE_PATH, 'data'),
5655
key_prefix='scriptmode/mnist')
5756

5857
with timeout.timeout(minutes=integ.TRAINING_DEFAULT_TIMEOUT_MINUTES):
59-
estimator.fit(inputs)
58+
estimator.fit(inputs=inputs, job_name=unique_name_from_base('test-tf-sm-mnist'))
6059
_assert_s3_files_exist(estimator.model_dir,
6160
['graph.pbtxt', 'model.ckpt-0.index', 'model.ckpt-0.meta'])
6261
df = estimator.training_job_analytics.dataframe()
@@ -77,8 +76,7 @@ def test_server_side_encryption(sagemaker_session):
7776
train_instance_type='ml.c5.xlarge',
7877
sagemaker_session=sagemaker_session,
7978
py_version='py3',
80-
framework_version='1.11',
81-
base_job_name=unique_name_from_base('test-server-side-encryption'),
79+
framework_version=TensorFlow.LATEST_VERSION,
8280
code_location=output_path,
8381
output_path=output_path,
8482
model_dir='/opt/ml/model',
@@ -89,7 +87,7 @@ def test_server_side_encryption(sagemaker_session):
8987
key_prefix='scriptmode/mnist')
9088

9189
with timeout.timeout(minutes=integ.TRAINING_DEFAULT_TIMEOUT_MINUTES):
92-
estimator.fit(inputs)
90+
estimator.fit(inputs=inputs, job_name=unique_name_from_base('test-server-side-encryption'))
9391

9492

9593
@pytest.mark.canary_quick
@@ -104,14 +102,13 @@ def test_mnist_distributed(sagemaker_session, instance_type):
104102
py_version=integ.PYTHON_VERSION,
105103
script_mode=True,
106104
framework_version=TensorFlow.LATEST_VERSION,
107-
distributions=PARAMETER_SERVER_DISTRIBUTION,
108-
base_job_name=unique_name_from_base('test-tf-sm-mnist'))
105+
distributions=PARAMETER_SERVER_DISTRIBUTION)
109106
inputs = estimator.sagemaker_session.upload_data(
110107
path=os.path.join(RESOURCE_PATH, 'data'),
111108
key_prefix='scriptmode/distributed_mnist')
112109

113110
with timeout.timeout(minutes=integ.TRAINING_DEFAULT_TIMEOUT_MINUTES):
114-
estimator.fit(inputs)
111+
estimator.fit(inputs=inputs, job_name=unique_name_from_base('test-tf-sm-distributed'))
115112
_assert_s3_files_exist(estimator.model_dir,
116113
['graph.pbtxt', 'model.ckpt-0.index', 'model.ckpt-0.meta'])
117114

@@ -124,12 +121,11 @@ def test_mnist_async(sagemaker_session):
124121
sagemaker_session=sagemaker_session,
125122
py_version='py3',
126123
framework_version=TensorFlow.LATEST_VERSION,
127-
base_job_name=unique_name_from_base('test-tf-sm-mnist'),
128124
tags=TAGS)
129125
inputs = estimator.sagemaker_session.upload_data(
130126
path=os.path.join(RESOURCE_PATH, 'data'),
131127
key_prefix='scriptmode/mnist')
132-
estimator.fit(inputs, wait=False)
128+
estimator.fit(inputs=inputs, wait=False, job_name=unique_name_from_base('test-tf-sm-async'))
133129
training_job_name = estimator.latest_training_job.name
134130
time.sleep(20)
135131
endpoint_name = training_job_name

0 commit comments

Comments
 (0)