5.5 KiB
Recurrent Neural Network Driver
Usage
./benchdnn --rnn [benchdnn-knobs] [rnn-knobs] [rnn-desc] ...
where rnn-knobs are:
--prop={FWD_I [default], FWD_D, BWD_DW}
-- dnnl_prop_kind_t. Refer to direction for details.--cfg={f32 [default], ...}
-- refer toConfigurations
below.--tag={any:any:any [default], ...}
-- physical src, weights and dst memory layouts. Refer to tags for details.--alg={VANILLA_RNN [default], VANILLA_LSTM, VANILLA_GRU, LBR_GRU, VANILLA_AUGRU, LBR_AUGRU}
-- RNN algorithm.--direction={left2right [default], right2left, concat, sum}
-- RNN evaluation direction.--activation={RELU [default], LOGISTIC, TANH}
--VANILLA_RNN
activation functions.--scaling="scale_str"
-- RNN scaling policy, default""
(no scaling).--scaling-proj="scale_str"
-- RNN scaling policy for the projection weights, default""
(no scaling). Refer to attributes for details.--skip-nonlinear={true, false [default]}
-- specify if transcendental activations will be treated as linear. This allows to test longer chains avoiding errors coming from non-linear activation functions. Especially relevant for int8 computations. For LSTM, GRU and AUGRU flows changes internal implementation since there is no external control over pre-defined activations in a cell.--trivial-strides={true, false [default]}
-- specify if input tensors should have trivial strides or not. Each tensor stride is the product of previous dimensions.--with-peephole={true, false [default]}
-- LSTM extension. Specify if LSTM with peephole should be run.--with-projection={true, false [default]}
-- LSTM extension. Specify if LSTM with projection should be run.--l=INT
-- overridel
(number of layers) value specified in the problem descriptor. WhenINT
is set to0
(the default), usel
value specified in the problem descriptor.--t=INT
-- overridet
(number of timestamps) value specified in the problem descriptor. WhenINT
is set to0
(the default), uset
value specified in the problem descriptor.--mb=INT
-- overridemb
(minibatch) value specified in the problem descriptor. WhenINT
is set to0
(the default), usemb
value specified in the problem descriptor.--flags=[|O]
-- RNN flags, defaultundef
(no flags); where multiple simultaneous flags are supported.O
is dnnl_rnn_flags_diff_weights_overwrite; Refer to RNN primitive for details.- Any attributes options. Refer to attributes for details.
and rnn-desc is a problem descriptor. The canonical form is:
lXtXmbX_sicX_slcX_dhcX_dicX_nS
Here X
is an integer number and S
is a string literal without spaces (n
stands for name). The special symbol _
is ignored, so it may be used as a
delimiter for better readability.
Description of RNN descriptor symbols:
l
is the number of layers. The default value is1
.t
is the number of timestamps (or the sequence length). The default value is1
.mb
is the minibatch. The default value is2
.sic
is the feature size ofsrc_iter
. No default value.slc
is the feature size ofsrc_layer
. The default value issic
.dhc
is the hidden feature size. The default value issic
.dic
is the feature size ofdst_iter
. The default value isdhc
. For GRU and AUGRU it must be equal todhc
.
Precision Configurations
The --cfg
option specifies the data types to be used for a
problem. It also defines the data filling strategy. It is implicit for the
integer type saturation. This option also defines the threshold for computation
errors.
The table below shows supported name configurations for this driver:
states iter | states iter_c | input | dst_iter | dst_last_layer | bias | cfg | notes |
---|---|---|---|---|---|---|---|
f32 | f32 | f32 | f32 | f32 | f32 | f32 | TBA |
bf16 | bf16 | bf16 | bf16 | bf16 | bf16 | bf16 | TBA |
bf16 | bf16 | bf16 | bf16 | bf16 | f32 | bf16f32 | TBA |
u8 | f32 | u8 | u8 | u8 | f32 | u8u8u8u8 | TBA |
u8 | f32 | u8 | u8 | f32 | f32 | u8u8u8f32 | TBA |
f32 | f32 | u8 | f32 | u8 | f32 | f32u8f32u8 | TBA |
f32 | f32 | u8 | f32 | f32 | f32 | f32u8f32f32 | TBA |
f16 | f16 | f16 | f16 | f16 | f16 | f16 | Only for GPU |
Essence of Testing
TBA.
Examples. TBA.
Run the set of rnn training from an input file with the default settings:
./benchdnn --rnn --batch=inputs/rnn/shapes_training
More examples with different driver options can be found at inputs/rnn/test_*. Examples with different problem descriptors can be found at inputs/rnn/shapes_*. More examples with different benchdnn common options can be found at driver_conv.md.