Skip to content

Commit 0f0897a

Browse files
committed
gpu: nvidia: ip: adjust benchdnn error threshold
1 parent ea6c0b7 commit 0f0897a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/benchdnn/ip/ip.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,14 @@ void skip_invalid_prb(const prb_t *prb, res_t *res) {}
278278

279279
void setup_cmp(compare::compare_t &cmp, const prb_t *prb, data_kind_t kind,
280280
const args_t &ref_args) {
281-
cmp.set_threshold(0.f);
281+
// The nvidia implementation has precision issues in some cases for large problems with post-op sum
282+
if (is_nvidia_gpu()
283+
&& prb->attr.post_ops.find(attr_t::post_ops_t::kind_t::SUM) != -1) {
284+
const float trh = epsilon_dt(prb->dt[2]);
285+
cmp.set_threshold(trh);
286+
} else {
287+
cmp.set_threshold(0.f);
288+
}
282289
}
283290

284291
std::vector<int> supported_exec_args(dir_t dir) {

0 commit comments

Comments
 (0)