@@ -453,14 +453,14 @@ def decorated_function(a, b, c=1, *, d, e, f=3):
453453
454454def test_executor_invalid_arguments ():
455455 with pytest .raises (ValueError ):
456- with RemoteExecutor (max_parallel_job = 0 , s3_root_uri = "s3://bucket/" ) as e :
456+ with RemoteExecutor (max_parallel_jobs = 0 , s3_root_uri = "s3://bucket/" ) as e :
457457 e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
458458
459459
460460@patch ("sagemaker.remote_function.client._JobSettings" )
461461def test_executor_submit_after_shutdown (* args ):
462462 with pytest .raises (RuntimeError ):
463- with RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" ) as e :
463+ with RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" ) as e :
464464 pass
465465 e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
466466
@@ -476,7 +476,7 @@ def test_executor_submit_happy_case(mock_start, mock_job_settings, parallelism):
476476 mock_job_4 = create_mock_job ("job_4" , COMPLETED_TRAINING_JOB )
477477 mock_start .side_effect = [mock_job_1 , mock_job_2 , mock_job_3 , mock_job_4 ]
478478
479- with RemoteExecutor (max_parallel_job = parallelism , s3_root_uri = "s3://bucket/" ) as e :
479+ with RemoteExecutor (max_parallel_jobs = parallelism , s3_root_uri = "s3://bucket/" ) as e :
480480 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
481481 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
482482 future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
@@ -514,7 +514,7 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
514514 run_info = _RunInfo (run_obj .experiment_name , run_obj .run_name )
515515
516516 with run_obj :
517- with RemoteExecutor (max_parallel_job = 2 , s3_root_uri = "s3://bucket/" ) as e :
517+ with RemoteExecutor (max_parallel_jobs = 2 , s3_root_uri = "s3://bucket/" ) as e :
518518 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
519519 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
520520
@@ -530,7 +530,7 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
530530 assert future_1 .done ()
531531 assert future_2 .done ()
532532
533- with RemoteExecutor (max_parallel_job = 2 , s3_root_uri = "s3://bucket/" ) as e :
533+ with RemoteExecutor (max_parallel_jobs = 2 , s3_root_uri = "s3://bucket/" ) as e :
534534 with run_obj :
535535 future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
536536 future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
@@ -556,7 +556,7 @@ def test_executor_submit_enforcing_max_parallel_jobs(mock_start, *args):
556556 mock_job_2 = create_mock_job ("job_2" , INPROGRESS_TRAINING_JOB )
557557 mock_start .side_effect = [mock_job_1 , mock_job_2 ]
558558
559- e = RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" )
559+ e = RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" )
560560 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
561561 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
562562
@@ -588,7 +588,7 @@ def test_executor_fails_to_start_job(mock_start, *args):
588588
589589 mock_start .side_effect = [TypeError (), mock_job ]
590590
591- with RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" ) as e :
591+ with RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" ) as e :
592592 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
593593 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
594594
@@ -606,7 +606,7 @@ def test_executor_submit_and_cancel(mock_start, *args):
606606 mock_job_2 = create_mock_job ("job_2" , INPROGRESS_TRAINING_JOB )
607607 mock_start .side_effect = [mock_job_1 , mock_job_2 ]
608608
609- e = RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" )
609+ e = RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" )
610610
611611 # submit first job and stay in progress
612612 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
@@ -645,7 +645,7 @@ def test_executor_describe_job_throttled_temporarily(mock_start, *args):
645645 ]
646646 mock_start .return_value = mock_job
647647
648- with RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" ) as e :
648+ with RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" ) as e :
649649 # submit first job
650650 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
651651 # submit second job
@@ -663,7 +663,7 @@ def test_executor_describe_job_failed_permanently(mock_start, *args):
663663 mock_job .describe .side_effect = RuntimeError ()
664664 mock_start .return_value = mock_job
665665
666- with RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" ) as e :
666+ with RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" ) as e :
667667 # submit first job
668668 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
669669 # submit second job
@@ -695,7 +695,7 @@ def test_executor_describe_job_failed_permanently(mock_start, *args):
695695@patch ("sagemaker.remote_function.client._JobSettings" )
696696def test_executor_submit_invalid_function_args (mock_job_settings , args , kwargs , error_message ):
697697 with pytest .raises (TypeError ) as e :
698- with RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" ) as executor :
698+ with RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" ) as executor :
699699 executor .submit (job_function , * args , ** kwargs )
700700 assert error_message in str (e .value )
701701
@@ -1063,7 +1063,7 @@ def test_executor_map_happy_case(mock_deserialized, mock_start, mock_job_setting
10631063
10641064 mock_deserialized .side_effect = [1 , 16 ]
10651065
1066- with RemoteExecutor (max_parallel_job = 1 , s3_root_uri = "s3://bucket/" ) as executor :
1066+ with RemoteExecutor (max_parallel_jobs = 1 , s3_root_uri = "s3://bucket/" ) as executor :
10671067 results = executor .map (job_function2 , [1 , 2 ], [3 , 4 ])
10681068
10691069 mock_start .assert_has_calls (
@@ -1095,7 +1095,7 @@ def test_executor_map_with_run(mock_deserialized, mock_start, mock_job_settings,
10951095 run_info = _RunInfo (run_obj .experiment_name , run_obj .run_name )
10961096
10971097 with run_obj :
1098- with RemoteExecutor (max_parallel_job = 2 , s3_root_uri = "s3://bucket/" ) as executor :
1098+ with RemoteExecutor (max_parallel_jobs = 2 , s3_root_uri = "s3://bucket/" ) as executor :
10991099 results_12 = executor .map (job_function2 , [1 , 2 ], [3 , 4 ])
11001100
11011101 mock_start .assert_has_calls (
@@ -1112,7 +1112,7 @@ def test_executor_map_with_run(mock_deserialized, mock_start, mock_job_settings,
11121112
11131113 mock_deserialized .side_effect = [1 , 16 ]
11141114
1115- with RemoteExecutor (max_parallel_job = 2 , s3_root_uri = "s3://bucket/" ) as executor :
1115+ with RemoteExecutor (max_parallel_jobs = 2 , s3_root_uri = "s3://bucket/" ) as executor :
11161116 with run_obj :
11171117 results_34 = executor .map (job_function2 , [1 , 2 ], [3 , 4 ])
11181118
0 commit comments