/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Int8-quantize the #244 coarse-placer (milestone 3). The placer is a linear classifier, so the * only weight is a dense [class][feature] fp32 matrix (12×65536 = 3.0 MB). Per-CLASS symmetric * int8 quantization — `scale[c] = max(|W[c]|) / 127`, `q = round(W / scale)` clamped to [-127, * 127] — shrinks it to 0.75 MB (4×) while preserving the linear math exactly up to rounding (the * logit is `bias[c] + scale[c] * Σ int8`, dequantized on load by `CoarsePlacer.fromArtifactDir`). * Per-class scales matter because class weight magnitudes differ (OTHER's outlier-exposure rows * push bigger weights than the in-map countries). * * Verify the accuracy cost with `mailwoman placer eval quant-compare` (target: within ~1pp). * * Run: `mailwoman placer quantize [--in ] [--out ]` */ /** * Options for {@linkcode quantizeCoarsePlacer}. */ export interface QuantizeCoarsePlacerOptions { /** * Fp32 artifact dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`. */ in?: string; /** * Int8 output dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model-int8`. */ out?: string; } /** * Result of {@linkcode quantizeCoarsePlacer}. */ export interface QuantizeCoarsePlacerResult { outDir: string; fp32Bytes: number; int8Bytes: number; maxAbsErr: number; rmse: number; } /** * Coarse-placer int8 quantizer — see the module doc. */ export declare function quantizeCoarsePlacer(options?: QuantizeCoarsePlacerOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=quantize.d.ts.map