--- license: other license_name: sapiens2-license license_link: https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md base_model: facebook/sapiens2-normal-0.8b base_model_relation: quantized library_name: sapiens tags: - sapiens - sapiens2 - int4 - quantized - safetensors --- # sapiens2-normal-0.8b INT4-G128 Packed 4-bit derivative of [facebook/sapiens2-normal-0.8b](https://huggingface.co/facebook/sapiens2-normal-0.8b). This artifact uses symmetric per-group INT4 packing with group size 128 for large floating-point weight tensors. Norms, biases, positional/rope tensors, and small tensors are kept in their source dtype. It is a storage/runtime-loader quant for the current official Sapiens2 code path, not an AWQ/GGUF/NVFP4 LLM artifact. ## Files - `facebook__sapiens2-normal-0.8b-int4-g128.safetensors`: packed INT4 safetensors artifact. - `load_sapiens2_int4.py`: loader that reconstructs a PyTorch state dict for the official Sapiens2 model code. - `config.json` and `preprocessor_config.json`: copied from the source repo. - `quantization_report.json`: build report. ## Quantization Report - Source revision: `0b05360b013e0c0a6db020307a4476e1ea42790c` - Group size: `128` - Source bytes: `3538309852` - Artifact bytes: `458381924` - Compression ratio: `7.7191x` - Tensors: `568` - Quantized tensors: `202` - Max tensor MAE during dequant smoke: `0.00762605` ## Fidelity Validation The packed INT4 artifact was dequantized back to floating-point tensors and compared against the source checkpoint. - Validation gate: global floating-tensor similarity >= `90.00%` - Result: `PASS` - Global floating-tensor similarity: `99.402250%` - Minimum large-tensor cosine: `0.974280477` ## Loading ```python from load_sapiens2_int4 import load_state_dict state_dict = load_state_dict("facebook__sapiens2-normal-0.8b-int4-g128.safetensors", device="cpu") # Then instantiate the matching official Sapiens2 architecture and load: # model.load_state_dict(state_dict, strict=True) ``` ## Limitations This is a verified packed-weight artifact with a dequantizing loader. It does not claim native INT4 CUDA kernels for Sapiens2 yet. Runtime speedups require a Sapiens2-specific kernel/export path and should be benchmarked separately.