ZLow add operation
ZLow operation to perform an add.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow 2D average pooling operation
ZLow operation to perform 2D average pooling.
- shape is a 1D MemRef (memref<6xi64>) whose items are:
- 1st item: batch size
- 2nd item: channel
- 3rd item: height in
- 4th item: width in
- 5th item: height out
- 6th item: width out
- kernel_shape: 1D array of kernel height and width
- strides: 1D array of stride height and width
- padding_type: SAME_PADDING or VALID_PADDING.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
kernel_shape | ::mlir::ArrayAttr | 64-bit integer array attribute |
strides | ::mlir::ArrayAttr | 64-bit integer array attribute |
padding_type | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
output |
memref of dlfloat16 type values |
ZLow batchnorm operation
ZLow operation to perform batchnorm.
- shape is a 1D MemRef (memref<4xi64>) whose items are:
- 1st item: batch size
- 2nd item: height
- 3rd item: width
- 4th item: channel
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
A |
memref of dlfloat16 type values |
B |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
output |
memref of dlfloat16 type values |
ZLow 2D convolution operation
ZLow operation to perform 2D convolution.
- shape is a 1D MemRef (memref<7xi64>) whose items are:
- 1st item: batch size
- 2nd item: channel in
- 3rd item: height in
- 4th item: width in
- 5th item: channel out
- 6th item: height out
- 7th item: width out
- kernel_shape: 1D array of kernel height and width
- strides: 1D array of stride height and width
- padding_type: SAME_PADDING or VALID_PADDING.
- act_func: ACT_NONE or ACT_RELU.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
kernel_shape | ::mlir::ArrayAttr | 64-bit integer array attribute |
strides | ::mlir::ArrayAttr | 64-bit integer array attribute |
padding_type | ::mlir::StringAttr | string attribute |
act_func | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
input_kernel |
memref of dlfloat16 type values |
input_bias |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
output |
memref of dlfloat16 type values |
Convert a dlfloat16 value to a float32 value
This operation converts a dlfloat16 value to a float32 value.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
input |
dlfloat16 type |
Result | Description |
---|---|
output |
32-bit float |
Convert dlfloat16 values to float32 values
This operation converts dlfloat16 values to float32 values.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
input |
vector of 16-bit float values of length 8 |
Result | Description |
---|---|
output1 |
vector of 32-bit float values of length 4 |
output2 |
vector of 32-bit float values of length 4 |
Convert a float32 value to a dlfloat16 value
This operation converts a float32 value to a dlfloat16 value.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
input |
32-bit float |
Result | Description |
---|---|
output |
dlfloat16 type |
Convert float32 values to dlfloat16 values
This operation converts float32 values to dlfloat16 values.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operand | Description |
---|---|
input1 |
vector of 32-bit float values of length 4 |
input2 |
vector of 32-bit float values of length 4 |
Result | Description |
---|---|
output |
vector of 16-bit float values of length 8 |
ZLow div operation
ZLow operation to perform a div.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow dummy operation that behaves like identity
ZLow operation to forward the input value to the output value. It will be removed if canonicalization is called.
Traits: MemRefsNormalizable
Operand | Description |
---|---|
input |
any type |
Result | Description |
---|---|
output |
any type |
ZLow exp operation
ZLow operation to perform a exp.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow gru operation
ZLow operation to perform a gru.
- work_area: a 4K-aligned buffer.
- shape is a 1D MemRef (memref<5xi64>) whose items are:;
- 1st item: direction
- 2nd item: timestep
- 3rd item: batchSize
- 4th item: featureSize
- 5th item: hiddenSize
- direction accepts "forward", "reverse", or "bidirectional"
- return_all_steps: -1 returns all timesteps, 0: returns only the last timestep.
- prev_layer for where input comes is "none", "uni", or "bidir"
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
direction | ::mlir::StringAttr | string attribute |
return_all_steps | ::mlir::IntegerAttr | 64-bit signed integer attribute |
prev_layer | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
h0 |
memref of dlfloat16 type values |
input_weights |
memref of dlfloat16 type values |
input_bias |
memref of dlfloat16 type values |
hidden_weights |
memref of dlfloat16 type values |
hidden_bias |
memref of dlfloat16 type values |
work_area |
memref of 8-bit signless integer values |
shape |
memref of 64-bit signless integer values |
hn_output |
memref of dlfloat16 type values |
ZLow gelu operation
ZLow operation to perform a gelu.
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow invsqrt operation
ZLow operation to perform a invsqrt.
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow lstm operation
ZLow operation to perform a lstm. work_area: a 4K-aligned buffer.
- shape is a 1D MemRef (memref<5xi64>) whose items are:
- 1st item: direction
- 2nd item: timestep
- 3rd item: batchSize
- 4th item: featureSize
- 5th item: hiddenSize
- direction accepts "forward", "reverse", or "bidirectional"
- return_all_steps: -1 returns all timesteps, 0: returns only the last timestep
- prev_layer for where input comes is "none", "uni", or "bidir"
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
direction | ::mlir::StringAttr | string attribute |
return_all_steps | ::mlir::IntegerAttr | 64-bit signed integer attribute |
prev_layer | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
h0 |
memref of dlfloat16 type values |
c0 |
memref of dlfloat16 type values |
input_weights |
memref of dlfloat16 type values |
input_bias |
memref of dlfloat16 type values |
hidden_weights |
memref of dlfloat16 type values |
hidden_bias |
memref of dlfloat16 type values |
work_area |
memref of 8-bit signless integer values |
shape |
memref of 64-bit signless integer values |
hn_output |
memref of dlfloat16 type values |
cf_output |
memref of dlfloat16 type values |
ZLow leakyrelu operation
ZLow operation to perform a leakyrelu.
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
alpha | ::mlir::FloatAttr | 32-bit float attribute |
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow log operation
ZLow operation to perform a log.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow matmul operation
ZLow operation to perform a matmul.
- In case of unstacked: X(m, n) * Y(n, p) + Bias(p)
shape is a 1D MemRef (memref<3xi64>) whose items are:
- 1st item: m
- 2nd item: n
- 3rd item: p
- In case of stacked: X(s, m, n) * Y(s, n, p) + Bias(s, p)
or broadcasting1: X(m, n) * Y(s, n, p) + Bias(s, p)
or broadcasting23: X(s, m, n) * Y(n, p) + Bias(p)
shape is a 1D MemRef (memref<4xi64>) whose items are:
- 1st item: s
- 2nd item: m
- 3rd item: n
- 4th item: p
- is_bcast1: -1 broadcasting1, 0: no broadcasting1.
- is_bcast23: -1 broadcasting23, 0: no broadcasting23.
- is_stacked: -1 stacked, 0: unstacked.
- transposeA: !0 transpose A, 0: do not transpose A.
- transposeB: !0 transpose B, 0: do not transpose B.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
is_bcast1 | ::mlir::IntegerAttr | 64-bit signed integer attribute |
is_bcast23 | ::mlir::IntegerAttr | 64-bit signed integer attribute |
is_stacked | ::mlir::IntegerAttr | 64-bit signed integer attribute |
transposeA | ::mlir::IntegerAttr | 64-bit signed integer attribute |
transposeB | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
Bias |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow max operation
ZLow operation to perform a max.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow 2D max pooling operation
ZLow operation to perform 2D max pooling.
- shape is a 1D MemRef (memref<6xi64>) whose items are:
- 1st item: batch size
- 2nd item: channel
- 3rd item: height in
- 4th item: width in
- 5th item: height out
- 6th item: width out
- kernel_shape: 1D array of kernel height and width
- strides: 1D array of stride height and width
- padding_type: SAME_PADDING or VALID_PADDING.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
kernel_shape | ::mlir::ArrayAttr | 64-bit integer array attribute |
strides | ::mlir::ArrayAttr | 64-bit integer array attribute |
padding_type | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
output |
memref of dlfloat16 type values |
ZLow 2D mean reduce operation
ZLow operation to perform 2D mean reduce.
- shape is a 1D MemRef (memref<4xindex>) whose items are:;
- 1st item: batch size": 1st dim of input
- 2rd item: height": 2nd dim of input
- 3th item: width": 3rd dim of input
- 4nd item: channel": 4th dim of input
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Operand | Description |
---|---|
input |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
output |
memref of dlfloat16 type values |
ZLow min operation
ZLow operation to perform a min.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow mul operation
ZLow operation to perform a mul.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow quantized matmul operation
ZLow operation to perform a matmul. work_area: a 4K-aligned buffer having the same layout as bias but dlfloat16 type.
- In case of unstacked: X(m, n) * Y(n, p) + Bias(p)
shape is a 1D MemRef (memref<3xi64>) whose items are:
- 1st item: m
- 2nd item: n
- 3rd item: p
- In case of stacked: X(s, m, n) * Y(s, n, p) + Bias(s, p)
or broadcasting: X(s, m, n) * Y(n, p) + Bias(p)
shape is a 1D MemRef (memref<4xi64>) whose items are:
- 1st item: s
- 2nd item: m
- 3rd item: n
- 4th item: p
- is_bcast: -1 broadcasting, 0: no broadcasting.
- is_stacked: -1 stacked, 0: unstacked.
- DequantizeOutput: -1 output is dequantized, 0: output is not dequantized.
- PreComputedBias: -1 bias is re-computed, 0: bias is not pre-computed.
Values for q_type
are "DLFLOAT16", "INT8", "WEIGHTS", "UNDEFINED".
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
x_q_type | ::mlir::StringAttr | string attribute |
y_q_type | ::mlir::StringAttr | string attribute |
bias_q_type | ::mlir::StringAttr | string attribute |
out_q_type | ::mlir::StringAttr | string attribute |
is_bcast | ::mlir::IntegerAttr | 64-bit signed integer attribute |
is_stacked | ::mlir::IntegerAttr | 64-bit signed integer attribute |
pre_computed_bias | ::mlir::IntegerAttr | 64-bit signed integer attribute |
disable_clipping | ::mlir::IntegerAttr | 64-bit signed integer attribute |
dequantize_output | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type or 8-bit signless integer values |
x_rec_scale |
0D memref of 32-bit float values |
x_offset |
0D memref of 32-bit float values |
Y |
memref of dlfloat16 type or 8-bit signless integer values |
y_rec_scale |
0D memref of 32-bit float values |
y_offset |
0D memref of 32-bit float values |
Bias |
memref of dlfloat16 type or 8-bit signless integer values |
bias_rec_scale |
0D memref of 32-bit float values |
bias_offset |
0D memref of 32-bit float values |
work_area |
memref of dlfloat16 type or 8-bit signless integer values or none type |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type or 8-bit signless integer values |
out_rec_scale |
0D memref of 32-bit float values |
out_offset |
0D memref of 32-bit float values |
ZLow stick operation for quantization
"ZLow operation to perform a quantization stick." "Type is one of values: dlfloat16, int8, and weights."
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
q_type | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of 8-bit signless integer or 32-bit float values |
rec_scale |
0D memref of 32-bit float values |
offset |
0D memref of 32-bit float values |
out |
memref of dlfloat16 type or 8-bit signless integer values |
ZLow reducemax operation
ZLow operation to perform a reducemax.
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
op_type | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
work_area |
memref of 8-bit signless integer values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow reducemin operation
ZLow operation to perform a reducemin.
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
op_type | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
work_area |
memref of 8-bit signless integer values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow relu operation
ZLow operation to perform a relu.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow sigmoid operation
ZLow operation to perform a sigmoid.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow softmax operation
ZLow operation to perform a softmax. work_area: a 4K-aligned buffer. act_func: ACT_NONE or ACT_LOG.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
act_func | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
work_area |
memref of 8-bit signless integer values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow sqrt operation
ZLow operation to perform a sqrt.
Traits: MemRefsNormalizable
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow stick operation for GRU
ZLow operation to perform a stick for GRU. Variadic: list of pointers for input data to be transformed:
- GRU concatenated: 3 data pointers, one for each input gate in (Z)update, Reset, Hidden, (ZRH) gate order.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
prev_layer | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
z_gate |
memref of 16-bit float or 32-bit float values |
r_gate |
memref of 16-bit float or 32-bit float values |
h_gate |
memref of 16-bit float or 32-bit float values |
out |
memref of dlfloat16 type values |
ZLow stick operation for LSTM
ZLow operation to perform a stick for LSTM. Variadic: list of pointers for input data to be transformed:
- LSTM concatenated: 4 data pointers, one for each input gate in Forget, Input, Cell, Output (FICO) order.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
prev_layer | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
f_gate |
memref of 16-bit float or 32-bit float values |
i_gate |
memref of 16-bit float or 32-bit float values |
c_gate |
memref of 16-bit float or 32-bit float values |
o_gate |
memref of 16-bit float or 32-bit float values |
out |
memref of dlfloat16 type values |
ZLow stick operation
"ZLow operation to perform a stick."
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
saturation | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operand | Description |
---|---|
X |
memref of 16-bit float or 32-bit float values |
Out |
memref of dlfloat16 type values |
ZLow sub operation
ZLow operation to perform a sub.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Y |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow tanh operation
ZLow operation to perform a tanh.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
shape |
memref of 64-bit signless integer values |
Out |
memref of dlfloat16 type values |
ZLow unstick operation
ZLow operation to perform a unstick.
Traits: MemRefsNormalizable
Interfaces: MemoryEffectOpInterface
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::StringAttr | string attribute |
Operand | Description |
---|---|
X |
memref of dlfloat16 type values |
Out |
memref of 16-bit float or 32-bit float values |