Skip to content

Commit

Permalink
benchdnn: softmax: fix p2p compare for logsoftmax
Browse files Browse the repository at this point in the history
Relaxed acc-mode shouldn't affect point-to-point comparison of
logsoftmax. It was meant for post-ops and scales.
  • Loading branch information
dzarukin committed Jan 24, 2025
1 parent f30a810 commit 896dd8e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/benchdnn/softmax/softmax.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 Intel Corporation
* Copyright 2024 Arm Ltd. and affiliates
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -258,9 +258,11 @@ void setup_cmp(compare::compare_t &cmp, const prb_t *prb, data_kind_t kind,
#endif
cmp.set_threshold(trh);

// LogSoftMax is unstable enough when there are attributes on top.
const bool compare_with_norm
= (prb->alg == alg_t::LOGSOFTMAX && !prb->attr.is_def());
// LogSoftMax is unstable enough when there are compute attributes (such as
// post-ops or scales) on top of it.
const bool compare_with_norm = (prb->alg == alg_t::LOGSOFTMAX
&& !prb->attr.is_def(
/* skip_fpmath = */ true, /* skip_acc_mode = */ true));
cmp.set_norm_validation_mode(compare_with_norm);

const int64_t axis_size = prb->dims[prb->axis];
Expand Down

0 comments on commit 896dd8e

Please sign in to comment.