neural_compressor.ux.components.db_manager.db_operations

The db_operation package contains interfaces used to control local database.

Submodules

Package Contents

Classes

BenchmarkAPIInterface

Interface for queries connected with benchmark.

DatasetAPIInterface

Interface for queries connected with datasets.

DiagnosisAPIInterface

Interface for queries connected with diagnosis of models.

DictionariesAPIInterface

Interface for queries connected with dictonaries.

ExamplesAPIInterface

Interface for queries connected with predefined models.

ModelAPIInterface

Interface for queries connected with models.

OptimizationAPIInterface

Interface for queries connected with optimizations.

ProfilingAPIInterface

Interface for queries connected with profiling.

ProjectAPIInterface

Interface for queries connected with project.

class neural_compressor.ux.components.db_manager.db_operations.BenchmarkAPIInterface

Interface for queries connected with benchmark.

static delete_benchmark(data: dict) dict

Delete benchmark from database and clean workspace.

static get_benchmark_details(data: dict) dict

Parse input data and get benchmark details.

static list_benchmarks(data: dict) dict

List benchmarks assigned to project.

static update_benchmark_accuracy(data: dict) dict

Update benchmark accuracy.

static update_benchmark_performance(data: dict) dict

Update benchmark performance.

static update_benchmark_status(data: dict) dict

Update benchmark status.

static update_benchmark_duration(data: dict) dict

Update duration of benchmark.

static update_paths(data: dict) dict

Update config path and output log path.

static update_execution_command(data: dict) dict

Update benchmark execution command.

static add_benchmark(data: dict) dict

Add benchmark to database.

static add_result(data: dict) None

Add benchmark result to database.

static edit_benchmark(data: dict) dict

Edit existing benchmark.

static parse_benchmark_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.BenchmarkAddParamsInterface

Parse input data for benchmark.

static parse_benchmark_edit_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.BenchmarkEditParamsInterface

Parse data for editing benchmark.

static clean_status(status_to_clean: neural_compressor.ux.utils.consts.ExecutionStatus) dict

Clean specified optimization status.

class neural_compressor.ux.components.db_manager.db_operations.DatasetAPIInterface

Interface for queries connected with datasets.

static delete_dataset(data: dict) dict

Delete dataset from database and clean workspace.

static get_dataset_details(data: dict) dict

Parse input data and get dataset details.

static list_datasets(data: dict) dict

List datasets assigned to project.

static add_dataset(data: dict) dict

Add dataset to database.

static set_template_path(dataset_id: int, parsed_dataset_data: neural_compressor.ux.components.db_manager.params_interfaces.DatasetAddParamsInterface) None

Set template path for dataset.

static check_if_custom_metric_or_dataloader(dataset_data: neural_compressor.ux.components.db_manager.params_interfaces.DatasetAddParamsInterface) dict

Check if dataset contains custom dataloader or metric.

static generate_custom_template(dataloader_path: str, custom: dict) str | None

Generate template for custom dataloader or metric.

static generate_template(dataloader_path: str, template_type: str) str

Generate code templates.

static dataloader_path(project_name: str, project_id: int, dataset_name: str, dataset_id: int) str

Get path for dataset templates.

static parse_dataset_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.DatasetAddParamsInterface

Parse input data for dataset.

static get_predefined_dataset(data: dict) dict

Get predefined dataset for specified configuration.

static prepare_predefined_dataloader(dataloader_data: neural_compressor.ux.utils.workload.dataloader.Dataset) dict

Prepare predefined transform data.

static prepare_predefined_transform(transforms_data: OrderedDict[str, neural_compressor.ux.utils.workload.dataloader.Transform]) List[dict]

Prepare predefined transform data.

class neural_compressor.ux.components.db_manager.db_operations.DiagnosisAPIInterface

Interface for queries connected with diagnosis of models.

static get_op_list(data: dict) List[dict]

Get OP list for model.

static get_op_details(data: dict) dict

Get OP details for specific OP in model.

static histogram(data: dict) list

Get histogram of specific tensor in model.

static generate_optimization(data: dict) int

Parse input data and get optimization details.

static model_wise_params(data: dict) dict

Get model wise parameters for specified optimization.

static parse_optimization_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.DiagnosisOptimizationParamsInterface

Parse optimization parameters from diagnosis tab.

static parse_op_wise_config(op_wise_params: dict) dict

Parse OP wise configuration.

static parse_wise_parameters(params_per_type: dict) dict

Parse model or OP wise parameters.

static set_op_wise_pattern_precision(op_wise_params: dict, precision: str) dict

Set precision from op wise pattern setting.

static parse_model_wise_config(data: dict) dict

Parse Model wise configuration.

class neural_compressor.ux.components.db_manager.db_operations.DictionariesAPIInterface

Interface for queries connected with dictonaries.

static list_domains(data: dict) dict

List model domains.

static list_domain_flavours(data: dict) dict

List model domain flavours.

static list_optimization_types(data: dict) dict

List optimization types.

static list_optimization_types_for_precision(data: dict) dict

List optimization types.

static list_precisions(data: dict) dict

List precisions.

static list_dataloaders(data: dict) dict

List all dataloaders.

static list_dataloaders_by_framework(data: dict) dict

List dataloaders for specified framework.

static list_transforms(data: dict) dict

List all transforms.

static list_transforms_by_framework(data: dict) dict

List transforms for specified framework.

static list_transforms_by_domain(data: dict) dict

List transforms for specified domain.

static list_metrics(data: dict) dict

List all metrics.

static list_metrics_by_framework(data: dict) dict

List metrics for specified framework.

class neural_compressor.ux.components.db_manager.db_operations.ExamplesAPIInterface

Interface for queries connected with predefined models.

static create_project(data: dict) None

Create new project for predefined model.

static get_optimization_data(db_session: sqlalchemy.orm.session.Session, project_id: int, dataset_id: int, optimization_name: str, precision: str, optimization: str) neural_compressor.ux.components.db_manager.params_interfaces.OptimizationAddParamsInterface

Get data to add optimization.

class neural_compressor.ux.components.db_manager.db_operations.ModelAPIInterface

Interface for queries connected with models.

static add_model(data: dict) int

Add model details.

static get_model_details(data: dict) dict

Parse input data and get model details.

static list_models(data: dict) dict

List models assigned to project.

static delete_model(data: dict) dict

Delete model from database.

static parse_model_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.ModelAddParamsInterface

Parse input data for model.

class neural_compressor.ux.components.db_manager.db_operations.OptimizationAPIInterface

Interface for queries connected with optimizations.

static delete_optimization(data: dict) dict

Delete optimization from database and clean workspace.

static get_optimization_details(data: dict) dict

Parse input data and get optimization details.

static list_optimizations(data: dict) dict

List optimizations assigned to project.

static update_optimization_status(data: dict) dict

Update optimization status.

static update_optimized_model(data: dict) dict

Update optimized model.

static update_optimization_duration(data: dict) dict

Update duration of optimization.

static update_paths(data: dict) dict

Update config path and output log path.

static update_execution_command(data: dict) dict

Update optimization execution command.

static pin_accuracy_benchmark(data: dict) dict

Pin accuracy benchmark to optimization.

static pin_performance_benchmark(data: dict) dict

Pin performance benchmark to optimization.

static add_optimization(data: dict) dict

Add optimization to database.

static add_quantization_optimization(db_session: sqlalchemy.orm.session.Session, optimization_data: neural_compressor.ux.components.db_manager.params_interfaces.OptimizationAddParamsInterface) int

Add quantization optimization to database.

static add_pruning_optimization(db_session: sqlalchemy.orm.session.Session, optimization_data: neural_compressor.ux.components.db_manager.params_interfaces.OptimizationAddParamsInterface) int

Add quantization optimization to database.

static add_standard_optimization(db_session: sqlalchemy.orm.session.Session, optimization_data: neural_compressor.ux.components.db_manager.params_interfaces.OptimizationAddParamsInterface) int

Add optimization to database.

static edit_optimization(data: dict) dict

Edit existing optimization.

static get_pruning_details(data: dict) dict

Gat pruning details in a form of tree.

static edit_tuning_details(db_session: sqlalchemy.orm.session.Session, optimization: dict, parsed_optimization_data: neural_compressor.ux.components.db_manager.params_interfaces.OptimizationEditParamsInterface) dict

Edit tuning details.

static edit_pruning_details(db_session: sqlalchemy.orm.session.Session, optimization: dict, pruning_data: dict) dict

Edit pruning details.

static add_tuning_history(optimization_id: int, tuning_history: dict) int

Add tuning history to database.

static parse_tuning_history(tuning_history: dict) neural_compressor.ux.components.db_manager.params_interfaces.TuningHistoryInterface

Parse input data for tuning history.

static parse_optimization_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.OptimizationAddParamsInterface

Parse input data for optimization.

static parse_optimization_edit_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.OptimizationEditParamsInterface

Parse data for editing optimization.

static load_pruning_details_config(data: dict) List[dict]

Load pruning details config.

static clean_status(status_to_clean: neural_compressor.ux.utils.consts.ExecutionStatus) dict

Clean specified optimization status.

class neural_compressor.ux.components.db_manager.db_operations.ProfilingAPIInterface

Interface for queries connected with profiling.

static get_profiling_details(data: dict) dict

Parse input data and get profiling details.

static delete_profiling(data: dict) dict

Delete profiling from database and clean workspace.

static list_profilings(data: dict) dict

List profilings assigned to project.

static update_profiling_status(data: dict) dict

Update profiling status.

static update_profiling_duration(data: dict) dict

Update duration of profiling.

static update_log_path(data: dict) dict

Update config path and output log path.

static update_execution_command(data: dict) dict

Update profiling execution command.

static add_profiling(data: dict) dict

Add profiling to database.

static edit_profiling(data: dict) dict

Edit existing profiling.

static add_result(profiling_id: int, data: dict) None

Add profiling result to database.

static bulk_add_results(profiling_id: int, results: List[dict]) None

Bulk add profiling results to database.

static parse_profiling_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.ProfilingAddParamsInterface

Parse input data for profiling.

static parse_profiling_result_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.ProfilingResultAddParamsInterface

Parse input data for profiling result.

static parse_profiling_edit_data(data: dict) neural_compressor.ux.components.db_manager.params_interfaces.ProfilingEditParamsInterface

Parse data for editing profiling.

static clean_status(status_to_clean: neural_compressor.ux.utils.consts.ExecutionStatus) dict

Clean specified optimization status.

class neural_compressor.ux.components.db_manager.db_operations.ProjectAPIInterface

Interface for queries connected with project.

static get_project_details(data: dict) dict

Get project details from database.

static list_projects(data: dict) dict

List projects from database.

static create_project(data: dict) dict

Create new project and add input model.

static delete_project(data: dict) dict

Delete project details from database and clean workspace.

static add_model(db_session: sqlalchemy.orm.session.Session, data: dict) int

Create new project with input model.

static add_dummy_dataset(db_session: sqlalchemy.orm.session.Session, data: dict) int

Add dummy dataset to project.

static update_project_notes(data: dict) dict

Update project notes.