Overview
The reporting module provides functions to build comprehensive summaries of optimization studies and write results to disk in structured formats (CSV and JSON).Core Functions
build_summary
Builds a comprehensive summary dictionary from optimization study results.Baseline model metrics before optimization (typically contains accuracy, latency, memory, etc.)
List of all memory budget constraints evaluated during the study
The active/selected memory budget constraint for filtering configurations
CPU frequency scaling factor applied during evaluation
Latency adjustment multiplier used in the study
DataFrame containing all sweep configurations with an
accepted column indicating which configurations meet constraintsDeployment simulation results from
deployment_simulationSummary dictionary containing:
baseline: Original baseline metricsmemory_budgets_mb: List of evaluated budgetsactive_memory_budget_mb: Active budget constraintcpu_frequency_scale: CPU scaling factorlatency_multiplier: Applied latency multiplierstudy_rows: Total number of configurations evaluatedaccepted_rows: Number of configurations meeting all constraintsrejected_rows: Number of configurations rejectedbest_accuracy_accepted: Highest accuracy among accepted configurations (None if no accepted configs)lowest_latency_ms_accepted: Lowest latency among accepted configurations (None if no accepted configs)deployment: Deployment simulation metrics
The function filters the sweep DataFrame to identify accepted configurations and computes statistics only on those that meet all constraints. If no configurations are accepted,
best_accuracy_accepted and lowest_latency_ms_accepted will be None.write_outputs
Writes optimization study results to disk in structured formats.Directory path where output files will be written (created if it doesn’t exist)
Complete sweep results DataFrame with all configurations evaluated
Pareto frontier DataFrame for latency-accuracy tradeoff
Pareto frontier DataFrame for energy-accuracy tradeoff
Summary dictionary from
build_summaryThis function creates the following files:
sweep_results.csv: Complete sweep data with all configurationspareto_frontier_latency.csv: Pareto-optimal configurations for latency vs. accuracypareto_frontier_energy.csv: Pareto-optimal configurations for energy vs. accuracysummary.json: JSON file with study summary and key metrics
Output File Structure
sweep_results.csv
Contains all evaluated configurations with columns depending on the sweep parameters. Typical columns include:precision: Numeric precision (e.g., fp32, fp16)accuracy: Model accuracylatency_ms: Inference latency in millisecondsmemory_mb: Memory footprint in megabytesenergy_proxy_j: Energy consumption estimate in joulesaccepted: Boolean indicating if configuration meets constraints- Additional custom columns from the sweep
pareto_frontier_latency.csv
Contains Pareto-optimal configurations that represent the best latency-accuracy tradeoffs. Each row is a configuration where no other configuration has both better latency and better accuracy.pareto_frontier_energy.csv
Contains Pareto-optimal configurations for energy efficiency vs. accuracy tradeoff.summary.json
JSON file with the complete summary structure frombuild_summary. Example structure:
All CSV files are written with UTF-8 encoding and without row indices. The summary JSON is formatted with 2-space indentation for readability.