Expand description
The activation quantizer (crate::spatial::decode_engine::numerics::quantize) as Verilog: a block of 32 f32
values to its 4-bit-significand scale and its codes.
The scale has a closed form in the block’s largest magnitude S·2^(E−23) (S its 24-bit significand): with
m₁ = ⌈⌈S/2¹³⌉/127⌉, the scale is m₁·2^(E−10) when m₁ ≤ 15, else ⌈⌈S/2¹⁴⌉/127⌉·2^(E−9), a significand of 8
or 9 (closed_form_scale, held to block_scale over every significand). A code is the exact quotient of its
value by the scale, carried with 32 fraction bits and a remainder, rounded to nearest with ties to even.
Constants§
- WIDE_
SCALE_ P_ LATENCY - Clocks from
logos_wide_scale_p’s operands to their scale.
Functions§
- act_
quant_ verilog logos_act_block(x, two) -> (m, e, codes): 32 f32 values packed little-end first inx;twoselects the two-word codes;codespacks 32 signed 16-bit codes;eis the scale’s exponent, signed.logos_act_wide #(LANES)is the per-block quantizer over a block ofLANESvalues: the same ports, itsmeight bits.logos_act_stream #(LANES)islogos_act_wideover a block arriving sixteen values a beat, with sixteen code units: one quantizer for every block length up toLANES, its beats held in block RAM.logos_wide_scale_pislogos_wide_scalefor the user clock, its scaleWIDE_SCALE_P_LATENCYclocks after its operands.- closed_
form_ scale - The block scale’s closed form, for a normal
amaxwith significands(24 bits) and unbiased exponente. - closed_
form_ wide_ scale - The per-block scale’s closed form (
crate::spatial::decode_engine::numerics::wide_scale, an 8-bit significand), for a normalamaxwith significands(24 bits) and unbiased exponente: withm₁ = ⌈⌈S/2⁹⌉/127⌉, the scale ism₁·2^(e−14)whenm₁ ≤ 255, else⌈⌈S/2¹⁰⌉/127⌉·2^(e−13), a significand of 128 to 130.