coreai_opt.quantization.spec.StatelessQParamsCalculatorBase¶
- class coreai_opt.quantization.spec.StatelessQParamsCalculatorBase(**kwargs)[source]¶
Bases:
QParamsCalculatorBaseStateless base: no cached qparams; recomputed every forward.
Used for dynamic quantization where activations vary per inference and the scale shape may change across forwards (e.g. LLM token-wise with variable sequence length).
self.scale/zero_point/minvalare assigned in forward as plain Python attributes (not buffers) for debugging visibility only — they reflect the most recent forward and are not instate_dict.FakeQuantizeImplBasekeepsobserver_enabled = 1for this subclass so the recompute path stays live.get_qparamsis undefined;set_export_mode(True)raises;float_range=[None, None]is required.
Methods
compute_qparams(tensor, min_val, max_val)Given the observed min/max range, return
(scale, zero_point, minval).forward(tensor)Compute qparams from
tensorand return; no buffer state.get_class(key)list_registry_keys()list_registry_values()register(key)Register a virtual subclass of an ABC.
resolve(data)Resolve a string key or class type against this registry.
set_export_mode([enabled])