Files
oneDNN/tests/benchdnn/doc/driver_gnorm.md
2025-03-12 15:08:59 -07:00

2.7 KiB

Group Normalization Driver

Usage

    ./benchdnn --gnorm [benchdnn-knobs] [gnorm-knobs] [gnorm-desc] ...

where gnorm-knobs are:

  • --dir={FWD_D [default], FWD_I, BWD_D, BWD_DW} -- dnnl_prop_kind_t. Refer to direction for details.
  • --dt={f32:f32 [default], ...} -- src and dst data types. Refer to data types for details.
  • --tag={abcd:any [default], ...} -- physical src and dst memory format. If only src memory format is provided, dst memory format will be set to any. Refer to tags for details.
  • --flags=[|G|C|H] -- group normalization flags, default none; where multiple simultaneous flags are supported. G is dnnl_use_global_stats; C is dnnl_use_scale; H is dnnl_use_shift; Refer to group normalization primitive for details.
  • --inplace=BOOL -- memory mode for the primitive. If true, it uses input memory as output, otherwise, input and output are separate. Default is false.
  • --match=REGEX -- skip problems not matching the regular expression in REGEX. By default no pattern is applied (run everything). Note: Windows may interpret only string arguments surrounded by double quotation marks.
  • Any attributes options. Refer to attributes for details.

and gnorm-desc is a problem descriptor. The canonical form is:

    gXmbXicX_idXihXiwX_epsF_nS

Refer to descriptor for details. epsF stands for Group Normalization epsilon value and accepts float F values. The default is 1.f/16.

Examples

Run a set of gnorms from an input file, using the default settings:

    ./benchdnn --gnorm --batch=shapes_ci

Run a named problem with single precision src/dst, iterating by:

  1. Src/dst memory formats
  2. forward training, backward by data and weights prop_kinds,
  3. some flag combinations:
    ./benchdnn --gnorm --dt=f32 --tag=abc,acb --dir=FWD_D,BWD_DW \
               --flags=GCH,CH g5ic5iw10_n"gnorm_test_shape"

Run the same problem as previous but with different data types for source and destination:

    ./benchdnn --gnorm --dt=bf16:f32 --tag=abc,acb --dir=FWD_D,BWD_DW \
               --flags=GCH,CH g5ic5iw10_n"gnorm_test_shape"

More examples with different driver options can be found at inputs/gnorm/test_*. Examples with different problem descriptors can be found at inputs/gnorm/shapes_*. Examples with different benchdnn common options can be found at driver_conv.md.