What problem does it solve? Custom quantization kernels often mismatch framework operators (aclnn) at the byte level even when outputs look statistically identical. This Skill reverse-engineers the undocumented numeric contract of a quantizer—scale granularity, rounding mode, saturation behavior, and degenerate-block rules—from device bytes, then guides bit-exact reimplementation and fusion of quantizers such as MXFP8 (e8m0), int8 per-block, and fp8 per-channel on Ascend NPU with torch_npu, CANN, and triton-ascend. ## Core Features & Use Cases - Contract Reverse Engineering: A six-step method (discriminative probes, marker-based layout detection, independent reference implementation, degenerate-input coverage, corrigendum of falsified formulas) to derive encoding formulas like byte = 119 + floor(log2(amax)) instead of guessing. - Bit-Level Comparison SOP: Same-process, same-data verification with separate payload/scale counting, adversarial inputs (all 165 e4m3 midpoints, subnormals, inf/nan, tail blocks), and md5-identity end-to-end gates. - Implementation Pitfall Rules: Load divisors from memory instead of recomputing in-kernel, use integer RNE bit tricks for bf16 rounding, and treat 8-bit casts as wrap-around rather than saturation. - Use Case: Your fused quantization kernel matches the framework operator on 99.9% of payload bytes but not exactly—use this Skill to identify whether the cause is scale granularity, rounding mode, strength-reduced division, or a silently eliminated bf16 cast, then fix it to reach 100% byte equality. ## Quick Start Ask the AI to reverse-engineer why your fused quantization kernel's output differs from the framework's quantization operator and produce a bit-exact reimplementation.