FZGPUModules 2.0
GPU-accelerated modular compression pipelines
Loading...
Searching...
No Matches
fz::QuantizerStage< TInput, TCode >::Config Struct Reference

#include <quantizer.h>

Public Attributes

double error_bound = 1e-4
 Error bound (interpretation set by eb_mode).
 
int quant_radius = 32768
 Quantization radius.
 
float outlier_capacity = 0.05f
 Fraction of input size reserved for outliers.
 
float precomputed_value_base = 0.0f
 Pre-computed value_base > 0 to skip the NOA data scan; 0 = auto.
 
bool zigzag_codes = false
 
float outlier_threshold = std::numeric_limits<float>::infinity()
 ABS/NOA: |x| >= threshold → lossless outlier (LC reference threshold). Default: ∞.
 
bool inplace_outliers = false
 
bool linear_mode = false
 
bool linear_high_precision = false
 
bool power_of_two_bound = false
 
bool dither = false
 
uint64_t dither_seed = 0
 
float dither_strength = 1.0f
 

Detailed Description

template<typename TInput = float, typename TCode = uint16_t>
struct fz::QuantizerStage< TInput, TCode >::Config

Construction parameters.

Member Data Documentation

◆ zigzag_codes

template<typename TInput = float, typename TCode = uint16_t>
bool fz::QuantizerStage< TInput, TCode >::Config::zigzag_codes = false

ABS/NOA: zigzag-encode codes before storage to improve compressibility. No effect in REL mode (log-space codes are already unsigned).

◆ inplace_outliers

template<typename TInput = float, typename TCode = uint16_t>
bool fz::QuantizerStage< TInput, TCode >::Config::inplace_outliers = false

ABS/NOA: write outlier raw float bits in-place in the codes array. Removes the scatter buffers; inverse checks (code >> 1) >= quant_radius. Must NOT be used with REL mode.

◆ linear_mode

template<typename TInput = float, typename TCode = uint16_t>
bool fz::QuantizerStage< TInput, TCode >::Config::linear_mode = false

ABS/NOA: linear / no-outlier mode (cuSZp-style). Emits raw signed codes (q = round(x / 2·eb), stored two's-complement in TCode and declared as the signed DataType), with NO radius clamp, NO outlier ports, NO zigzag — a value outside TCode range is rejected, so size TCode wide enough (use uint32_t). Intended front-end for LorenzoStage(blockSize=32) → AdaptiveBitpackStage. Mutually exclusive with REL, inplace_outliers, and zigzag_codes.

◆ linear_high_precision

template<typename TInput = float, typename TCode = uint16_t>
bool fz::QuantizerStage< TInput, TCode >::Config::linear_high_precision = false

Linear mode only: evaluate x/(2*abs_eb) with a precomputed double reciprocal and double multiply. For non-power-of-two bounds the stage also tightens its internal bound enough to absorb final TInput reconstruction rounding, making the user bound a strict guarantee.

◆ power_of_two_bound

template<typename TInput = float, typename TCode = uint16_t>
bool fz::QuantizerStage< TInput, TCode >::Config::power_of_two_bound = false

Uniform ABS/NOA/PREL modes: round the resolved absolute half-bound downward to the nearest power of two. This is between 1x and 2x tighter than requested and makes scaling an exact binary exponent shift. Inspired by SLEEK (IPDPS 2026), Sec. III-A. REL is unsupported because it quantizes in log space.

◆ dither

template<typename TInput = float, typename TCode = uint16_t>
bool fz::QuantizerStage< TInput, TCode >::Config::dither = false

ABS/NOA/REL: reconstruct to a deterministic pseudo-random point within the bin/error-bound interval instead of always the bin center (LC's QUANT_*_R vs. QUANT_*_0). Decorrelates reconstruction error from the signal at no extra storage cost — the offset is a pure function of (element index, dither_seed), reproduced identically on decode. Any element whose dithered reconstruction would violate the error bound is escalated to a lossless outlier instead (same mechanism used for out-of-radius values). Mutually exclusive with linear_mode and inplace_outliers (both lack a per-element outlier-escalation path).

◆ dither_seed

template<typename TInput = float, typename TCode = uint16_t>
uint64_t fz::QuantizerStage< TInput, TCode >::Config::dither_seed = 0

Seed for the deterministic dither offset. Persisted in the serialized header so decode reproduces identical offsets with no extra storage.

◆ dither_strength

template<typename TInput = float, typename TCode = uint16_t>
float fz::QuantizerStage< TInput, TCode >::Config::dither_strength = 1.0f

Dither offset amplitude as a fraction of abs_eb (or, in REL mode, of half a log-bin width), in (0, 1]. 1.0 (default) matches LC's literal "_R" definition — offset spans the full bin — and empirically escalates ~25% of elements to lossless outliers for smooth data. Lower values trade decorrelation strength for fewer outliers; 0.0 disables the offset entirely (bit-identical to dither=false).