Skip to content

Commit 383b1a2

Browse files
committed
gpu: nvidia: ip: adjust benchdnn error threshold
1 parent ea6c0b7 commit 383b1a2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/benchdnn/ip/ip.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,16 @@ 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
282+
// for large problems with post-op sum
283+
if (is_nvidia_gpu()
284+
&& prb->attr.post_ops.find(attr_t::post_ops_t::kind_t::SUM) != -1
285+
&& prb->dst_dt() == dnnl_f16) {
286+
const float trh = epsilon_dt(prb->dt[2]);
287+
cmp.set_threshold(trh);
288+
} else {
289+
cmp.set_threshold(0.f);
290+
}
282291
}
283292

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

0 commit comments

Comments
 (0)