@@ -691,7 +691,7 @@ def test_default_config_always_run_automatic_search(self):
691691
692692 def test_throughput_early_exit_minimum_runs (self ):
693693 """
694- Test that there is an early backoff when sweeping concurrency
694+ Test that there is an early back off when sweeping concurrency
695695
696696 The behavior is that MA will try at least 4 concurrencies. If
697697 at that point none of the last 3 attempts have had satisfactory
@@ -738,7 +738,7 @@ def test_throughput_early_exit_minimum_runs(self):
738738
739739 def test_no_early_exit_if_not_auto_search (self ):
740740 """
741- Test that there is NOT an early backoff when sweeping concurrency if not in auto sweep mode
741+ Test that there is NOT an early back off when sweeping concurrency if not in auto sweep mode
742742
743743 This test hardcodes the 'throughput' to 1, so for all model
744744 configs the gain will be invalid. However, it should still sweep
@@ -780,7 +780,7 @@ def test_no_early_exit_if_not_auto_search(self):
780780
781781 def test_throughput_early_exit (self ):
782782 """
783- Test that there is an early backoff when sweeping concurrency
783+ Test that there is an early back off when sweeping concurrency
784784
785785 The behavior is that MA stop if it had 4 concurrencies in a row
786786 without any valid gain amongst any of them
@@ -822,9 +822,10 @@ def test_throughput_early_exit(self):
822822 ]
823823 self ._test_model_manager (yaml_str , expected_ranges )
824824
825+ @patch ('model_analyzer.model_manager.INVALID_MEASUREMENT_THRESHOLD' , 999 )
825826 def test_bad_result_early_PA_exit (self ):
826827 """
827- Test that there is an early backoff for bad result (out of memory)
828+ Test that there is an early back off for bad result (out of memory)
828829
829830 If no measurements are returned in an attempt, no further concurrencies
830831 should be tried.
@@ -863,9 +864,30 @@ def test_bad_result_early_PA_exit(self):
863864 mock_method .return_value = None
864865 self ._test_model_manager (yaml_str , expected_ranges )
865866
867+ def test_report_failure_no_measurements (self ):
868+ """
869+ Test that MA takes an exception if we detect no measurements returned from
870+ PA at the start of profile
871+ """
872+
873+ yaml_str = ("""
874+ profile_models: test_model
875+ run_config_search_max_concurrency: 128
876+ run_config_search_max_instance_count: 2
877+ run_config_search_min_model_batch_size: 8
878+ run_config_search_max_model_batch_size: 8
879+ run_config_search_disable: False
880+ """ )
881+
882+ with patch .object (MetricsManagerSubclass ,
883+ "_get_next_perf_throughput_value" ) as mock_method :
884+ mock_method .return_value = None
885+ with self .assertRaises (TritonModelAnalyzerException ):
886+ self ._test_model_manager (yaml_str , None )
887+
866888 def test_lower_throughput_early_batch_size_exit (self ):
867889 """
868- Test that there is an early backoff for throughput decreasing
890+ Test that there is an early back off for throughput decreasing
869891 when sweeping max_batch_size
870892
871893 If a list of measurements is provided with a lower max throughput than the previous
@@ -919,10 +941,10 @@ def test_lower_throughput_early_batch_size_exit(self):
919941 #yapf: disable
920942 mock_method .side_effect = [
921943 1 , 2 , 4 , # Default config, concurrency 1,2,4
922- 1 , 2 , 4 , # 1 Instance, Batch size 8, concurency 1,2,4
944+ 1 , 2 , 4 , # 1 Instance, Batch size 8, concurrency 1,2,4
923945 2 , 4 , 8 , # 1 Instance, Batch size 16, concurrency 1,2,4
924946 2 , 4 , 8 , # 1 Instance, Batch size 32, concurrency 1,2,4
925- 1 , 2 , 4 , # 1 Instance, Batch size 8, concurency 1,2,4
947+ 1 , 2 , 4 , # 1 Instance, Batch size 8, concurrency 1,2,4
926948 8 , 4 , 2 , # 1 Instance, Batch size 16, concurrency 1,2,4
927949 4 , 8 , 16 , # 1 Instance, Batch size 32, concurrency 1,2,4
928950 4 , 8 , 16 # 1 Instance, Batch size 64, concurrency 1,2,4
0 commit comments