phi-4-ElasticBit / README.md
maxzameer's picture
Upload README.md with huggingface_hub
0bfebd6 verified
|
Raw History Blame Contribute Delete
1.88 kB
---
library_name: mlbricks
tags:
- elasticbit
- quantization
- compression
base_model: microsoft/phi-4
---
# phi-4 — MLBricks ElasticBit
Source: `microsoft/phi-4`
Source revision: `2db69c1c3e91a05d2c64a3185acfbaf36f744e25`
MLBricks commit: `f772eb27d2d6b84764e9e90458827dac6980a88a`
ElasticBit threshold: `0.01`
Persistent global dtypes: preserved from the source model as loaded for conversion
## Conversion result
- Decoder layers: 40
- Parameter-weighted effective bits: 8.126
- Linear storage reduction: 49.18%
- Layer artifact bytes: 12.059 GiB
- Exact global component bytes: 1.914 GiB
- Approximate uploaded inference payload: 13.973 GiB
- Reconstructed end-to-end smoke test: PASS
## Validation
Each newly converted layer is checked on calibration inputs, a separate validation input,
and a local save/load round trip. Before `complete=true`, the converter reconstructs global
payloads from the uploaded safetensors files, streams every uploaded ElasticBit layer through
a real full-model forward, and compares final logits with the pinned FP16 source reference.
## Layout
- `layers/layer_XXX.elasticbit`
- `components/global_manifest.json`
- `components/global_*.safetensors`
- `reports/layer_XXX.json`
- `reports/reconstruction_smoke.json`
- `calibration/input_ids.safetensors`
- `validation/input_ids.safetensors`
- `elasticbit_manifest.json`
- `progress.json`
Layer artifacts use a minimal ElasticBit root namespace: compressed Linear paths are stored as `block.*`.
The root class itself is not serialized. A loader should create a small `nn.Module` with a `.block`
containing the pinned source-compatible decoder architecture, call `ElasticBit.load(root, artifact)`,
then use `root.block` in the reconstructed model while retaining `root` when controller access is needed.
Review the source model license before redistribution or commercial use.