Skip to content

Commit

Permalink
adjust atol/rtol
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Sep 24, 2024
1 parent bd2e854 commit 5109921
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ fn assertions_options(command: clap::Command) -> clap::Command {
.arg(
Arg::new("approx")
.takes_value(true)
.possible_values(["exact", "close", "approximate", "super"])
.possible_values(["exact", "close", "approximate", "very", "super"])
.default_value("close")
.long("approx")
.help("Approximation level used in assertions."),
Expand Down
1 change: 1 addition & 0 deletions cli/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ impl Assertions {
"exact" => Approximation::Exact,
"close" => Approximation::Close,
"approximate" => Approximation::Approximate,
"very" => Approximation::VeryApproximate,
"super" => Approximation::SuperApproximate,
_ => panic!()
};
Expand Down
4 changes: 3 additions & 1 deletion data/src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum Approximation {
#[default]
Close,
Approximate,
VeryApproximate,
SuperApproximate,
}

Expand All @@ -49,7 +50,8 @@ impl Approximation {
(Approximate, qp) if qp.is_quantized() => (qp.zp_scale().1 as f64, 0.),
(Close, _) => (1e-7, 1e-7),
(Approximate, _) => (1e-4, 5e-4),
(SuperApproximate, _) => (5e-2, 1e-2),
(VeryApproximate, _) => (5e-2, 1e-2),
(SuperApproximate, _) => (1e-1, 5e-2),
}
}
}
Expand Down

0 comments on commit 5109921

Please sign in to comment.