model_analyzer/record/metrics_manager.py
def _get_perf_analyzer_metrics(self,
                                   perf_config,
                                   perf_output_writer=None,
                                   perf_analyzer_env=None):
        """
        Gets the aggregated metrics from the perf_analyzer
        Parameters
        ----------
        perf_config : dict
            The keys are arguments to perf_analyzer The values are their
            values
        perf_output_writer : OutputWriter
            Writer that writes the output from perf_analyzer to the output
            stream/file. If None, the output is not written
        perf_analyzer_env : dict
            a dict of name:value pairs for the environment variables with which
            perf_analyzer should be run.

        Raises
        ------
        TritonModelAnalyzerException
        """

        perf_analyzer = PerfAnalyzer(
            path=self._config.perf_analyzer_path,
            config=perf_config,
            max_retries=self._config.perf_analyzer_max_auto_adjusts,
            timeout=self._config.perf_analyzer_timeout,
            max_cpu_util=self._config.perf_analyzer_cpu_util)

        # IF running with C_API, need to set CUDA_VISIBLE_DEVICES here
        if self._config.triton_launch_mode == 'c_api':
            perf_analyzer_env['CUDA_VISIBLE_DEVICES'] = ','.join(
                [gpu.device_uuid() for gpu in self._gpus])

        status = perf_analyzer.run(self._perf_metrics, env=perf_analyzer_env)

        if perf_output_writer:
            perf_output_writer.write(
                '============== Perf Analyzer Launched ==============\n '
                f'Command: perf_analyzer {perf_config.to_cli_string()} \n\n',
                append=True)
            perf_output_writer.write(perf_analyzer.output() + '\n', append=True)

        # PerfAnalzyer run was not succesful
        if status == 1:
            return 1

        perf_records = perf_analyzer.get_records()
        perf_record_aggregator = RecordAggregator()
        perf_record_aggregator.insert_all(perf_records)

        return perf_record_aggregator.aggregate()

        Gets the aggregated metrics from the perf_analyzer
        Parameters
        ----------
        perf_config : dict
            The keys are arguments to perf_analyzer The values are their
            values
        perf_output_writer : OutputWriter
            Writer that writes the output from perf_analyzer to the output
            stream/file. If None, the output is not written
        perf_analyzer_env : dict
            a dict of name:value pairs for the environment variables with which
            perf_analyzer should be run.

        Raises
        ------
        TritonModelAnalyzerException
        
Gets the aggregated metrics from the perf_analyzer
Parameters

perf_config : dict
The keys are arguments to perf_analyzer The values are their
values
perf_output_writer : OutputWriter
Writer that writes the output from perf_analyzer to the output
stream/file. If None, the output is not written
perf_analyzer_env : dict
a dict of name:value pairs for the environment variables with which
perf_analyzer should be run.

Raises


Gets the aggregated metrics from the perf_analyzer Parameters perf_config : dict The keys are arguments to perf_analyzer The values are their values perf_output_writer : OutputWriter Writer that writes the output from perf_analyzer to the output stream / file . If None the output is not written perf_analyzer_env : dict a dict of name : value pairs for the environment variables with which perf_analyzer should be run . Raises
def _get_perf_analyzer_metrics(self,
                                   perf_config,
                                   perf_output_writer=None,
                                   perf_analyzer_env=None):
        perf_analyzer = PerfAnalyzer(
            path=self._config.perf_analyzer_path,
            config=perf_config,
            max_retries=self._config.perf_analyzer_max_auto_adjusts,
            timeout=self._config.perf_analyzer_timeout,
            max_cpu_util=self._config.perf_analyzer_cpu_util)
        if self._config.triton_launch_mode == 'c_api':
            perf_analyzer_env['CUDA_VISIBLE_DEVICES'] = ','.join(
                [gpu.device_uuid() for gpu in self._gpus])
        status = perf_analyzer.run(self._perf_metrics, env=perf_analyzer_env)
        if perf_output_writer:
            perf_output_writer.write(
                '============== Perf Analyzer Launched ==============\n '
                f'Command: perf_analyzer {perf_config.to_cli_string()} \n\n',
                append=True)
            perf_output_writer.write(perf_analyzer.output() + '\n', append=True)
        if status == 1:
            return 1
        perf_records = perf_analyzer.get_records()
        perf_record_aggregator = RecordAggregator()
        perf_record_aggregator.insert_all(perf_records)
        return perf_record_aggregator.aggregate()
def _get_perf_analyzer_metrics ( self , perf_config , perf_output_writer = None , perf_analyzer_env = None ) : perf_analyzer = PerfAnalyzer ( path = self . _config . perf_analyzer_path , config = perf_config , max_retries = self . _config . perf_analyzer_max_auto_adjusts , timeout = self . _config . perf_analyzer_timeout , max_cpu_util = self . _config . perf_analyzer_cpu_util ) if self . _config . triton_launch_mode == 'c_api' : perf_analyzer_env [ 'CUDA_VISIBLE_DEVICES' ] = ',' . join ( [ gpu . device_uuid ( ) for gpu in self . _gpus ] ) status = perf_analyzer . run ( self . _perf_metrics , env = perf_analyzer_env ) if perf_output_writer : perf_output_writer . write ( '============== Perf Analyzer Launched ==============\n ' f'Command: perf_analyzer {perf_config.to_cli_string()} \n\n' , append = True ) perf_output_writer . write ( perf_analyzer . output ( ) + '\n' , append = True ) if status == 1 : return 1 perf_records = perf_analyzer . get_records ( ) perf_record_aggregator = RecordAggregator ( ) perf_record_aggregator . insert_all ( perf_records ) return perf_record_aggregator . aggregate ( )
Gets the aggregated metrics from the perf_analyzer
Parameters
Gets the aggregated metrics from the perf_analyzer Parameters
"""
        Gets the aggregated metrics from the perf_analyzer
        Parameters
        ----------
        perf_config : dict
            The keys are arguments to perf_analyzer The values are their
            values
        perf_output_writer : OutputWriter
            Writer that writes the output from perf_analyzer to the output
            stream/file. If None, the output is not written
        perf_analyzer_env : dict
            a dict of name:value pairs for the environment variables with which
            perf_analyzer should be run.

        Raises
        ------
        TritonModelAnalyzerException
        """ # IF running with C_API, need to set CUDA_VISIBLE_DEVICES here # PerfAnalzyer run was not succesful
self
perf_config
perf_output_writer
perf_analyzer_env