model_analyzer/config/input/config_command_analyze.py
def _add_model_spec_configs(self):
        """
        Adds configs related to specifying
        model objectives and constraints, 
        as well as plots
        """

        objectives_scheme = ConfigUnion([
            ConfigObject(
                schema={
                    tag: ConfigPrimitive(type_=int)
                    for tag in RecordType.get_all_record_types().keys()
                }),
            ConfigListString(output_mapper=objective_list_output_mapper)
        ])
        self._add_config(
            ConfigField(
                'objectives',
                field_type=objectives_scheme,
                default_value=DEFAULT_OFFLINE_OBJECTIVES,
                description=
                'Model Analyzer uses the objectives described here to find the best configuration for each model.'
            ))
        constraints_scheme = ConfigObject(
            schema={
                'perf_throughput':
                    ConfigObject(schema={
                        'min': ConfigPrimitive(int),
                    }),
                'perf_latency_avg':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency_p90':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency_p95':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency_p99':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'gpu_used_memory':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
            })
        self._add_config(
            ConfigField(
                'constraints',
                field_type=constraints_scheme,
                description=
                'Constraints on the objectives specified in the "objectives" field of the config.'
            ))

        analysis_model_scheme = ConfigObject(
            required=True,
            schema={
                # Any key is allowed, but the keys must follow the pattern
                # below
                '*':
                    ConfigObject(
                        schema={
                            'objectives': objectives_scheme,
                            'constraints': constraints_scheme,
                        })
            },
            output_mapper=ConfigModelAnalysisSpec.
            model_object_to_config_model_analysis_spec)
        self._add_config(
            ConfigField(
                'analysis_models',
                flags=['--analysis-models'],
                field_type=ConfigUnion([
                    analysis_model_scheme,
                    ConfigListGeneric(
                        ConfigUnion([
                            analysis_model_scheme,
                            ConfigPrimitive(
                                str,
                                output_mapper=ConfigModelAnalysisSpec.
                                model_str_to_config_model_analysis_spec)
                        ]),
                        required=True,
                        output_mapper=ConfigModelAnalysisSpec.
                        model_mixed_to_config_model_analysis_spec),
                    ConfigListString(output_mapper=ConfigModelAnalysisSpec.
                                     model_list_to_config_model_analysis_spec),
                ],
                                       required=True),
                description=
                'Comma-delimited list of the model names for whom to generate reports.'
            ))

        Adds configs related to specifying
        model objectives and constraints, 
        as well as plots
        
Adds configs related to specifying
model objectives and constraints,
as well as plots
Adds configs related to specifying model objectives and constraints as well as plots
def _add_model_spec_configs(self):
        objectives_scheme = ConfigUnion([
            ConfigObject(
                schema={
                    tag: ConfigPrimitive(type_=int)
                    for tag in RecordType.get_all_record_types().keys()
                }),
            ConfigListString(output_mapper=objective_list_output_mapper)
        ])
        self._add_config(
            ConfigField(
                'objectives',
                field_type=objectives_scheme,
                default_value=DEFAULT_OFFLINE_OBJECTIVES,
                description=
                'Model Analyzer uses the objectives described here to find the best configuration for each model.'
            ))
        constraints_scheme = ConfigObject(
            schema={
                'perf_throughput':
                    ConfigObject(schema={
                        'min': ConfigPrimitive(int),
                    }),
                'perf_latency_avg':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency_p90':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency_p95':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency_p99':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'perf_latency':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
                'gpu_used_memory':
                    ConfigObject(schema={
                        'max': ConfigPrimitive(int),
                    }),
            })
        self._add_config(
            ConfigField(
                'constraints',
                field_type=constraints_scheme,
                description=
                'Constraints on the objectives specified in the "objectives" field of the config.'
            ))
        analysis_model_scheme = ConfigObject(
            required=True,
            schema={
                '*':
                    ConfigObject(
                        schema={
                            'objectives': objectives_scheme,
                            'constraints': constraints_scheme,
                        })
            },
            output_mapper=ConfigModelAnalysisSpec.
            model_object_to_config_model_analysis_spec)
        self._add_config(
            ConfigField(
                'analysis_models',
                flags=['--analysis-models'],
                field_type=ConfigUnion([
                    analysis_model_scheme,
                    ConfigListGeneric(
                        ConfigUnion([
                            analysis_model_scheme,
                            ConfigPrimitive(
                                str,
                                output_mapper=ConfigModelAnalysisSpec.
                                model_str_to_config_model_analysis_spec)
                        ]),
                        required=True,
                        output_mapper=ConfigModelAnalysisSpec.
                        model_mixed_to_config_model_analysis_spec),
                    ConfigListString(output_mapper=ConfigModelAnalysisSpec.
                                     model_list_to_config_model_analysis_spec),
                ],
                                       required=True),
                description=
                'Comma-delimited list of the model names for whom to generate reports.'
            ))
def _add_model_spec_configs ( self ) : objectives_scheme = ConfigUnion ( [ ConfigObject ( schema = { tag : ConfigPrimitive ( type_ = int ) for tag in RecordType . get_all_record_types ( ) . keys ( ) } ) , ConfigListString ( output_mapper = objective_list_output_mapper ) ] ) self . _add_config ( ConfigField ( 'objectives' , field_type = objectives_scheme , default_value = DEFAULT_OFFLINE_OBJECTIVES , description = 'Model Analyzer uses the objectives described here to find the best configuration for each model.' ) ) constraints_scheme = ConfigObject ( schema = { 'perf_throughput' : ConfigObject ( schema = { 'min' : ConfigPrimitive ( int ) , } ) , 'perf_latency_avg' : ConfigObject ( schema = { 'max' : ConfigPrimitive ( int ) , } ) , 'perf_latency_p90' : ConfigObject ( schema = { 'max' : ConfigPrimitive ( int ) , } ) , 'perf_latency_p95' : ConfigObject ( schema = { 'max' : ConfigPrimitive ( int ) , } ) , 'perf_latency_p99' : ConfigObject ( schema = { 'max' : ConfigPrimitive ( int ) , } ) , 'perf_latency' : ConfigObject ( schema = { 'max' : ConfigPrimitive ( int ) , } ) , 'gpu_used_memory' : ConfigObject ( schema = { 'max' : ConfigPrimitive ( int ) , } ) , } ) self . _add_config ( ConfigField ( 'constraints' , field_type = constraints_scheme , description = 'Constraints on the objectives specified in the "objectives" field of the config.' ) ) analysis_model_scheme = ConfigObject ( required = True , schema = { '*' : ConfigObject ( schema = { 'objectives' : objectives_scheme , 'constraints' : constraints_scheme , } ) } , output_mapper = ConfigModelAnalysisSpec . model_object_to_config_model_analysis_spec ) self . _add_config ( ConfigField ( 'analysis_models' , flags = [ '--analysis-models' ] , field_type = ConfigUnion ( [ analysis_model_scheme , ConfigListGeneric ( ConfigUnion ( [ analysis_model_scheme , ConfigPrimitive ( str , output_mapper = ConfigModelAnalysisSpec . model_str_to_config_model_analysis_spec ) ] ) , required = True , output_mapper = ConfigModelAnalysisSpec . model_mixed_to_config_model_analysis_spec ) , ConfigListString ( output_mapper = ConfigModelAnalysisSpec . model_list_to_config_model_analysis_spec ) , ] , required = True ) , description = 'Comma-delimited list of the model names for whom to generate reports.' ) )
Adds configs related to specifying
model objectives and constraints,
as well as plots
Adds configs related to specifying model objectives and constraints as well as plots
"""
        Adds configs related to specifying
        model objectives and constraints, 
        as well as plots
        """ # Any key is allowed, but the keys must follow the pattern # below
self