Skip to content

Commit

Permalink
fix(optimizer): sync with linting update, dead code and deprecated co…
Browse files Browse the repository at this point in the history
…nstants
  • Loading branch information
rudy-6-4 authored and BourgerieQuentin committed Jun 18, 2024
1 parent eba61f2 commit 1da7347
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl Feasible {
let pbs_index = operations_variance.index.pbs(partition);
let actual_pbs_variance = operations_variance.values[pbs_index];

let mut smallest_pbs_max_variance = std::f64::MAX;
let mut smallest_pbs_max_variance = f64::MAX;

for constraint in &self.undominated_constraints {
let pbs_coeff = constraint.variance.coeff_pbs(partition);
Expand All @@ -60,7 +60,7 @@ impl Feasible {
.keyswitch_to_small(src_partition, dst_partition);
let actual_ks_variance = operations_variance.values[ks_index];

let mut smallest_ks_max_variance = std::f64::MAX;
let mut smallest_ks_max_variance = f64::MAX;

for constraint in &self.undominated_constraints {
let ks_coeff = constraint
Expand Down Expand Up @@ -89,7 +89,7 @@ impl Feasible {
.keyswitch_to_big(src_partition, dst_partition);
let actual_fks_variance = operations_variance.values[fks_index];

let mut smallest_fks_max_variance = std::f64::MAX;
let mut smallest_fks_max_variance = f64::MAX;

for constraint in &self.undominated_constraints {
let fks_coeff = constraint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ fn variance_origin(inputs: &[OperatorIndex], out_variances: &[SymbolicVariance])

#[derive(Clone, Debug)]
pub struct SoloKeyDag {
pub operators: Vec<Operator>,
// Collect all operators output variances
pub out_variances: Vec<SymbolicVariance>,
pub nb_luts: u64,
Expand All @@ -125,9 +124,9 @@ pub struct SoloKeyDag {

#[derive(Clone, Debug)]
pub struct VariancesAndBound {
#[cfg(test)]
pub precision: Precision,
pub safe_variance_bound: f64,
pub nb_luts: u64,
// All dominating final variance factor not entering a lut (usually final levelledOp)
pub pareto_output: Vec<SymbolicVariance>,
// All dominating variance factor entering a lut
Expand Down Expand Up @@ -349,7 +348,6 @@ fn constraint_for_one_precision(
) -> VariancesAndBound {
let extra_finals_variance = select_precision(target_precision, extra_final_variances);
let in_luts_variance = select_precision(target_precision, in_luts_variance);
let nb_luts = in_luts_variance.len() as u64;
let all_output = counted_symbolic_variance(&extra_finals_variance);
let all_in_lut = counted_symbolic_variance(&in_luts_variance);
let remove_shape = |t: &(Shape, SymbolicVariance)| t.1;
Expand All @@ -358,9 +356,9 @@ fn constraint_for_one_precision(
let pareto_vfs_final = SymbolicVariance::reduce_to_pareto_front(extra_finals_variance);
let pareto_vfs_in_lut = SymbolicVariance::reduce_to_pareto_front(in_luts_variance);
VariancesAndBound {
#[cfg(test)]
precision: target_precision,
safe_variance_bound: safe_noise_bound,
nb_luts,
pareto_output: pareto_vfs_final,
pareto_in_lut: pareto_vfs_in_lut,
all_output,
Expand Down Expand Up @@ -399,7 +397,6 @@ pub fn analyze(dag: &Dag, noise_config: &NoiseBoundConfig) -> SoloKeyDag {
noise_config,
);
let result = SoloKeyDag {
operators: dag.operators.clone(),
out_variances,
nb_luts,
levelled_complexity,
Expand Down

0 comments on commit 1da7347

Please sign in to comment.