File: attributes_deterministic.md

package info (click to toggle)
onednn 3.7.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 87,776 kB
  • sloc: cpp: 1,016,013; lisp: 16,134; ansic: 12,564; python: 7,219; asm: 831; sh: 69; makefile: 41; javascript: 39
file content (26 lines) | stat: -rw-r--r-- 1,425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Primitive Attributes: deterministic {#dev_guide_attributes_deterministic}
===================================================================

To support debugging, validation and certification of some applications, oneDNN
provides a deterministic mode. This mode guarantees that multiple executions of
the same primitive on a given platform return the exact same result bitwise.

For most primitives, oneDNN provides a run-to-run deterministic execution for a
fixed environment. In particular, if the hardware platform and software
environment (library/runtime versions, environment variables, etc.) are
identical between multiple runs, the produced results should be bit-wise
identical.

However, some implementations rely on non-deterministic constructs such as
atomic operations. In order to guarantee deterministic execution, a
deterministic attribute can be set (default false) with the
@ref dnnl_primitive_attr_set_deterministic (C API) or the
@ref dnnl::primitive_attr::set_deterministic (C++ API) functions.

The deterministic primitive attribute accepts:
- `false` (default): Permits the library to use non-deterministic constructs
      resulting in non-identical run-to-run outputs.
- `true`: Enforces dispatching of implementations with deterministic execution.

Enforcing deterministic execution might impact the performance of Convolution,
Matmul, and normalization primitives, especially on some GPU devices.