model_analyzer/config/input/config_command_profile.py
def _preprocess_and_verify_arguments(self):
        """
        Enforces some rules on the config.

        Raises
        ------
        TritonModelAnalyzerException
            If there is a problem with arguments or config.
        """

        if self.triton_launch_mode == 'remote':
            if self.client_protocol == 'http' and not self.triton_http_endpoint:
                raise TritonModelAnalyzerException(
                    "client-protocol is 'http'. Must specify triton-http-endpoint "
                    "if connecting to already running server or change protocol using "
                    "--client-protocol.")
            if self.client_protocol == 'grpc' and not self.triton_grpc_endpoint:
                raise TritonModelAnalyzerException(
                    "client-protocol is 'grpc'. Must specify triton-grpc-endpoint "
                    "if connecting to already running server or change protocol using "
                    "--client-protocol.")
        elif self.triton_docker_mounts or self.triton_docker_labels:
            if self.triton_launch_mode == 'docker':
                # Verify format
                if self.triton_docker_mounts:
                    for volume_str in self.triton_docker_mounts:
                        if volume_str.count(':') != 2:
                            raise TritonModelAnalyzerException(
                                "triton_docker_mounts needs to be a list of strings. Each string "
                                " should be of the format <host path>:<container dest>:<access mode>"
                            )
            else:
                logger.warning(
                    f"Triton launch mode is set to {self.triton_launch_mode}. "
                    "Ignoring triton_docker_mounts and triton_docker_labels.")

        if self.triton_launch_mode == 'docker':
            if not self.triton_docker_image or self.triton_docker_image.isspace(
            ):
                raise TritonModelAnalyzerException(
                    "triton_docker_image provided but is empty.")

        if self.triton_launch_mode == 'c_api':
            if self.triton_server_flags:
                logger.warning(
                    "Triton launch mode is set to C_API. Model Analyzer cannot set "
                    "triton_server_flags.")
            if self.triton_output_path:
                logger.warning(
                    "Triton launch mode is set to C_API, triton logs are not supported. "
                    "Triton server error output can be obtained by setting perf_output_path."
                )
        # If run config search is disabled and no concurrency value is provided,
        # set the default value.
        if self.run_config_search_disable:
            if len(self.concurrency) == 0:
                self.concurrency = [1]

        Enforces some rules on the config.

        Raises
        ------
        TritonModelAnalyzerException
            If there is a problem with arguments or config.
        
Enforces some rules on the config.
Raises

TritonModelAnalyzerException
If there is a problem with arguments or config.
Enforces some rules on the config . Raises TritonModelAnalyzerException If there is a problem with arguments or config .
def _preprocess_and_verify_arguments(self):
        if self.triton_launch_mode == 'remote':
            if self.client_protocol == 'http' and not self.triton_http_endpoint:
                raise TritonModelAnalyzerException(
                    "client-protocol is 'http'. Must specify triton-http-endpoint "
                    "if connecting to already running server or change protocol using "
                    "--client-protocol.")
            if self.client_protocol == 'grpc' and not self.triton_grpc_endpoint:
                raise TritonModelAnalyzerException(
                    "client-protocol is 'grpc'. Must specify triton-grpc-endpoint "
                    "if connecting to already running server or change protocol using "
                    "--client-protocol.")
        elif self.triton_docker_mounts or self.triton_docker_labels:
            if self.triton_launch_mode == 'docker':
                if self.triton_docker_mounts:
                    for volume_str in self.triton_docker_mounts:
                        if volume_str.count(':') != 2:
                            raise TritonModelAnalyzerException(
                                "triton_docker_mounts needs to be a list of strings. Each string "
                                " should be of the format <host path>:<container dest>:<access mode>"
                            )
            else:
                logger.warning(
                    f"Triton launch mode is set to {self.triton_launch_mode}. "
                    "Ignoring triton_docker_mounts and triton_docker_labels.")
        if self.triton_launch_mode == 'docker':
            if not self.triton_docker_image or self.triton_docker_image.isspace(
            ):
                raise TritonModelAnalyzerException(
                    "triton_docker_image provided but is empty.")
        if self.triton_launch_mode == 'c_api':
            if self.triton_server_flags:
                logger.warning(
                    "Triton launch mode is set to C_API. Model Analyzer cannot set "
                    "triton_server_flags.")
            if self.triton_output_path:
                logger.warning(
                    "Triton launch mode is set to C_API, triton logs are not supported. "
                    "Triton server error output can be obtained by setting perf_output_path."
                )
        if self.run_config_search_disable:
            if len(self.concurrency) == 0:
                self.concurrency = [1]
def _preprocess_and_verify_arguments ( self ) : if self . triton_launch_mode == 'remote' : if self . client_protocol == 'http' and not self . triton_http_endpoint : raise TritonModelAnalyzerException ( "client-protocol is 'http'. Must specify triton-http-endpoint " "if connecting to already running server or change protocol using " "--client-protocol." ) if self . client_protocol == 'grpc' and not self . triton_grpc_endpoint : raise TritonModelAnalyzerException ( "client-protocol is 'grpc'. Must specify triton-grpc-endpoint " "if connecting to already running server or change protocol using " "--client-protocol." ) elif self . triton_docker_mounts or self . triton_docker_labels : if self . triton_launch_mode == 'docker' : if self . triton_docker_mounts : for volume_str in self . triton_docker_mounts : if volume_str . count ( ':' ) != 2 : raise TritonModelAnalyzerException ( "triton_docker_mounts needs to be a list of strings. Each string " " should be of the format <host path>:<container dest>:<access mode>" ) else : logger . warning ( f"Triton launch mode is set to {self.triton_launch_mode}. " "Ignoring triton_docker_mounts and triton_docker_labels." ) if self . triton_launch_mode == 'docker' : if not self . triton_docker_image or self . triton_docker_image . isspace ( ) : raise TritonModelAnalyzerException ( "triton_docker_image provided but is empty." ) if self . triton_launch_mode == 'c_api' : if self . triton_server_flags : logger . warning ( "Triton launch mode is set to C_API. Model Analyzer cannot set " "triton_server_flags." ) if self . triton_output_path : logger . warning ( "Triton launch mode is set to C_API, triton logs are not supported. " "Triton server error output can be obtained by setting perf_output_path." ) if self . run_config_search_disable : if len ( self . concurrency ) == 0 : self . concurrency = [ 1 ]
Enforces some rules on the config.
Enforces some rules on the config .
"""
        Enforces some rules on the config.

        Raises
        ------
        TritonModelAnalyzerException
            If there is a problem with arguments or config.
        """ # Verify format # If run config search is disabled and no concurrency value is provided, # set the default value.
self