model: metrics 0.13.0-alpha.13

This commit is contained in:
Jack Grigg 2020-12-22 12:27:36 +00:00
parent 69d987644c
commit 8389389d37
7 changed files with 12 additions and 12 deletions

View file

@ -38,7 +38,7 @@ bitvec = "0.18"
subtle = "2.3" subtle = "2.3"
crossbeam-utils = "0.7" crossbeam-utils = "0.7"
ff = "0.8" ff = "0.8"
metrics = "=0.13.0-alpha.11" metrics = "=0.13.0-alpha.13"
num_cpus = "1.13" num_cpus = "1.13"
rand = "0.7" rand = "0.7"

View file

@ -5,7 +5,7 @@ use std::collections::HashMap;
use std::fmt; use std::fmt;
use std::sync::Arc; use std::sync::Arc;
use metrics::{Key, Recorder, Unit}; use metrics::{GaugeValue, Key, Recorder, Unit};
/// A [`metrics`] recorder for examining halo2 metrics. /// A [`metrics`] recorder for examining halo2 metrics.
/// ///
@ -94,11 +94,11 @@ impl Recorder for ModelRecorder {
.or_default() += value; .or_default() += value;
} }
fn update_gauge(&self, _key: Key, _value: f64) { fn update_gauge(&self, _key: Key, _value: GaugeValue) {
unimplemented!() unimplemented!()
} }
fn record_histogram(&self, _key: Key, _value: u64) { fn record_histogram(&self, _key: Key, _value: f64) {
unimplemented!() unimplemented!()
} }
} }

View file

@ -125,7 +125,7 @@ impl<C: CurveAffine> Params<C> {
poly: &Polynomial<C::Scalar, Coeff>, poly: &Polynomial<C::Scalar, Coeff>,
r: Blind<C::Scalar>, r: Blind<C::Scalar>,
) -> C::Projective { ) -> C::Projective {
metrics::increment!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit"); metrics::increment_counter!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit");
let mut tmp_scalars = Vec::with_capacity(poly.len() + 1); let mut tmp_scalars = Vec::with_capacity(poly.len() + 1);
let mut tmp_bases = Vec::with_capacity(poly.len() + 1); let mut tmp_bases = Vec::with_capacity(poly.len() + 1);
@ -146,7 +146,7 @@ impl<C: CurveAffine> Params<C> {
poly: &Polynomial<C::Scalar, LagrangeCoeff>, poly: &Polynomial<C::Scalar, LagrangeCoeff>,
r: Blind<C::Scalar>, r: Blind<C::Scalar>,
) -> C::Projective { ) -> C::Projective {
metrics::increment!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit_lagrange"); metrics::increment_counter!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit_lagrange");
let mut tmp_scalars = Vec::with_capacity(poly.len() + 1); let mut tmp_scalars = Vec::with_capacity(poly.len() + 1);
let mut tmp_bases = Vec::with_capacity(poly.len() + 1); let mut tmp_bases = Vec::with_capacity(poly.len() + 1);

View file

@ -112,7 +112,7 @@ impl<'a, C: CurveAffine> MSM<'a, C> {
assert_eq!(scalars.len(), len); assert_eq!(scalars.len(), len);
metrics::increment!("multiexp", "size" => format!("{}", len), "fn" => "MSM::eval"); metrics::increment_counter!("multiexp", "size" => format!("{}", len), "fn" => "MSM::eval");
bool::from(best_multiexp(&scalars, &bases).is_zero()) bool::from(best_multiexp(&scalars, &bases).is_zero())
} }
} }

View file

@ -175,7 +175,7 @@ impl<C: CurveAffine> Proof<C> {
let d = C::Scalar::rand(); let d = C::Scalar::rand();
let s = C::Scalar::rand(); let s = C::Scalar::rand();
metrics::increment!("multiexp", "val" => "delta", "size" => "3"); metrics::increment_counter!("multiexp", "val" => "delta", "size" => "3");
let delta = best_multiexp(&[d, d * &b, s], &[g, u, params.h]).to_affine(); let delta = best_multiexp(&[d, d * &b, s], &[g, u, params.h]).to_affine();
// Feed delta into the transcript // Feed delta into the transcript

View file

@ -55,7 +55,7 @@ impl<'a, C: CurveAffine> Guard<'a, C> {
pub fn compute_g(&self) -> C { pub fn compute_g(&self) -> C {
let s = compute_s(&self.challenges_sq, self.allinv); let s = compute_s(&self.challenges_sq, self.allinv);
metrics::increment!("multiexp", "size" => format!("{}", s.len()), "fn" => "compute_g"); metrics::increment_counter!("multiexp", "size" => format!("{}", s.len()), "fn" => "compute_g");
let mut tmp = best_multiexp(&s, &self.msm.params.g); let mut tmp = best_multiexp(&s, &self.msm.params.g);
tmp += self.msm.params.h; tmp += self.msm.params.h;
tmp.to_affine() tmp.to_affine()

View file

@ -205,7 +205,7 @@ impl<G: Group> EvaluationDomain<G> {
assert_eq!(a.values.len(), 1 << self.k); assert_eq!(a.values.len(), 1 << self.k);
// Perform inverse FFT to obtain the polynomial in coefficient form // Perform inverse FFT to obtain the polynomial in coefficient form
metrics::increment!("ifft", "size" => format!("{}", a.len()), "fn" => "lagrange_to_coeff"); metrics::increment_counter!("ifft", "size" => format!("{}", a.len()), "fn" => "lagrange_to_coeff");
Self::ifft(&mut a.values, self.omega_inv, self.k, self.ifft_divisor); Self::ifft(&mut a.values, self.omega_inv, self.k, self.ifft_divisor);
Polynomial { Polynomial {
@ -240,7 +240,7 @@ impl<G: Group> EvaluationDomain<G> {
Self::distribute_powers(&mut a.values, g); Self::distribute_powers(&mut a.values, g);
} }
a.values.resize(self.extended_len(), G::group_zero()); a.values.resize(self.extended_len(), G::group_zero());
metrics::increment!("fft", "size" => format!("{}", self.extended_len()), "fn" => "coeff_to_extended"); metrics::increment_counter!("fft", "size" => format!("{}", self.extended_len()), "fn" => "coeff_to_extended");
best_fft(&mut a.values, self.extended_omega, self.extended_k); best_fft(&mut a.values, self.extended_omega, self.extended_k);
Polynomial { Polynomial {
@ -259,7 +259,7 @@ impl<G: Group> EvaluationDomain<G> {
assert_eq!(a.values.len(), self.extended_len()); assert_eq!(a.values.len(), self.extended_len());
// Inverse FFT // Inverse FFT
metrics::increment!("ifft", "size" => format!("{}", a.len()), "fn" => "extended_to_coeff"); metrics::increment_counter!("ifft", "size" => format!("{}", a.len()), "fn" => "extended_to_coeff");
Self::ifft( Self::ifft(
&mut a.values, &mut a.values,
self.extended_omega_inv, self.extended_omega_inv,